Code RoomLock expires during long operation
HardPrep Room Coding #4145

Lock expires during long operation

Vibe & agenticConcurrencyDistributed systemsSenior–Staff~22 min

You asked an AI for a distributed lock in Node using Redis so only one worker runs a daily reconciliation. It produced this and called it safe mutual exclusion. Review it.

Where does mutual exclusion break, and what's the correct approach?

Implement
accept_fenced_writes(write_lines: list[str]) → list[str]
Examples
in[["w1|1|a","w1|1|b","w2|2|c"]]out["a","b","c"]
in[["w1|1|start","w2|2|takeover","w1|1|late_write"]]out["start","takeover"]
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 22 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.