Code Room
System designHardsd-g633
Subject Distributed semaphoreLevel Senior–Staff~45 minCommon in Concurrency · Distributed systems interviewsIndustries Technology, Software development

Question

Design a distributed semaphore / quota system that caps concurrency of an expensive shared resource — e.g. "at most 100 concurrent connections to a fragile legacy mainframe" — across hundreds of caller pods. Constraints: the global in-flight count must never meaningfully exceed 100, permits must be released even if a holder crashes, and acquire should block-with-timeout rather than reject. Explain how permits are counted, how concurrent acquirers coordinate, and how leaked permits are reclaimed.

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.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.