Task Scheduler Cheat Sheet
Key concepts, trade-offs, and quick-reference notes for your interview prep.
Time Buckets: Kill the Poll
#1💡 Sharded polling is still polling. Bucketing removes the query, not just spreads it.
Timing Wheel: O(1) In, O(1) Fire
#2💡 Derive the wheel (slots, tick, cascade), don't name-drop it. Granularity is fixed: 1s wheel, seconds SLO.
At-Least-Once: Checkpoint AFTER Enqueue
#3💡 Exactly-once across a crash boundary is a myth here too. At-most-once drops payment retries: choose loud.
Cron: Materialize Only the Next Instance
#4💡 "Store cron in UTC" is how you fail the timezone follow-up. Next-occurrence math runs in the template's zone.
The Top-of-Minute Herd Is the Workload
#5💡 The herd is customer intent, not abuse. Make round numbers cheap; don't forbid them.
Retry = Reschedule Through Yourself
#6💡 A DLQ nobody reads is a black hole with good intentions. Alert on arrival, by task class.
Late Is a Budget, Early Is a Bug
#7💡 Measure lateness honestly: dispatch delta + queue wait + execution start. Dashboarding only the first is lying.
Tasks vs Workflows: The Boundary
#8💡 Durable timers + at-least-once + idempotent handlers ARE the primitives Temporal stands on.
Capacity: 10B Pending, 1B Firings/Day
#9💡 The scheduler is cheap; the herd's execution is expensive. Size workers for :00, dispatchers for boredom.
The Metrics That Matter
#10💡 An unowned bucket fails silently: nothing errors, tasks just don't fire. Lease coverage is availability.