system-design Coursesystem-designdesign-frameworkcase-studyappliedintermediate

How to Approach Any System Design Problem

•13 min read

How to Approach Any System Design Problem

I had the fundamentals down — caching, load balancing, CAP trade-offs. Deeper posts on consistent hashing, idempotency, and event sourcing filled in the gaps. I could explain each concept in isolation.

Then an interviewer said: "Design Twitter." Forty-five minutes on the clock. I jumped straight to Kafka, Cassandra, and a CDN — and spent the last fifteen minutes backtracking because I never asked who the users were, what "post a tweet" actually meant for write volume, or whether we cared about read-your-writes on the home timeline.

The concepts weren't the gap. Process was. A strong answer — interview or real design review — is not a vocabulary dump. It's a structured conversation: clarify what you're building, bound the problem, sketch the shape, then go deep where the constraints actually bite.

This post is the framework I wish I'd had before that interview. The next posts in this series cover back-of-envelope math and diagrams that expose trade-offs.

Intended audience: developers who've worked through the fundamentals and several advanced concept posts and want a repeatable process for open-ended design — whether you're whiteboarding with a hiring manager or leading a design doc review for a feature your team will actually ship.

Prerequisites:


Interview vs Real-World Design

Same skills, different constraints. Confusing the two is how you over-engineer in production or under-clarify in an interview.

DimensionSystem design interviewReal-world design
Time35–45 minutesDays to weeks (RFC, review, iteration)
DepthOne happy path + 1–2 deep divesEdge cases, migrations, ops runbooks
StakeholdersOne interviewer playing "product"PM, security, legal, SRE, finance
SuccessClear thinking, trade-offs, communicationShip safely, measurable SLOs, cost
ScopeYou must say what's out of scopeYou negotiate scope with the org
DataAssumptions stated aloudMetrics, traces, and incident history

In an interview, they want to see how you think under ambiguity — not whether you've memorized Twitter's architecture. At work, they want to know what breaks at 3 a.m. and what you'll honestly defer to v2.

Both benefit from the same skeleton:

Loading diagram…

The difference is how long you spend on each box and how many boxes you open.

Interview bias: breadth first — boxes, arrows, numbers on the napkin, then pick the hottest component. Production bias: clarify with real traffic and failure modes, write down non-goals, iterate the doc after review comments.


Step 1: Clarify Requirements

Never draw a database before you know what the system does. Split requirements into functional (features, user flows) and non-functional (how well it must perform).

Functional requirements

Ask product-style questions until you can list 3–5 core capabilities:

  • Who are the users? (consumers, admins, internal services)
  • What are the primary actions? (create, read, search, notify)
  • What is the unit of data? (tweet, order, file, session)
  • What integrations matter? (mobile, web, third-party API)

Example for "design a URL shortener":

Must haveNice to have (often v2)
Shorten a long URL → short linkCustom aliases
Redirect short → longAnalytics dashboard
Links expire (optional policy)A/B test destinations

Write these down. They become your API surface and data model later.

Example for "design a payment system" (running example in this series):

Must haveNice to have (often v2)
Authorize + capture card payments via PSPSubscriptions / recurring billing
Transaction history + merchant balanceMulti-currency
Fraud/risk check before PSPIn-house ML fraud models

Clarifying question that saves you: Is authorization separate from settlement? (Yes for cards — drives your API shape and state machine. Full case study: Design a Payment System (coming soon).)

Non-functional requirements

These drive architecture. If you skip them, you'll pick the wrong database:

CategoryExample questions
ScaleDAU? Reads vs writes ratio? Peak QPS?
Latencyp99 for redirect? Acceptable lag for search index?
Availability99.9% vs 99.99%? Acceptable downtime window?
ConsistencyStrong read-after-write, or eventual OK?
DurabilityCan we lose a minute of data in a disaster?
Security / compliancePII, encryption, audit, data residency

Tie non-functionals to user-visible behavior:

  • "Home timeline must feel instant" → read latency + caching strategy
  • "Payments must never double-charge" → idempotency + strong consistency on writes (idempotency post)
  • "Global users" → multi-region and CAP choices (CAP theorem)

What I say in interviews: state assumptions out loud: "I'll assume 100M DAU, 10:1 read:write, and 99.9% availability unless you say otherwise." Interviewers often correct you — that's a feature, not a failure.


