System design interview · practical field guide

One clear 30-minute answer.

You do not need to sound complicated. Move from the problem to the big picture, then prove one hard part works. This page gives you the order, the questions, the math, and the exact words to use.

The order to remember.

01Clarify02Estimate03Draw04APIs05Data06Walk through07Go deep08Break it09Secure it10Summarize
01

Clarify the problem.

Minutes 0–5
Goal: Know what you are building before choosing technology.
Start by saying

“Let me restate the problem. We are building ___ for ___ so they can ___.”

Who uses it?

  • Regular users
  • Administrators
  • Human reviewers
  • Other systems
  • Background jobs

What do they do?

  • Create or upload
  • Read or search
  • Update or delete
  • Receive notifications
  • Review or approve

What is in version one?

“Which three or four features should I focus on?”

Say what you will not design: payments, login, mobile apps, advanced reports, or internal tools.

How big?

  • Daily users
  • Actions per user
  • Busy-hour multiplier
  • Expected growth
  • Records or files

How fast and reliable?

  • Which actions must feel immediate?
  • Which can run later?
  • May acknowledged data be lost?
  • Must another region take over?

How fresh?

“Must users see an update immediately, or is a short delay okay?”

This choice changes how much coordination your system needs.

What if the answer is wrong?

  • Is a missed result worse than a wrong one?
  • Can we reverse the decision?
  • Must a person approve it?

Is the data sensitive?

  • Personal, medical, or financial?
  • Keep customers separate?
  • Need an audit history?
  • Must data stay in one country?

What else must we call?

  • Payment or email provider
  • GitHub
  • Hospital or government system
  • AI model provider

Do only useful math.

Still inside minutes 0–5
Rule: State an assumption, show the formula, round the answer, then say what it changes.
requests/sec = daily users × actions/day ÷ 86,400

Sizes the API and database.

peak requests/sec = average × 3 to 10

Capacity must handle the busy period.

read traffic = total traffic × read %

Heavy reads may benefit from a cache or read copies.

write traffic = total traffic × write %

Heavy writes may force data splitting.

storage = items × bytes/item × retention × copies

Include indexes and backups.

bandwidth = requests/sec × bytes/request

Large uploads may make the network the limit.

work in progress = jobs/sec × seconds/job

Estimates workers and open connections.

review hours = cases × review rate × min/case ÷ 60

People may be the real limit.

After the math, say

“This tells me ___. Therefore, I would ___.”

Finish this step

“I’ll focus on ___. Peak traffic is about ___. Writes must ___. ___ may be slightly delayed. I’ll leave ___ outside the scope.”

02

Draw the big picture.

Minutes 5–12
Goal: Use a few large boxes. Add a box only when it solves a requirement.
Web or mobile client
Load balancer / API gateway
Application
Main database
Work queue
Workers
File / search storage

1. Users and outside systems

Draw who starts work and the providers your system calls.

2. Entry point

Receive the request, check identity, apply limits, and route it.

3. Application

Start with one application. Split a responsibility only if it must scale, deploy, or fail separately.

4. Main database

Store the information your system considers correct: users, orders, cases, payments, decisions, status.

5. File storage

Use for images, videos, documents, backups, and large generated results.

6. Queue + workers

Use for slow work: processing, email, AI calls, reports, and slow providers.

7. Cache

Add only for repeated reads. Name the key, lifetime, stale behavior, and fallback.

8. Search storage

Add only when database queries cannot handle full text, complex filters, similarity, or location.

9. Outside services

Show timeouts, safe retries, and provider limits.

Quick architecture choices

Choose the simpler option until a requirement forces the other
ChoiceUse it whenCost
One applicationParts can scale and release togetherLess freedom later
Separate servicesParts must scale, release, or fail aloneMore network and operational work
Direct callThe work is quick and the user needs the result nowCaller waits; failures spread
QueueThe work is slow or can finish laterDelayed result; duplicates are possible
Redis cacheMany requests read the same dataMay be stale; must be rebuildable
Walk through one normal request

