The Five Step Design Framework

Requirements and the Design Framework · 40 min

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.

At every step, produce an artifact that the next design decision can use.

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.

Scope boxA compact statement of features, assumptions and measurable targets.
Access patternA concrete read or write the data model must support.
Deep diveA focused examination of a risky component, invariant or failure mode.

02 Worked example

Follow one worked example

The Five Step Design Framework worked diagram01ClarifyScope + targets02EstimateDemand + limits03DefineAPI + data04DefendFlow + failuresThe Five Step Design Framework compact diagram01ClarifyScope + targets02EstimateDemand + limits03DefineAPI + data04DefendFlow + failures
Clarify: Scope + targets • Estimate: Demand + limits • Define: API + data • Defend: Flow + failures.

Trace the example in order. Follow the same identities, units and state transitions through the diagram and the events below.

1
ClarifyCreate and follow links in one region; assume destination changes are allowed.
2
EstimateWrite the peak read and write rates separately and identify the read-heavy path.
3
Define and drawSpecify POST /links and GET /r/{code}; store a unique code and destination in a durable database.
4
StressExplain retry deduplication and how a changed destination invalidates an old cached value.

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 conceptPurposeBoundary or cost
ClarifyRequirementsAn assumed feature set
EstimateCapacity hypothesisNumbers without design consequences
Data and APIOperations and keysEndpoints disconnected from storage
Deep diveDefended behaviorA 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-offs

04 Cheat sheet

Review the decisions

Use this table to explain the mechanism and its limit without memorizing a product name.

Choice or conceptRememberCheck
ClarifyRequirementsAn assumed feature set
EstimateCapacity hypothesisNumbers without design consequences
Data and APIOperations and keysEndpoints disconnected from storage
Deep diveDefended behaviorA happy-path-only diagram
Scope boxA compact statement of features, assumptions and measurable targets.
Access patternA concrete read or write the data model must support.
Deep diveA focused examination of a risky component, invariant or failure mode.

05 Where & why

Check the primary references

Use official references for protocol and implementation details. The questions here are teaching prompts.

Primary reference
HTTP 429

Read HTTP 429

Primary reference
Redis atomic scripting

Read Redis atomic scripting

State the implementation version and the workload assumptions when defending your own design.

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?
A compact statement of features, assumptions and measurable targets.
What does Access pattern mean?
A concrete read or write the data model must support.
What does Deep dive mean?
A focused examination of a risky component, invariant or failure mode.
Can you return to an earlier step?
Yes. New information can change an assumption or expose a missing requirement. State the change and propagate its consequences instead of treating the framework as a rigid script.
Why define data before drawing many components?
The main keys and access patterns constrain ownership and routing. Without them, partitioning and caching choices are guesses.
What is a useful estimate?
One with units and explicit assumptions whose result changes a design choice or identifies the next measurement. Extra arithmetic without a consequence is not useful.
How do you select a deep dive?
Choose the invariant, dependency or resource limit most likely to break the design. Explain why it deserves attention.
What should a design summary contain?
The main user paths, the defended guarantees, the principal trade-offs and the unresolved measurements. Keep assumptions visible.

07 Practice problems

Practice a new case

Solve the new cases before revealing hints. Complete worked solutions follow the set.

Order the artifacts

Easy
Put schema, scope, failure review, estimate and request diagram into a sensible first-pass order.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Ask what information each needs.

Find the missing step

Easy
A design has endpoints and boxes but no workload; name the missing artifact and why it matters.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Capacity choices need a demand model.

Time budget

Medium
Allocate 50 minutes across the five steps and ensure at least 15 remain for stress tests.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Check the sum explicitly.

Respond to a new target

Medium
The interviewer adds read-your-writes; list the artifacts you must revisit.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Follow the read after a successful write.

Choose a deep dive

Medium
Choose the first deep dive for a seat-booking design and for a thumbnail-serving design.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Identify the dominant correctness or resource risk.

Review a complete answer

Hard
Produce the five artifacts for a private file-sharing service, then trace a revoked share link.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Authorization and cached data must agree on the revocation contract.

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.