Skip to content
System design · Senior · 14 min

Design a distributed cron that runs 50,000 scheduled jobs

Leader election, a durable schedule, idempotent launches and catch-up policy for a cron with 50k jobs.

Prompt

Teams register jobs with a cron expression, a container image and a timeout. Design the scheduler so each job runs at most once per tick, survives the loss of a scheduler host, and tolerates a 10-minute outage without skipping jobs that matter.

Questions worth clarifying

  • At-most-once per tick is required; duplicates are worse than a late run
  • Jobs run in an existing container platform; we only trigger them
  • Late start tolerance: 60 s for most jobs, 5 s for a tagged minority
  • Catch-up after an outage: run once, not N times
  • Single region for v1

Inputs you will estimate from

Registered jobsDue at the top of the hourLaunch call latencyLaunch concurrency / workerMust-start windowAverage job runtimeState per job
Free to try · sign in to save your attemptOpen the workbench with live capacity math
Open in the app