System design · Concept 1

How to Approach a Design Problem

A repeatable seven-step framework for interview-style and day-to-day design discussions, with time boxes and what reviewers look for.

7 min read

In short

  • Clarify, estimate, API, data model, design, deep dives, wrap-up
  • Requirements come before technology
  • End every estimate with a decision
  • Add components only when a requirement justifies them
  • Options, decision, why, and what would change your mind

System design has no single right answer. What matters is making your decisions explicit, tying each one to a requirement, and being honest about what it costs. The same framework works for a 45-minute interview and for a design review at work. Only the weighting changes.

The framework at a glance

 1. Clarify ──► 2. Estimate ──► 3. API ──► 4. Data model
                                                │
 7. Bottlenecks & ◄── 6. Deep dives ◄── 5. High-level design
    trade-offs
StepGoalTime box (45 min)What ends up on the board
1. Clarify requirementsAgree on scope4-6 minFunctional + non-functional bullets, explicit "out of scope"
2. EstimateSize the problem3-5 minQPS (avg/peak), storage, bandwidth, read:write ratio
3. APIDefine the contract3-5 min3-6 endpoints or messages with inputs/outputs
4. Data modelEntities + access patterns4-5 minTables/keys, which store, partition key
5. High-level designEnd-to-end happy path8-10 minBoxes and arrows, left to right in request order
6. Deep divesThe 2-3 hardest parts10-15 minOptions, decision, justification
7. Wrap-upBottlenecks, failures, trade-offs3-5 minRisks, what you'd do next, what changes at 10x

Step 1: Clarify requirements

Interviewers usually make the prompt vague on purpose. Your first job is to turn "design Twitter" into something you can finish in 40 minutes.

  • Functional requirements: what can users do? Aim for 3-5 core actions and rank them. "Post a tweet, follow users, see a home timeline" is a scope. "Everything Twitter does" isn't.
  • Non-functional requirements: scale (DAU, QPS), latency targets (p99), availability, consistency, durability, security/compliance and cost.
  • Out of scope: say it out loud and write it down: "No search, no ads, no DMs."

Good questions to ask:

  • Who are the users and how many? What does a typical session look like?
  • Is it read-heavy or write-heavy? Is traffic spiky (sales, midnight cron, live events)?
  • What happens if data is a few seconds stale? Can we ever lose data?
  • Single region or global? Mobile clients on bad networks?

Pitfall: naming Kafka in minute two. Technology choices come after requirements.

Step 2: Back-of-the-envelope estimates

Estimate just enough to drive decisions (see the Back-of-the-Envelope lesson):

  • 100M DAU × 10 reads/day = 1B reads/day ≈ 12K QPS avg, ~35K peak
  • 1B rows × 1 KB = 1 TB: fits one large database node, so sharding is optional
  • 20 TB/day of uploads: object storage, not a database

Finish every estimate with a conclusion: "so this is read-heavy and we need a cache", or "so writes fit on a single primary".

Step 3: API

Name the operations, their inputs and outputs. REST over JSON is a fine default. Include the details that show maturity:

POST /v1/links            { longUrl, customAlias? }  -> 201 { code, shortUrl }
GET  /{code}                                         -> 302 Location: <longUrl>
GET  /v1/users/{id}/links?cursor=...&limit=50        -> 200 { items, nextCursor }
  • Cursor pagination for lists
  • An Idempotency-Key header on writes that clients will retry
  • Async operations return 202 Accepted plus a status URL

Step 4: Data model

List the entities and, more importantly, the access patterns: "get link by code", "list a user's links newest first", "get the last 50 messages in a conversation". The access patterns decide the primary key, the partition key and which store fits. Choose SQL by default when you need transactions or relationships. Choose a key-value or wide-column store when access is by key at very high write volume.

Step 5: High-level design

Draw the happy path end to end before you optimize anything:

Client ─► LB ─► Service ─► Database

