Code Room
System designHardsd-g636
Subject Distributed counterLevel Senior–Staff~40 minCommon in Distributed systems · Algorithms & data structures interviewsIndustries Technology, Software development

Question

Design a distributed counter / sequencer that hands out globally unique, roughly-ordered 64-bit IDs to ~30 application servers at 1M IDs/sec, with no central bottleneck on the hot path and no duplicate IDs ever — even when a server restarts. Optionally support strictly-monotonic per-key counters (e.g. per-account ledger sequence) too. Describe ID structure, how concurrent issuers coordinate to avoid collisions, and the durability story across restarts.

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.