Show answer
Answer
Drive with a fixed structure.
- Requirements (5 min): functional (post, follow, home timeline), non functional (read heavy, timeline p99 under about 200 ms, eventual consistency fine), explicit out of scope.
- Estimates (3 min): only the numbers that drive a decision, such as read and write QPS and storage per year.
- Core entities and API (5 min):
POST /tweets,GET /timeline?cursor=. - High level design (10 min): walk one write and one read end to end.
- Deep dives (15 min): the 2 or 3 hard parts (fanout, celebrities, partitioning), with tradeoffs.
- Wrap up: bottlenecks, failure modes, what changes at 10x.
Pitfalls: boxes before scope, 15 minutes of math, naming tech without a reason, never stating a tradeoff.
Source: Hello Interview: System Design in a Hurry, System Design Interview: An Insider's Guide, Volume 1