Design a service that schedules tasks for execution. Explain how tasks become due, how workers claim them, and how the system handles failures without losing accepted work.
### 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?
### What a Strong Answer Covers
A task model, durable scheduling state, atomic claims, worker leases, retries, and observable delivery semantics.
### 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?
Overview: Design a durable task scheduler with due-time indexing, atomic claims, worker leases, retry states, recurring occurrences, and clear duplicate-delivery semantics.
Design a service that schedules tasks for execution. Explain how tasks become due, how workers claim them, and how the system handles failures without losing accepted work.
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 Guidance
What timing precision and lateness are acceptable? Are tasks recurring? What execution duration, retry, cancellation, and duplicate-effect guarantees are required?
What a Strong Answer Covers Guidance
A task model, durable scheduling state, atomic claims, worker leases, retries, and observable delivery semantics.
Follow-up Questions Guidance
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?