HardDesign: Distributed Task Scheduler (Cron at Scale)

Why must the database index on tasks include both next_run_at AND status?

Tests your understanding of this concept.

Answer Options

AFor sorting purposes only
BTo efficiently find tasks WHERE status='SCHEDULED' AND next_run_at <= NOW() without full table scan
Cnext_run_at alone is sufficient
DStatus alone is sufficient

Want to see the correct answer?

Get the answer with a detailed explanation, plus practice 22+ more Design: Distributed Task Scheduler (Cron at Scale) questions with adaptive quizzes and timed interviews.

See the Answer on Guru Sishya →

This question is from the Design: Distributed Task Scheduler (Cron at Scale) topic (System Design Cases).

More Design: Distributed Task Scheduler (Cron at Scale) Questions