Preview — Pro guide
You are seeing a portion of this guide. Sign in and upgrade to unlock the full article, quizzes, and interview answers.
Sections
Related Guides
Online Shopping Cart & Checkout — LLD (Lines, Idempotency, Order Boundaries)
Low-Level Design
Movie & Event Ticket Booking — LLD (Seat Map, Holds, Concurrency)
Low-Level Design
Concurrency Patterns: Thread Safety, Producer-Consumer, Read-Write Lock & Thread Pool
Low-Level Design
Design Patterns for LLD Interviews
Low-Level Design
Thread Pool Pattern: Fixed, Cached, Scheduled, and Work-Stealing Executors
Low-Level Design
Task & Job Scheduler — LLD (Cron, Queues, At-Least-Once, Idempotent Workers)
LLD for schedulable jobs: cron/one-shot triggers, Run state machine, worker claim+lease, exponential backoff, DLQ, and at-least-once delivery. Aligns with Conductor/Sidekiq-style idempotent handlers vs fake exactly-once.
What Interviewers Are Actually Testing
This is the LLD of behavior + state, not a miniature Kubernetes. The signal is: you model Job and TaskExecution as different objects, you give triggers (one-shot, cron) their own abstractions, and you can articulate at-least-once delivery with idempotent side effects. Wave 'exactly-once' without idempotency and you fail; wave 'Kafka exactly-once' and explain it is effectively-once via idempotent processing and you pass. A staff candidate references durable task engines (open-source Conductor documents at-least-once task redelivery) and fencing tokens as the bridge from LLD to HLD when pushed.
Clarifying Questions
In-process (thread pool) or distributed workers?
In-process: locks + priority queue. Distributed: add lease TTL, heartbeats, claim with fencing — state the difference even if code is single-JVM.
Recurring: cron, fixed delay, or both?
Cron (wall-clock) is standard for batch; fixed delay for self-scheduling. Model Trigger as interface, CronTrigger and OneShotTrigger as implementations.
What happens on failure? retry count, DLQ?
Exponential backoff cap, max_attempts, terminal DEAD with manual replay.
Priority and fairness?
Separate queues per priority or one heap keyed by (priority, due_time) — be ready to name starvation risks.
Dependencies between jobs (DAG) in scope?
If yes, Job references upstream completion handles — often out of 45m LLD; name Workflow aggregate as v2.
Exactly-once execution?
Answer honestly: effectively-once via idempotency; raw exactly-once execution is not the promise — duplicates can occur before commit.