Then add components only when a requirement justifies them: a cache because reads are 100:1, a queue because sending email is slow and can fail, a CDN because you serve 5 Gbps of images. On the Stack Labs board, lay components out left to right in request-flow order and label every arrow with what flows across it (HTTPS, GET code, publish order.created).

Step 6: Deep dives

Pick the 2-3 hardest or riskiest parts. The interviewer will often steer you, so follow their lead. For each one, present options → decision → why → what would change my mind.

ProblemTypical deep dives
URL shortenerID generation, cache on the redirect path, analytics
ChatConnection routing, ordering, offline delivery, presence
News feedFan-out on write vs read, celebrities, feed cache
PaymentsIdempotency, ledger, reconciliation, PSP timeouts
File storageChunking, sync protocol, conflicts
Job schedulerFinding due jobs, avoiding double-firing

Step 7: Bottlenecks, failures and trade-offs

Walk through the design adversarially:

  • What breaks first at 10x? Usually the database primary, a hot key or one slow dependency.
  • Single points of failure? One scheduler node, one Redis without a replica, one region.
  • What happens when X is down? Cache down means a thundering herd on the DB. Provider down means a growing queue backlog.
  • Observability: what would you alert on?
  • Trade-offs you made: consistency vs latency, cost vs simplicity, build vs buy.

What interviewers and teammates look for

SignalLooks likeAnti-pattern
Structured thinkingVisible agenda, steps in orderJumping between topics, no requirements
Requirement-driven choices"Reads are 100:1, so cache"Buzzword bingo ("add Kafka, add K8s")
Trade-off awareness"Eventual consistency here because…"Only one option ever considered
DepthCan explain how a component works insideTreats boxes as magic
Quantitative senseNumbers within an order of magnitudeNo numbers, or 10,000x off
CommunicationThinks aloud, checks in, adaptsLong silent stretches, ignores hints
PragmatismSimplest design that meets requirementsDesigning for Google scale for 1K users

Time boxing tips

  • Say the plan up front: "I'll spend ~5 minutes on requirements and numbers, then API, then the design, then go deep on X."
  • If you're stuck on a detail, state an assumption and move on: "I'll assume 1 KB per row."
  • Check the clock at roughly 15 and 30 minutes. If you haven't drawn the high-level design by minute 20, simplify.
  • Leave 3-5 minutes for wrap-up. Ending on "here's what I'd improve next" is a strong close.

Using the framework at work

Day-to-day architecture discussions follow the same steps with different inputs:

  • Requirements come from product and stakeholders. Write them in the design doc and get sign-off before debating databases.
  • Estimates come from real metrics (dashboards, logs). Use them instead of guesses.
  • Constraints are tighter: the existing stack, team skills, budget, compliance, migration path and on-call burden.
  • Capture decisions in a short ADR (Architecture Decision Record) covering context, decision, alternatives considered and consequences. Six months later, "why did we do this?" has an answer.
  • Prefer reversible decisions and incremental rollout (feature flags, dual writes, shadow traffic).

When to use / trade-offs

  • Use it for any open-ended design question, in an interview, a design doc, or a whiteboard session with your team.
  • Adapt it: if the interviewer hands you the numbers, skip estimation. If they want to dive into one area early, go there and come back. The framework exists to give you structure, so let the conversation lead.
  • Trade-off: following every step rigidly can burn time on parts nobody cares about. Weight your time by risk. Spend minutes on the novel, hard parts and seconds on the standard ones ("standard stateless service behind an LB").

Checklist

  • Functional, non-functional and out-of-scope written down
  • Estimates with a conclusion for each number
  • API with pagination and idempotency where relevant
  • Data model driven by access patterns
  • End-to-end diagram that covers every functional requirement
  • 2-3 deep dives with options and a justified choice
  • Failure modes, bottlenecks at 10x, monitoring, trade-offs

Practise this concept

In the app: a short video and a 11-question concept check. Free with a GitHub account.

Open in the app