HLD prep is optimised for larger screens
Open on a laptop or desktop (1024px+) for the diagram canvas and the section sidebar side-by-side.
Problem Understanding
Restate the problem in your own words.
Design a Distributed Counter
Design a distributed counter: increment a named counter (post likes, video views, ad impressions) at millions of QPS, read the (eventually-consistent) value with sub-100 ms latency, and survive node + region failure without losing increments. The hard parts are sharding without hot keys (counter-per-shard then sum), CRDT-style merge semantics, and choosing between strict consistency (slow but exact) and eventually-consistent counters (fast and approximate).
- Twitter view counterFamously approximate — trades exact counts for fast convergence at billions of impressions.
- Instagram likesUser-visible counter; eventually-consistent with sub-second perception.
- YouTube view counterAuthoritative for ad billing; slow + exact path next to a fast + approximate display path.
- Riak / Redis CRDTsDistributed-counter primitives baked into the database — PN-Counter is the textbook implementation.
Your task: read the problem above, then write what the system is, who uses it, the rough scale, and the headline UX expectation — in your own words. Submit for AI review when you're ready.
Click any step in the sidebar to jump around — sections don't have to be done in order. Press ? any time to see all shortcuts.