Step 2: Scope Control and "Out of Scope"

Open-ended prompts are intentionally too big. Scoping is a skill, not a cop-out. Naming what's out of scope proves you can prioritize and saves you from designing twelve microservices in forty minutes.

Techniques that work

  1. MVP slice — "v1 is shorten + redirect only; analytics in v2."
  2. Single region first — "Design for one region; I'll note multi-region extension points." (Multi-region when relevant.)
  3. Cap entity size — "Tweets are 280 characters; no video in scope."
  4. Cap user scale tier — "Optimize for 1M users, design so 100M is a scaling path, not day-one complexity."
  5. Explicit non-goals — a short list read aloud or written on the board:
Out of scope for this session:
- Admin moderation UI
- ML-based feed ranking
- End-to-end encryption
- Billing and monetization

Why this matters in production

Design docs without a Non-goals section grow forever. PM adds "just one more API"; security adds a requirement that contradicts latency. A written out-of-scope list is a contract for v1. You can still document "future considerations" in a separate section — that's different from committing to build them now.

If the interviewer pushes back ("what about search?"), I usually say: "I'd add Elasticsearch in v2 once core redirect traffic is proven; for this session I'll mark the extension point on the diagram but not design indexing in depth." That kind of boundary-setting is what senior reviews expect.


Step 3: Capacity Estimation (When It Matters)

Not every problem needs math in the first five minutes. You need estimates when the answer changes the architecture:

  • Storage size → single DB vs sharding (databases at scale)
  • Write QPS → sync vs async, queue depth, partition count
  • Bandwidth → CDN vs origin, payload shape (CDN post)
  • Fan-out (followers × posts) → push vs pull timeline design

Rough order-of-magnitude is enough in an interview:

100M DAU × 2 reads/day ≈ 200M reads/day ≈ ~2.3K avg read QPS
Peak ≈ 3–5× average → ~10K read QPS (round up)

If your estimate implies 10 TB/day of logs, say so — that steers you toward object storage and batch pipelines, not a single Postgres row.

This post stops at when and why to estimate. The full walkthrough — storage, QPS, bandwidth, fan-out, and common shortcuts — is in the next post: Back-of-the-Envelope Math That Actually Matters (coming soon).

Rule of thumb: clarify and scope first, sketch the boxes second, then run numbers on the path that looks hottest. Estimates validate the diagram; they shouldn't replace it.


Step 4: High-Level Design Before Deep Dives

After requirements and a rough sense of scale, draw the happy path in five to seven components. Clients → entry point → core services → storage → async where needed. No SQL schema yet. No shard count yet.

What a good high-level diagram shows

  • Major components and data flow direction
  • Sync vs async boundaries (HTTP vs queue)
  • Read vs write paths if they diverge early
  • External dependencies (CDN, email, payment provider)

Example shape for a read-heavy service:

Loading diagram…

Label arrows with the operation: POST /shorten, GET /{id} redirect, publish event. The interviewer should see one complete user journey before you zoom in.

Order of operations

  1. API / interface — REST endpoints or events (what the client calls)
  2. Data model (conceptual) — entities and relationships, not indexes
  3. Storage choice — SQL vs NoSQL vs cache vs object store with one sentence why
  4. Async path — what can be eventual (notifications, search index, analytics)

Resist the urge to deep-dive the cache algorithm before the box exists. Get agreement on the skeleton: "Does this shape match the requirements we listed?" Course-correct now; it's cheap.

Deep dives come next — pick one or two areas where requirements and estimates create tension (timeline fan-out, hot keys, consistency across regions).


Step 5: Identify Bottlenecks and Trade-offs

Every design is a bundle of trade-offs. Strong candidates name the bottleneck, propose a mitigation, and say what they're giving up.

Common bottleneck patterns

SymptomLikely bottleneckDirections to explore
Read-heavy, hot keysDatabase or cacheCache-aside, CDN, read replicas, consistent hashing
Write-heavy spikesSingle primary, lock contentionSharding, async ingestion, partition by key
Fan-out (one write → many reads)Push timelineHybrid push/pull, precompute for celebrities
Global latencySingle regionMulti-region, edge cache, geo-routing
Exactly-once illusionDuplicate deliveryIdempotency keys, outbox, dedup store
CoordinationSplit brain, double leaderLeader election, fencing tokens — and when not to build your own (leader election)

