System Design · Module 1 · Lesson 3 of 4 · 40 min
The Five Step Design Framework
Build a complete answer in order: clarify, estimate, define data and API, draw the architecture, and test the risky parts.
01 The idea
The problem this lesson solves
Create and follow links in one region; assume destination changes are allowed.
Prerequisite: earlier lessons introduce the vocabulary and shared examples used here. Follow the module order.
02 Worked example
Follow one worked example
Trace the example in order. Follow the same identities, units and state transitions through the diagram and the events below.
At every step, produce an artifact that the next design decision can use.
03 The method
Mechanisms decisions and a guided tutorial
Work through the explanation in order, then apply it in the tutorial. Each comparison names a cost as well as a benefit.
| Choice or concept | Purpose | Boundary or cost |
|---|---|---|
| Clarify | Requirements | An assumed feature set |
| Estimate | Capacity hypothesis | Numbers without design consequences |
| Data and API | Operations and keys | Endpoints disconnected from storage |
| Deep dive | Defended behavior | A happy-path-only diagram |
Make the conversation visible
For a 45-minute practice round, try 5 minutes of scope, 5 of estimates, 10 of API and data, 10 of architecture, and 15 of failure analysis. The total is 45, but it is a practice schedule, not a company's grading rubric. Explain one decision at a time: requirement, choice, cost, and the observation that would make you change it. If you discover a flaw, state the violated invariant and repair that part of the design.
A framework is a dependency order
Clarification establishes what matters. Estimation identifies which resource might run out. The API names operations, and the data model shows the state they touch. The architecture assigns those operations to components. The deep dive checks whether the chosen interactions preserve the important rules.
The order is useful because each artifact constrains the next. If the design starts with shards before defining the main lookup key, there is no basis for choosing a partition key. If an estimate shows a small workload, a complex partitioning plan needs another reason. You can revisit earlier steps, but explain what new information caused the change.
Keep the first diagram executable by a human
For a short-link service, trace both creation and redirect. Creation authenticates an owner, validates a destination, chooses a unique code and stores it. Redirect reads the mapping and returns Location. A cache changes the read path, but does not eliminate the authoritative mapping.
Draw the successful path first. Then add one failure at a time: duplicate code, lost response, missing record and unavailable store. Label which component detects each condition and which response reaches the client. This makes the high-level diagram a sequence of testable statements instead of a collection of product logos.
Choose the deep dive from risk
If the system sells a scarce seat, investigate concurrency before adding replicas. If it serves very large videos, examine bandwidth and caching. If it accepts money, investigate idempotency and reconciliation. A useful deep dive is driven by the invariant or bottleneck most likely to invalidate the design.
When the interviewer changes a requirement, update the smallest necessary part. A demand for read-your-writes affects read routing and cache policy; it does not automatically require rewriting every endpoint. Finish with a short trade-off log: what you chose, its cost, the remaining risk and the measurement that would trigger a change.
Guided tutorial
1. Use a 45-minute timer
Budget 5 minutes for scope, 5 estimates, 10 data/API, 10 architecture and 15 stress tests.
2. Create five artifacts
Write one scope box, one calculation, one API table, one diagram and one failure table.
3. Change one requirement
Add mutable destinations and update the cache policy explicitly.
4. Review the answer
Ask a peer to trace one creation using only your artifacts; fix missing arrows and unknown outcomes.
1 clarify → scope + correctness rules
2 estimate → traffic + storage + likely bottleneck
3 data/API → operations + keys + error contracts
4 architecture → ownership + request paths
5 deep dive → races + failures + trade-offs04 Cheat sheet
Review the decisions
Use this table to explain the mechanism and its limit without memorizing a product name.
| Choice or concept | Remember | Check |
|---|---|---|
| Clarify | Requirements | An assumed feature set |
| Estimate | Capacity hypothesis | Numbers without design consequences |
| Data and API | Operations and keys | Endpoints disconnected from storage |
| Deep dive | Defended behavior | A happy-path-only diagram |
05 Where & why
Check the primary references
Use official references for protocol and implementation details. The questions here are teaching prompts.
06 Interview questions
Explain the reasoning out loud
Answer before opening the explanation. The questions progress from vocabulary to decisions and failure behavior.
What does Scope box mean?
What does Access pattern mean?
What does Deep dive mean?
Can you return to an earlier step?
Why define data before drawing many components?
What is a useful estimate?
How do you select a deep dive?
What should a design summary contain?
07 Practice problems
Practice a new case
Solve the new cases before revealing hints. Complete worked solutions follow the set.
Order the artifacts
EasyShow the hint
Find the missing step
EasyShow the hint
Time budget
MediumShow the hint
Respond to a new target
MediumShow the hint
Choose a deep dive
MediumShow the hint
Review a complete answer
HardShow the hint
Worked solutions
1. Order the artifacts
Scope, estimate, schema/API, request diagram, then failure review. Revisit any artifact when later work exposes a changed assumption.
2. Find the missing step
The estimate is missing. Read/write rates, data size and bursts are needed to justify scaling and caching choices.
3. Time budget
One valid plan is 5+5+10+15+15=50. Other allocations are acceptable when they preserve time for the highest-risk reasoning.
4. Respond to a new target
Update the scope guarantee, API outcome, cache behavior, read routing and failure tests. Reassess replica reads rather than changing unrelated endpoint names.
5. Choose a deep dive
Booking should first defend atomic ownership and payment/hold transitions. Thumbnail serving should examine image bandwidth, caching and origin recovery under misses.
6. Review a complete answer
Define upload/share/revoke scope, traffic assumptions, file and grant identities, request paths and a revocation failure review. State how quickly revocation takes effect across caches and how unauthorized callers are denied.