7
Back to Problem Dungeon

Job Scheduler

hard

Step 1: Requirements

Requirements

Questions to ask

  1. Cron-based scheduling or one-time delayed execution or both?
  2. How many concurrent jobs?
  3. Job persistence (survive restart)?
  4. Retry on failure? How many times, what backoff?
  5. Priority queue or FIFO?
  6. Job dependencies (job B runs after job A completes)?
  7. Distributed (multi-worker) or single process?

Functional requirements

  • Schedule jobs for one-time or recurring execution (cron expressions)
  • Job lifecycle: PENDING → RUNNING → COMPLETED | FAILED | RETRYING
  • Configurable retry: max attempts, exponential backoff
  • Priority levels: HIGH, NORMAL, LOW
  • Cancel a scheduled/running job
  • Job history with execution time, result, and error

Non-functional requirements

  • Persist job queue (survive process restart)
  • Concurrency limit (max N jobs running simultaneously)
  • Observable: job status changes, completion events
  • Extensible: new job types without modifying scheduler

1 / 7 — Requirements