Design a Task Scheduler
OtherSoftware Engineer · OnsiteLast updated
Design a durable task scheduler with due-time indexing, atomic claims, worker leases, retry states, recurring occurrences, and clear duplicate-delivery semantics.
Constraints & Assumptions
The reported system-design prompt is a task scheduler without detailed scaling requirements. Start with a modest durable design and state whether tasks are one-time or recurring; do not assume an unreported global scale.
Clarifying Questions
What timing precision and lateness are acceptable? Are tasks recurring? What execution duration, retry, cancellation, and duplicate-effect guarantees are required?
Follow-up questions
- How do you avoid two schedulers dispatching the same due task? What happens on a crash after dispatch? How would you add recurring schedules or partition the service if load grows?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.