Design a distributed job scheduler
PremiumDistributed infrastructureMedium
- Job scheduling
- Cron
- At least once execution
Quick answer
This distributed infrastructure interview question asks you to design a distributed job scheduler. Aim for a design that keeps working across many machines and failures, then explain partitioning, replication, coordination and trade-offs. Interviewers want to see how you reason about failures, consistency and scale.
The problem
Design a distributed job scheduler that runs cron-style recurring jobs and one-time delayed jobs for every team. It triggers each run on time, hands it to a worker, retries failures and records the result. The hard parts are never triggering a run twice, surviving scheduler and worker crashes, and the midnight spike of a million due jobs.
Jobs include sending reports, cleaning data, charging subscriptions and syncing partners, so a run that happens twice can cost real money.
What must a distributed job scheduler do?
- Schedules: Cron expressions with a time zone, fixed intervals, and one-time jobs at a given time.
- Execution: Hand each run to a worker with a timeout; record status, attempts, start and end times and output.
How well must it do it?
- Trigger accuracy: A due run is queued within 5 s of its scheduled time at p99.
- No duplicate triggers: Zero duplicate run records for one scheduled time.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Job scheduling
- Cron
- At least once execution
- Idempotency
- Leases
- Fencing tokens
How you’ll practise
- Requirements
- Estimate
- Data model and API
- Partitioning and replication
- Consistency and failures
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any distributed infrastructure design round.
- States the consistency and availability guarantees up front
- Explains partitioning and replication choices
- Describes how nodes agree and recover after failures
- Handles network partitions and slow nodes
- Plans for adding and removing capacity safely
- Names the trade-offs instead of hiding them
Questions people ask about this interview question
- Which design type is this question?
- It is a distributed infrastructure question. You design a distributed job scheduler and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- What should I cover first?
- Start with the guarantees the system must give and the failures it must survive. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team