Design a Distributed Job Scheduler

HardInfrastructureSchedulingLeader ElectionExactly-onceQueuesAbout 45 minutes

Design a service that runs jobs at scheduled times or on a cron schedule for many internal teams: 10M scheduled jobs, up to 50,000 starting in the same minute. Each run should happen once, on time within a few seconds, and survive machine failures.

How the interview goes

Five phases, and questions the interviewer is likely to ask in each.

  1. 1. Requirements

    • What should happen to runs missed during an outage?
    • Is at-least-once acceptable if jobs are idempotent?
    Show a hint

    Ask what 'exactly once' really needs from the jobs themselves.

  2. 2. High-level design

    • What separates deciding a job is due from running it?
    • How is work split across scheduler nodes?
    Show a hint

    Separate the decision 'this is due' from the act of running it.

  3. 3. Deep dive

    • Show me how a run is claimed so only one node starts it.
    • How do you detect a dead worker?
    Show a hint

    A time-bound claim on a run lets another node take over if the owner dies.

  4. 4. Scaling

    • How do you spread 50,000 starts at 09:00?
    • What if one team schedules a million jobs?
    Show a hint

    Index or bucket jobs by their next run time.

  5. 5. Trade-offs

    • Leader election or partitioning?
    • Run missed jobs on recovery, or skip them?
    Show a hint

    Missed runs after an outage are a product decision as much as a technical one.

Practice this with an AI interviewer

Write your design doc with live diagrams while the interviewer asks one question at a time and pushes on your choices. Get a scored debrief with what to study next.

Start this interview