Code RoomDesign a globally-distributed edge counter
HardPrep Room Coding #4592

Design a globally-distributed edge counter

System designDatabases & SQLDistributed systemsSenior–Staff~45 min

Design a globally-distributed counter/limiter that runs at the edge (200+ locations) for 'free article views per month' on a publisher's paywall — each user gets 5 free articles, enforced at the nearest PoP for low latency, but the count must be approximately consistent globally so a user can't get 200 free articles by hopping PoPs. Reads/writes happen at the edge; the origin is far. Describe the state model, the consistency you choose and why, how you reconcile concurrent increments across PoPs, and how you bound the over-count.

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.