For each deep dive, use a mini framework:

  1. Problem — "Celebrity with 50M followers breaks push fan-out."
  2. Options — push all, pull all, hybrid (push normal, pull for celebrities).
  3. Trade-off — push = fast read, slow write; pull = slow read, simple write.
  4. Choice — hybrid + cache hot timelines; document staleness for pull path.

Connect to concepts you've already learned instead of inventing new labels. Interviewers notice when you say "This is cache-aside with TTL; stampede risk if the key expires together" versus "We'll use Redis."

Failure and ops (brief but valuable)

Even in interviews, one minute on what breaks scores well:

  • What happens if the cache is empty? (DB load — caching pitfalls)
  • What happens if a partition occurs? (CAP — availability vs consistency)
  • How do you deploy schema changes without downtime?

Production design docs spend more time here. Interviews get credit for awareness.


A 45-Minute Interview Timeline

Use this as a template, not a straitjacket. Adjust if the interviewer steers early.

TimePhaseWhat to deliver
0–5 minClarifyFunctional + non-functional list; state assumptions
5–8 minScopeMVP features; explicit out-of-scope (2–3 items)
8–12 minEstimate (if needed)Rough DAU, QPS, storage — one napkin calculation
12–22 minHigh-level designBox diagram, main APIs, data entities, one happy path
22–38 minDeep dives1–2 bottlenecks with options and trade-offs
38–43 minFailure / extendSingle region → multi-region; cache miss; idempotency
43–45 minRecapRequirements → design → trade-offs in three sentences

Signals that impress:

  • Checking in — "Does this scope work before I go deeper?"
  • Alternatives — "We could use X; I'd pick Y because…"
  • Numbers tied to decisions — "10K QPS is why I'd add a cache layer here."

Signals that hurt:

  • Silent drawing for twenty minutes
  • Technology salad with no data flow
  • No non-functionals until the interviewer asks

If you're running long, cut a deep dive, not clarification. A clear scoped design with one solid trade-off beats three half-explained subsystems.


Common Mistakes

Jumping to the database schema

Tables and indexes before user stories → wrong keys, wrong sharding strategy. Fix: requirements first, conceptual model second, physical schema last.

Buzzword bingo

"Kafka, Cassandra, Redis, Elasticsearch" with no arrows between them. I did this on the Twitter question. Fix: every component earns its place against a requirement or bottleneck.

Ignoring read/write ratio

Designing write-optimized storage for a 1000:1 read system (or vice versa). Fix: ask the ratio early; it drives caching and replication choices from the fundamentals posts.

No explicit assumptions

Interviewers can't help if you don't state DAU, latency targets, or consistency needs. Fix: propose reasonable defaults and invite correction.

Designing v2 in v1

Analytics, ML ranking, multi-region active-active, and admin tooling in one pass. Fix: out-of-scope list + "extension point" on the diagram.

Single deep dive on the wrong thing

Forty minutes on JWT vs session cookies when the hard problem is timeline fan-out. Fix: ask where risk lives; prioritize the constraint that breaks first at scale.

Forgetting the human

No recap, no check-ins, no trade-off language. Fix: narrate your thinking; treat it as a pairing session, not a solo exam.


Key Takeaways

  1. Process beats vocabulary — clarify requirements, scope the MVP, sketch the shape, then deep-dive where constraints collide (I learned this after jumping to Kafka too early).
  2. Split functional and non-functional requirements early — features define APIs; latency, scale, and consistency define infrastructure.
  3. Say what's out of scope — in interviews and design docs; it's prioritization, not weakness.
  4. Estimate when numbers change the architecture — rough QPS and storage prevent wrong one-size-fits-all choices; details live in the math post.
  5. High-level design before details — five to seven boxes, one happy path, sync/async boundaries visible.
  6. Trade-offs are the product — name the bottleneck, compare options, pick one, state what you sacrifice.
  7. Interview vs production differs in time and depth, not in structure — the same steps apply; production adds edge cases, ops, and iteration.

Test Your Understanding

🧩 Initializing quiz...
Quiz ID: system-design-how-to-approach-any-problem

Happy coding!

Next in series: Back-of-the-Envelope Math That Actually Matters (coming soon)

Written by Sandeep Reddy Alalla

Share your thoughts and feedback!