Admission, a step that grows every sequence, and preemption under memory pressure. The loop is short and it has a failure that only appears when the cache is tight: in a measured run it preempted seventeen times and completed nothing, because every preempted sequence restarted from zero.
Implement the scheduler loop of a continuous-batching engine: admit, step, preempt. Where does it livelock?
Admission, a step that grows every sequence, and preemption under memory pressure. The loop is short and it has a failure that only appears when the cache is tight: in a measured run it preempted seventeen times and completed nothing, because every preempted sequence restarted from zero.
Updated Sep 2026 · Grounded in real AI infrastructure interview loops and written to a senior-engineer editorial bar, with every number worked and every diagram hand-built.
The concepts behind this question
Ranked by how closely each one overlaps this question's topic, so the first card is the thing to read if the answer above moved too fast.
Scored on the admit-step-preempt loop with a watermark, on the accounting invariant, and on recognising the preemption livelock and its two fixes.
No comments yet — be the first to share your approach.
