Code RoomSafe distributed lock redesign
HardPrep Room Coding #3750

Safe distributed lock redesign

System designConcurrencyDistributed systemsSenior–Staff~45 min

Your team currently uses single-instance Redis SETNX-with-TTL as a distributed lock and has hit incidents where two workers both believed they held the lock. Design a safer locking scheme for the same use case — serializing ~2k/sec short critical sections — and decide whether a quorum scheme (Redlock across 5 independent nodes) actually fixes the root cause. Constraints: low latency, tolerate single-node Redis failure, and provably prevent two simultaneous holders for the protected operation. Describe the mechanism and justify your choice.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify5:00 left
Estimate5:00 planned
Design15:00 planned
Deep dive12:00 planned
Failure8:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.