1. How to Approach a Design Question
1.3 What's the step-by-step framework?
At the architect's desk: A good architect always works in the same order: ask what's needed, size it, plan the doors and the store room, draw the floor plan, zoom into the tricky part, then walk the family through it.
In the interview: Same order, seven steps:
- Requirements: functional and non-functional (1.5, 1.6).
- Estimates: rough numbers for traffic and storage (Chapter 2).
- API: the operations the system offers (1.7).
- Data model: what you store and how you'll look it up (1.8).
- High-level design: the boxes and arrows (1.9).
- Deep dive: zoom into the hardest part (1.10).
- Trade-offs and wrap-up: what you chose, what it costs, what you'd improve (1.11).
The first four steps are where you understand the problem. The last three are where you solve it. Read the first four letters: Requirements, Estimates, API, Data model. That's READ. You read the problem before you design it.
Why this order? Each step feeds the next. Requirements tell you what to estimate. Estimates tell you whether one database is enough. The API tells you which data you need. The data model tells you what storage fits. Skip a step and you're guessing.
Memory code: "READ, then Draw, Dive, Defend." Requirements, Estimates, API, Data model. Then the high-level drawing, the deep dive, and defending your trade-offs.