“The client sends a request. The API checks access. The application validates it and saves the official record. Slow work enters a queue. A worker processes it, saves the result, and the client reads the new status.”

03

Design the main APIs.

Minutes 12–15
Goal: Show how people and systems use your design.

Start from user actions

POST /submissions
GET  /submissions/{id}
POST /submissions/{id}/complete
GET  /cases/{id}
POST /review-tasks/{id}/claim
POST /decisions

For each important API

  • Who may call it?
  • What does it receive?
  • What does it return?
  • Does it finish now or later?
  • Can the caller safely try again?
  • What errors can occur?

Large lists

Add pagination. Return a cursor that points to the next page.

Important creates

Accept a unique retry key so a repeated request does not create two payments, orders, or decisions.

Competing updates

Require the record version: “Update only if this case is still version 7.”

Response choice

Should the API finish the work now?
StyleBest whenTrade-off
Return resultWork is fast and predictableRequest stays open
Return job IDWork is slow or failure-proneClient must check status
04

Define the data.

Minutes 15–18
Goal: Explain what the system must remember and how it will read it.

Main records

User · Submission · Document · Case · Review task · Decision

Important fields

ID · customer ID · current state · version · created time · updated time · relationships

Common reads

Case by ID · pending tasks for a reviewer · documents in a submission · evidence behind a decision

Common updates

Finish upload · send case to review · claim task · publish decision

Choose storage from those reads and updates

“These records have clear relationships and important updates, so I would begin with a relational database.”

Separate the official data from useful copies

Official state
Main database
Searchable copy
Search storage
Temporary popular copy
Cache
Delayed reporting copy
Analytics storage

Say which copies may be slightly old. If two copies disagree, name which one wins.

Quick database choices

Main database
ChoicePick it whenWatch out for
PostgreSQLRelated records and safe updatesScaling writes takes planning
DynamoDBHuge traffic; known key lookupsChanging queries are harder
MongoDBRecords are flexible documentsRelationships become harder
RedisTiny, key-based data needs extreme speedRAM cost, limited queries, careful durability
Searchable database
ChoicePick it whenWatch out for
Postgres searchSearch is simpleLimited ranking and typo handling
OpenSearchAdvanced text, filters, rankingAnother system; results may lag
PostGISNearby or area searchOnly solves location search
pgvectorAI similarity search at moderate scaleMeasure before very large scale

Default: PostgreSQL holds the official data. Redis is usually a rebuildable cache. Add a separate search database only when PostgreSQL search is not enough.

Quick AI choices

Two definitions

An embedding is a list of numbers that represents meaning. A vector database finds items with similar embeddings; it does not replace the official database.

Vector database choices
ChoicePick it whenMain cost
pgvectorPostgreSQL already exists; start simpleShares resources with normal database work
PineconeWant a managed service with little operations workVendor dependency and recurring cost
QdrantWant focused open-source vector searchAnother database to run and synchronize
WeaviateWant objects, vectors, and AI integrations togetherMore concepts and moving parts
MilvusVector search is central and extremely largeMore infrastructure and operational work
RedisAlready use Redis and need very low latencyMemory cost; not the official document store
OpenSearchNeed keywords, filters, and vectors togetherHeavy if vector search is the only need
How to improve an AI answer
ChoicePick it whenWatch out for
Prompt onlyTask is simple and facts are already suppliedLess control and grounding
Retrieval (RAG)Facts change or answers need citationsBad retrieval produces bad context
Fine-tuningNeed repeated behavior, style, or formatNeeds training data and release testing
Human reviewA wrong answer has a high costSlower and limited by reviewer capacity
Model selection
ChoicePick it whenWatch out for
One modelStart simple; one quality level is enoughMay overpay for easy work
Model routingTasks need different cost, speed, or qualityEvery route needs separate evaluation
Fallback modelAvailability matters more than identical outputBehavior and quality can change
AI output handling
ChoicePick it whenWatch out for
Save evidenceNeed audit, debugging, or reviewStorage and privacy cost
Cache outputSame safe input repeats oftenStale or sensitive answers may be reused
Generate againFreshness matters and variation is acceptableHigher cost and different answers

