Skip to content
← Implement-from-Scratch Coding / 16
hardNewAnthropicOpenAINVIDIA

This KV allocator passes ordinary append tests but corrupts forked requests. Find two bugs and prove the repair.

A runnable allocator hides an exception-safety defect and a payload-aliasing defect. Reduce each failure to a short operation sequence, then test ownership and content against separate oracles.

Updated Oct 2026 · Worked answers on inference mechanisms, with calculations, implementation details, and follow-up questions.

A runnable allocator hides an exception-safety defect and a payload-aliasing defect. Reduce each failure to a short operation sequence, then test ownership and content against separate oracles.

10 answers per topic instead of 5, plus saved progress and bookmarks · costs nothingor unlock all 136 remaining answers · ₹2,000 / $25

Every worked answer and derivation in all 12 topics, every concept page, and the full practice-test bank.

6 months · One payment · No auto-renewal

UP NEXT ON YOUR JOURNEY
FEDITOR'S NOTE

This exercise models synchronous ownership. Extending it to a GPU worker requires an explicit rule for when a cancelled request's last in-flight use has completed.

DISCUSSION · 0

Nobody has commented on this answer. Add a correction or another way to work it.