System Design Foundations
All 9 cards in this deck
Caching, scaling, consistency — the load-bearing ideas of every large system. Answer each question before you open it — then run the review above, which schedules every card with spaced repetition so it comes back right before you would forget it.
State the CAP theorem.
During a network partition you must choose consistency or availability — you cannot have both at once.
What does consistent hashing solve?
Adding/removing a node moves only ~K/N keys instead of remapping nearly all of them, as plain modulo hashing would.
When does R + W > N give strong consistency?
When read and write quorums must overlap, a read always touches a replica that saw the latest write.
Why cache — and what’s the hardest part?
To avoid repeat work and cut latency; the hard part is invalidation (staying correct as the source data changes).
What is the token bucket used for?
Rate limiting: a bucket of capacity tokens refills at a fixed rate; each request spends one, empties get rejected — capacity sets the burst, rate sets the sustained limit.
How do availabilities combine in series?
They multiply — every required dependency lowers overall uptime (the chain is weaker than its weakest link).
What is a Bloom filter and its one-sided error?
A space-efficient membership test that can give false positives but never false negatives — "maybe present" or "definitely absent".
Why measure p99 latency, not the average?
The mean hides the tail; p99 is the experience of your worst 1% of requests, which is what SLOs are written against.
Vertical vs horizontal scaling?
Vertical = a bigger machine (simple, capped); horizontal = more machines (scales far, needs sharding/coordination).