Strong default: Start without vectors. Add pgvector when meaning-based search clearly helps. Use retrieval for changing facts, fine-tuning for repeated behavior, and human approval when a wrong result is expensive.

05

Follow one request.

Minutes 18–21
Goal: Prove the design works from beginning to end.

1. Start

What user action or outside event begins the work?

2. Handle

Which component receives it and checks it?

3. Read

What existing data is needed?

4. Write

What official state changes?

5. Continue

What happens immediately? What happens later?

6. Fail

What happens if this step does not finish?

Show the state changes

UploadingProcessingNeeds reviewApproved or rejected
06

Go deep on one hard part.

Minutes 21–25
Goal: Show what makes this system different from a basic web app.

Use the same four-part story every time

  1. State the problem.
  2. Give a real example.
  3. Explain the solution.
  4. Explain what the solution costs or makes harder.

Possible hard parts

  • Prevent duplicate payments
  • Order messages
  • Process huge files
  • Find nearby places

More hard parts

  • Keep search permissions correct
  • Run long jobs safely
  • Handle two editors
  • Show evidence behind an AI answer

What to say

“The hard part is ___. For example, ___. I would solve it by ___. The trade-off is ___.”

Freshness choice

How quickly must copies agree?
ChoiceUse it forCost
ImmediateMoney, ownership, approvalsMore waiting and coordination
Short delaySearch, analytics, notificationsUsers may briefly see old data
07

Break the design.

Minutes 25–27
Goal: Show the system stays safe when normal assumptions fail.
Failure to testWhat you must answer
The client sends the same request twiceHow do we recognize it? Does the second call return the first result?
A worker crashes halfway throughWhere was progress saved? Can another worker continue?
The queue sends the same job twiceCan processing twice change the result twice?
A provider finishes but the response times outCan we look up the provider’s result before trying again?
Two users update one recordDoes a version check reject the older update?
The database is unavailableDo we fail, wait, or accept only work we can save safely?
One region failsWho takes over? Could two regions both think they are in charge?
A job always failsWhat is the retry limit? Where does a person see it?

Retry choice

Retries help only when the operation is safe to repeat
ChoiceUse it whenRisk
Retry automaticallyFailure is temporary and duplicates are blockedCan overload a sick system
Stop and reviewResult is unknown or failure repeatsSlower; needs a person
For every failure, answer

“How do we detect it? Is retrying safe? Where is progress saved? When do we stop retrying? When does a person step in?”

08

Secure it.

Minutes 27–28
Goal: Protect people, customers, and sensitive information.
Important sentence

“The server finds the customer from the signed-in user. It never trusts a customer ID from the browser without checking it.”

09

Explain growth and operation.

Minutes 28–29
Goal: Say how the system grows, how you know it is healthy, and how you release safely.

Grow

  • Add API instances
  • Add workers
  • Add database read copies
  • Split data only when needed
  • Limit requests
  • Slow new work when queues grow

Measure

  • Request time and errors
  • Queue size and oldest job
  • Worker failures
  • Database load
  • Correct result rate
  • Cost and review time

Release

  1. Test saved examples.
  2. Run without changing real decisions.
  3. Compare to the old system.
  4. Enable a small group.
  5. Increase traffic slowly.
  6. Keep a rollback path.

Database growth choices

Scale in this order when measurements justify it
ChoiceHelps withCost
Bigger serverEarly read and write growthHas a limit
Read copiesHeavy readsMay briefly return old data
Split dataWrites or data exceed one databaseHarder queries and operations
10

Summarize.

Minute 29–30
Goal: End with a short answer that proves the design is complete.

Your closing template

“To summarize, we are building ___ for ___. The API handles ___. The official state is stored in ___. Slow work goes through ___ and is handled by ___. The main safety mechanism is ___. The system scales by ___. The main trade-off is ___, which is acceptable because ___.”

Final ten-question check

Use only when the interviewer goes deeper

Extra cheat sheets.

The interview still follows the ten steps above. This bottom section is a lookup tool. Do not force every idea into every answer.

1. Make database reads faster

