What Is System Design? A Beginner's Introduction
Start here. What system design actually is, the vocabulary you need before anything else makes sense, and the four things an interviewer is quietly grading while you talk.
Covers: Definition, functional vs non-functional requirements, the anatomy of a modern web system, what interviewers score
System design is the practice of deciding how the pieces of software fit together so that a product keeps working when it gets popular, when a machine dies, and when the team doubles in size. Writing a function is programming. Deciding that the function should live behind a queue, read from a replica, and fail open when the cache is cold - that is system design.
If you have never done it before, the intimidating part is that there is no compiler. Nothing tells you your answer is wrong. That is also the liberating part: in an interview there is no single correct design, only designs whose trade-offs you can or cannot defend.
The shape of almost every system you will design
Tap any box. Nearly every interview answer is a variation on this skeleton - you add, remove and specialise boxes, but the flow is remarkably stable.
Flow
- ClientsDNS + CDN
- DNS + CDNLoad balancer
- Load balancerApplication servers
- Application serversCache(read)
- Application serversPrimary database(write)
- Primary databaseRead replicas(replicate)
- Application serversMessage queue(enqueue)
- Message queueWorkers
- WorkersObject storage
30-second answer
Functional requirements say what the system does - post a tweet, follow a user, search. Non-functional requirements say how well it must do it - 100 million daily users, 200 ms p99, 99.99% availability, five-year retention. The functional list decides which boxes appear in your diagram; the non-functional numbers decide how many of each box, which database, and whether you need a cache, a queue or a CDN at all. Two systems with identical features and different scale numbers are completely different designs.
This is the most under-rated distinction in system design, and it is where most weak interviews are lost in the first five minutes.
| Functional | Non-functional | |
|---|---|---|
| Asks | What does it do? | How well must it do it? |
| Examples | Upload a photo; follow a user; full-text search | 1 M DAU; p99 < 200 ms; 99.99% uptime; GDPR delete in 30 days |
| Decides | Which services and endpoints exist | Replication, caching, sharding, queueing, region count |
| Interview weight | ~25% - establishes scope | ~75% - this is what makes it system design |
Consider design a URL shortener. The functional requirements are trivial: shorten a URL, redirect a short code. Now change one non-functional number:
- 100 requests/day → a single Postgres table and one small server. You are done in three minutes.
- 100,000 requests/second, global, 99.99% → CDN edge redirects, a distributed key-value store, pre-generated ID ranges per host, multi-region replication, and an asynchronous analytics pipeline.
Same features. Completely different system. That is why you never start drawing until you have numbers.
The six non-functional questions to always ask
Scale
How many users, and how many requests per second at peak? Peak is typically 2–3× the daily average.Read/write ratio
100:1 read-heavy means caching and replicas. 1:1 or write-heavy means partitioning and write-optimised storage.Latency target
Always ask for the percentile. 'Fast' is meaningless; 'p99 under 200 ms' is a design constraint.Availability target
99.9% is 43 minutes of downtime a month. 99.99% is 4.3 minutes and needs multi-AZ with automated failover.Consistency requirement
Can a user briefly see stale data? For a like count, yes. For an account balance, no. This single answer picks your database.Durability and retention
Can you ever lose a write? How long must data live, and does it need to be deletable on request?
Say these points
- Functional = what it does; non-functional = how well, and the latter drives the architecture.
- Always convert vague adjectives into numbers: users, RPS, percentile latency, nines.
- Ask read/write ratio early - it decides caching, replication and storage engine.
- State the consistency requirement explicitly; it is the fork in the road for database choice.
Avoid these mistakes
- Drawing boxes before asking a single clarifying question.
- Accepting 'it should be fast' without pinning a percentile and a number.
- Designing for a billion users when the interviewer said ten thousand - over-engineering scores as badly as under-engineering.
- Listing twenty features and running out of time before you reach scale.
Expect these follow-ups
- The interviewer refuses to give you numbers. What do you do?
- Which single non-functional requirement most often forces you away from a relational database?
- How would your design change if availability mattered more than consistency?
30-second answer
Latency is how long one request takes; throughput is how many requests you complete per second. They are not inverses - you can raise throughput with batching while making latency worse. Availability is the fraction of time the system successfully serves requests, and consistency is whether every reader sees the latest write. The central tension is that improving availability usually means adding replicas, and adding replicas makes strong consistency slower and more fragile.
| Term | Unit | Measured as | Improved by |
|---|---|---|---|
| Latency | milliseconds | p50 / p95 / p99 of request duration | Caching, indexes, fewer network hops, CDN |
| Throughput | requests/second | Completed requests per unit time | More servers, batching, connection pooling, async work |
| Availability | percentage / nines | Uptime ÷ total time | Redundancy, health checks, failover, no single points of failure |
| Consistency | model, not a number | Whether a read reflects the latest write | Synchronous replication, quorums, single-leader writes |
Latency and throughput are not the same knob
A useful analogy: a motorway. Latency is how long your car takes to travel it. Throughput is how many cars per hour arrive at the other end. Add lanes and throughput rises while your personal travel time is unchanged. Raise the speed limit and latency drops. They are related, but you tune them with different tools.
Batching makes this concrete: writing 1,000 rows one at a time might give you 5 ms per write and 200 writes/second. Batching them into groups of 100 might give you 40 ms per batch - worse latency for the last row in a batch - but 2,500 writes/second. Throughput up 12×, latency up 8×.
Availability in practice
| Availability | Downtime / year | Downtime / month | Typically means |
|---|---|---|---|
| 99% (two nines) | 3.65 days | 7.3 hours | One server, manual recovery |
| 99.9% (three nines) | 8.77 hours | 43.8 minutes | Redundant instances, automated restart |
| 99.99% (four nines) | 52.6 minutes | 4.4 minutes | Multi-AZ, automated failover, no manual step |
| 99.999% (five nines) | 5.26 minutes | 26 seconds | Multi-region active-active, very expensive |
Each extra nine roughly multiplies cost and operational complexity. Part of being senior is saying “three nines is enough for this product” rather than reflexively reaching for five.
Say these points
- Latency = per-request time; throughput = requests per second; they trade via batching and queueing.
- Quote p95/p99, not averages - tail latency dominates real page loads.
- Know the nines table cold: 99.9% ≈ 43 min/month, 99.99% ≈ 4 min/month.
- Availability comes from redundancy, and redundancy is what forces the consistency trade-off.
Avoid these mistakes
- Treating latency and throughput as reciprocals.
- Reporting average latency in a design discussion.
- Promising five nines without mentioning multi-region cost and complexity.
- Saying 'highly available and strongly consistent' with no acknowledgement of the trade-off.
Expect these follow-ups
- Your p50 is flat but p99 tripled after a deploy. What are your first three hypotheses?
- If two services each have 99.9% availability and a request needs both, what is the combined availability?
- How does adding a retry affect availability and throughput?
30-second answer
Roughly: 5 minutes clarifying requirements and scale, 5 minutes on API and data model, 10 minutes on a high-level design you draw end to end, 15 minutes going deep on two or three components the interviewer picks, and 5–10 minutes identifying bottlenecks and scaling the design. The failure mode is spending twenty minutes on requirements and never producing a design, or drawing instantly and never justifying anything.
0–5 min · Clarify and scope
Restate the problem. List 3–5 functional requirements and explicitly park the rest. Get numbers: DAU, read/write ratio, latency and consistency targets. Write them in a corner of the board and refer back to them later - that call-back is a strong senior signal.5–10 min · Estimate and define the contract
Back-of-envelope: QPS, storage per year, bandwidth. Then sketch 3–4 API endpoints and the core entities. This is where you decide what the system stores, which constrains everything downstream.10–20 min · High-level design
Draw client → edge → service → storage, end to end, and walk one write and one read through it out loud. Get to a complete design early, even a naive one. A finished simple design beats a beautiful half-design every time.20–35 min · Deep dive
The interviewer will pick a component: 'how does the feed get generated?', 'what happens if this shard is hot?'. This is the highest-signal section. Go two layers deeper than you think is necessary and name concrete technologies with reasons.35–45 min · Scale, fail, and wrap
Proactively find your own bottleneck and fix it. Then discuss failure: what happens when the cache dies, when a region goes down, when the queue backs up. Close with a one-sentence summary of the key trade-off you chose.
Drive the conversation
The strongest candidates narrate their own agenda: “I'll spend two more minutes on requirements, then draw the write path, then we can go deep wherever you'd like.” This turns the interview from an interrogation into a design review - which is exactly the collaboration the interviewer is trying to simulate.
Say these points
- Have a complete end-to-end design by roughly the 20-minute mark.
- Write the requirement numbers down and refer back to them when justifying decisions.
- Find your own bottleneck before the interviewer does.
- Narrate your agenda and think out loud - silence scores zero.
Avoid these mistakes
- Endless requirements gathering with no diagram.
- Jumping straight to Kafka and microservices for a problem that needs one database.
- Waiting to be asked about failure modes instead of raising them yourself.
- Naming technologies without saying why that one and not the obvious alternative.
Expect these follow-ups
- You realise at minute 30 that your data model is wrong. What do you do?
- The interviewer stays silent the whole time. How do you adapt?
- How does this structure change for a 30-minute screen versus a 60-minute onsite?
30-second answer
There are about a dozen reusable components: DNS, CDN, load balancer, API gateway, stateless application servers, cache, relational and NoSQL databases, object storage, message queue or event log, search index, and a background worker pool. Each exists to solve one specific bottleneck. Knowing which problem each solves means you add components because you need them, rather than because they look impressive.
Almost every system design answer is assembled from the same small kit. Learn what each piece is for and design becomes composition rather than invention.
| Component | Problem it solves | Add it when |
|---|---|---|
| CDN | Users far from your servers wait on the speed of light | You serve static assets or cacheable media to a geographically spread audience |
| Load balancer | One server cannot handle the traffic, and it is a single point of failure | You have more than one application server - i.e. essentially always |
| API gateway | Auth, rate limiting and routing duplicated in every service | You have several backend services behind one public surface |
| Cache | The database answers the same expensive question repeatedly | Reads dominate writes and the same keys are hot |
| Read replica | Read traffic saturates the primary database | Read-heavy workload that tolerates a few hundred ms of staleness |
| Message queue | Slow work blocks the user's request | Any task the user need not wait for: email, transcode, index, analytics |
| Event log (Kafka) | Many consumers need the same stream, replayably | You need fan-out, replay, or an audit trail of state changes |
| Object storage | Large binaries bloat and slow the database | Images, video, backups, exports - anything measured in megabytes |
| Search index | LIKE '%term%' cannot do relevance and does not scale | Full-text search, faceting, typo tolerance or ranking is a feature |
| Worker pool | Background jobs compete with web requests for CPU | You have a queue - workers are the other half of it |
The order things usually get added
- One server, one database. Serves surprisingly many products.
- Split the database onto its own machine, so a traffic spike does not starve it of CPU.
- Add a load balancer and a second app server. Now you survive one machine dying.
- Add a cache. Usually the single largest latency win you will ever get.
- Add a CDN for static assets and media.
- Add read replicas when read load saturates the primary.
- Add a queue and workers to push slow work out of the request path.
- Shard the database when a single primary can no longer take the write volume.
- Split services only when team coordination cost, not machine cost, becomes the bottleneck.
Say these points
- Each component removes one specific bottleneck; name the bottleneck before adding the box.
- Caching and CDNs are usually the cheapest big wins for read-heavy systems.
- Queues convert slow synchronous work into fast requests plus background jobs.
- Sharding and microservices come last - they cost the most complexity per unit of benefit.
Avoid these mistakes
- Starting with microservices and Kafka for a system with 1,000 users.
- Adding a cache without discussing invalidation or cold-start behaviour.
- Forgetting that the load balancer itself needs redundancy.
- Storing images as blobs in the relational database.
Expect these follow-ups
- Your cache layer goes down completely at peak. What happens, and how do you survive it?
- When is a read replica the wrong answer to a read-heavy workload?
- Why might you deliberately keep a monolith at 50 engineers?
Showing 4 of 4 questions for what-is-system-design.
Check your understanding
4 questions · no sign-up, nothing stored
Hands-on challenge
Build it - this is what you talk about in a deep-dive round.
Write the requirements doc for a photo-sharing app
Before you can design, you must scope. Produce a one-page requirements document for a photo-sharing product with 10 million daily active users, without drawing a single box.
Requirements
- List exactly five functional requirements and three you are explicitly excluding.
- State DAU, peak QPS assumption, read:write ratio and average photo size, with your reasoning.
- Set a p99 latency target for feed load and for photo upload, and justify why they differ.
- Pick an availability target and translate it into minutes of downtime per month.
- State, per feature, whether stale reads are acceptable and for how long.
Stretch goals
- Redo the numbers for 100× the users and note which requirement breaks first.
- Write the one sentence you would say to an interviewer to summarise the hardest constraint.