The 4-Step Framework
1. Requirements (5 min) 2. Estimates + API (5 min)
functional / non-func. -> QPS, storage, bandwidth; endpoints
| |
v v
4. Deep dives (15-20 min) <- 3. High-level design (10 min)
bottlenecks, scaling, boxes & arrows, data model,
failure modes, trade-offs happy path end to end
1. Clarify requirements — never start drawing first.
- Functional: the 3–5 core features ("users can post, follow, see a feed"). Explicitly park the rest.
- Non-functional: scale (DAU, read/write ratio), latency (p99), availability vs consistency, durability, geo-distribution.
2. Back-of-the-envelope + API
- QPS = DAU × actions/day ÷ 86,400 (≈ 10⁵ s/day). Peak ≈ 2–10× average.
- Storage = writes/day × object size × retention.
- Define 3–5 API calls (
POST /tweets,GET /feed?cursor=).
3. High-level design: client → LB → stateless services → cache → DB / object store / queue. Walk one request through it.
4. Deep dives: pick the 2–3 hardest parts (fan-out, hot keys, consistency, sharding key, failure handling). Always state trade-offs and alternatives.
Signals interviewers look for: driving the conversation, quantitative reasoning, knowing why a component is there, discussing failure modes, and adapting when requirements change.