First name the read you need. Then choose the smallest change that makes that read fast enough.

Database access choices
ChoiceUse it whenMain cost
Normal indexYou filter or sort by known fieldsMore storage; writes become a little slower
Read copyReads are much heavier than writesIt may briefly show old data
Split the dataOne database cannot hold or write everythingQueries across splits become harder
Saved result viewThe same expensive result is requested oftenThe saved result must be refreshed
Say: “I would first add the index needed by this read. I would split the database only after one database is truly the limit.”

2. Put slow work in a queue

A queue lets the API accept work quickly and lets workers finish it later.

Message delivery choices
ChoiceWhat it meansUse it when
At most onceA job may be lost, but it is not repeatedLosing the work is harmless
At least onceA job is not lost, but it may arrive twiceThe worker can safely recognize repeats
One business resultRepeats may arrive, but only one result is savedUse a stable job ID and a database uniqueness rule
OrderedJobs with the same key are handled in orderOrder matters more than maximum speed
Good default: “I assume the queue may send a job more than once. Each job has a stable ID, and the database prevents a second business result.”

3. Use a cache without trusting it

A cache is a fast copy. The system should still be correct if the cache is empty or unavailable.

Common cache problems
ProblemSimple responseWhy
Old valueUse an expiry time and remove changed entriesLimits how long old data survives
Missing valueRead the main database, then fill the cacheThe main database still owns the truth
Many requests miss togetherLet one request refill while others wait brieflyProtects the database from a sudden rush
One very popular keyCopy it locally or spread the loadOne cache machine should not take all traffic
Cache is downFall back to the database and limit trafficThe cache improves speed, not correctness
Say: “Redis improves speed. Correctness does not depend on Redis being available.”

4. Choose how updates reach the client

Client update choices
ChoiceBest forMain cost
PollingSimple, occasional status checksExtra requests; updates arrive late
Long pollingUpdates should feel quick but are uncommonConnections stay open longer
Server-sent eventsThe server continuously sends updates to the browserMostly one-way
WebSocketFrequent two-way messages, such as chat or live editingMore connection and recovery work
WebhookOne server tells another server that something happenedMust verify sender and handle repeats

5. State the recovery target

RTO

Recovery time objective: how long the service may take to come back.

RPO

Recovery point objective: how much recent data may be lost.

Example

“RTO is one hour. RPO is five minutes. We test restoring backups and switching regions.”

Approximate downtime per year

99.9%8h 46m
99.95%4h 23m
99.99%53m
99.999%5m
100%Not a realistic promise

6. Keep multi-step updates safe

When one action changes several things
SituationUsePlain meaning
Several records in one databaseDatabase transactionSave all changes or save none
Save data, then publish a messageOutbox recordSave the business change and “message to send” together
Several independent servicesSteps with undo actionsIf a later step fails, reverse earlier work where possible
Provider timed outLook up by stable request IDFind whether it already finished before trying again
Two people update one itemExpected version checkReject an update based on an older copy

7. Choose an ID

ID choices
ChoicePick it whenMain cost
Database numberOne main database creates the recordsHarder to create independently in many places
UUIDMany machines create records independentlyLarger and less friendly to database indexes
Time-sortable IDYou want distributed IDs that roughly sort by timeTime order is not the same as cause-and-effect order
Dedicated ID serviceExtreme distributed scale requires compact IDsAnother important service to operate

8. Protect the API

9. Put AI in production safely

Treat AI output as a proposed result. Decide when software may accept it, when it must show evidence, and when a person must approve it.

Say: “The model proposes an answer with evidence. Deterministic checks and, when needed, a person decide whether it becomes official.”

10. Requirement → likely component

Large filesObject storage
Slow workQueue + workers
Repeated readsCache
Text rankingOpenSearch
Meaning searchVector search
Live two-way updatesWebSocket
Static global assetsCDN
Reports and analysisWarehouse or object storage
Safe related updatesPostgreSQL
Huge known-key trafficDynamoDB

These are starting points, not rules. Explain the requirement first, then name the component.

Before you finish, scan this list.