Code RoomCache coherency under load
HardPrep Room Coding #4020

Cache coherency under load

Vibe & agenticReliability & on-callSenior–Staff~18 min

An agent wrote a cache-invalidation layer in Go for a high-traffic service. The logic is correct in every test you can think of, but cache-coherency bugs are notoriously the ones tests miss — they show up only under real concurrent traffic with real key distributions. You can't fully trust the code and you can't reproduce production locally. How do you verify it before and during rollout, beyond unit tests?

Implement
stale_read_indexes(events: list[str]) → list[int]
Examples
in[["write k1 v1","read k1","write k1 v2","read k1"]]out[3]
in[["write k1 v1","read k1","write k1 v2","invalidate k1","read k1"]]out[]
in[["write a v1","write b v1","read a","read b","write a v2","write b v2","invalidate a","read a","read b"]]out[8]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 18 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.