Week 8 · Thu Sep 17, 2026 · Sep 14-20, 2026

Day 4: Job Scheduler CORE Deep Dives

A Staff scheduler answer with time buckets, near-term delay queues, leases, zombie fencing, retries, backoff, poison queues, idempotent handlers, and exactly-once illusion.

How do 2-second precision, 10k jobs/sec, and at-least-once execution fit together?Frontier · leases · retries · dedupe · recovery3 Heap/Priority Queue slots

Exact Time Blocks

Follow the Week 4 delivery pattern: blank-page first, source reading second, DDIA decision third, spoken close, contiguous algorithm practice, evening recall.

TimeBlockRequired output
08:30Wake + setupOpen this page, start the board, write the day question: How do 2-second precision, 10k jobs/sec, and at-least-once execution fit together?
08:50—09:00Board setList entities, queues, leases, retry states, dedupe keys, metrics before reading.
09:00—10:05Blank-page attempt + Hello readingRehearse the three Hello deep dives. For each one, write the bottleneck, mechanism, failure window, recovery, and metric: 2s precision, 10k jobs/sec, at-least-once execution.
10:05—10:45Deep dive + DDIA decisionBuild the lease story: scanner moves due executions into a near-term queue; worker claims with token and deadline; heartbeat extends; completion uses conditional token match; expired leases reappear; retries use exponential backoff plus max attempts; poison messages stop infinite harm.
10:45—10:55Spoken closeSay the exact-once line cleanly: the scheduler guarantees at-least-once delivery and externally idempotent effects, not magic exactly-once execution.
14:30—16:15NeetCode Heap/Priority QueueComplete contiguous slots W8-H10—W8-H12; capture invariant and bug risk for each.
20:30—21:15Recall / Q&A / mockUse Staff Q&A, lecture assets, or mock script for the day's system.

Canonical Heading Anchors

Read only the listed Hello Interview headings for today's assignment. Every link is a direct day-page anchor.

  • CORE deep-dive index
  • CORE two-layer scheduling and timing precision
  • CORE leases, retries, poison messages, idempotence
  • Mock rubric calibration
  • Rubric contrast
SeniorDay 6
  • Senior+ bar
Staff+Day 6
  • Staff bar

Decision Notes

  • CORE means you must answer requirement, HLD, deep dive, failure, recovery, metric, and Staff-level tradeoff.
  • TRANSFER means blind attempt first, then delta against source, invalid assumption, new bottleneck, and follow-up pressure question.
  • Do not add open-ended AI radar unless it changes a concrete Week 8 design decision; this week it does not.

DDIA Decision Map

Use exact sections only from Ch5, Ch9, and Ch12.

ChapterExact DDIA decision sectionConcrete Week 8 use
Ch9分布式锁和租约Workers lease an execution; they never own it forever.
Ch9进程暂停Zombie workers are normal; lease expiry and fencing decide whose completion counts.
Ch12确认应答与重新传递Redelivery is expected, so handlers and completion writes must be idempotent.
Ch12幂等性Exactly-once is an illusion built from idempotency keys, conditional writes, and dedupe windows.

Heap/Priority Queue Slots

Three contiguous slots today. Keep one invariant and one failure mode per problem.

SlotProblemPatternInvariant / bug riskTime · Space
W8-H10 Reorganize String max-heap with cooldown A character cannot re-enter the heap until one different char is placed. O(n log a) · O(a)
W8-H11 Meeting Rooms II min-heap of end times Room pressure is the count of active intervals. O(n log n) · O(n)
W8-H12 Single Threaded CPU available-work heap Push all work whose enqueue time is <= current clock before selecting. O(n log n) · O(n)

Evidence To Save

One compact artifact is enough if it proves mechanism depth.

Invariant

State safety

Name the state that survives restart and the write that makes retry safe.

Failure

Concrete break

Use a worker crash, zombie lease, redelivery, poison message, stale robots decision, or duplicate price event.

Metric

Operational proof

Attach lag, retry rate, duplicate suppression, stale lease reject count, host politeness violation, or alert freshness.

Local study materials
Detailed lecture notes, audio, recall scripts, PDFs, Staff Q&A, and mock packs are archived locally and are intentionally not published on this site.