Introduction to System Design
What system design is, the building blocks of large systems, functional vs non-functional requirements, and a repeatable framework for system design interviews.
System design is deciding how the parts of a software system fit together so it meets its requirements: serving millions of users, staying up when machines fail, responding fast, and remaining affordable and maintainable. There's rarely one right answer. The skill is understanding the trade-offs and choosing deliberately.
The building blocks
Almost every large system is assembled from the same parts:
| Block | Purpose | Lesson |
|---|---|---|
| DNS, CDN | Route users; serve static and cacheable content near them | CDN |
| Load balancer | Spread traffic across servers; remove unhealthy ones | Load balancing |
| Stateless app servers | Business logic; scale by adding more | Scalability basics |
| Cache | Serve hot data from memory | Caching |
| Database | Durable source of truth | Database scaling |
| Queue + workers | Async and background processing; absorb spikes | Message queues |
| Object storage | Files, images, video, backups | — |
| Observability | Metrics, logs, traces, alerts | Observability |
Requirements: functional and non-functional
- Functional — what the system does: "users can shorten a URL", "users see a feed of people they follow".
- Non-functional — how well it does it. These drive the architecture:
| Quality | Question | Typical target |
|---|---|---|
| Scale | How many users, requests per second, how much data? | 10M daily users, 5k QPS |
| Latency | How fast must it respond? | p99 under 200 ms |
| Availability | How much downtime is acceptable? | 99.9% (8.8 h/year) – 99.99% (53 min/year) |
| Consistency | Must every read see the latest write? | Strong for payments; eventual for likes |
| Durability | Can we ever lose data? | Never for orders; acceptable for view counts |
| Cost, security, compliance | Budget, data residency, privacy | — |
A framework for system design interviews
- Clarify requirements (5 min). Ask about features, users, scale, read/write ratio, latency and consistency needs. Agree on what's in and out of scope.
- Estimate (5 min). Requests per second, storage, bandwidth (Back-of-the-envelope). Numbers tell you whether one database suffices or you need sharding.
- Define the API and data model (5 min). Key endpoints, main entities and how they're accessed.
- High-level design (10 min). Draw the boxes and arrows for the main flows (write path and read path) end to end.
- Deep dives (15 min). Pick the hardest parts — the bottlenecks, scaling the database, caching strategy, consistency, failure handling — and go deep with trade-offs.
- Wrap up (5 min). Bottlenecks, single points of failure, monitoring, and what you'd do next.
Core trade-offs you'll meet again and again
| Trade-off | Example |
|---|---|
| Consistency vs availability | During a network partition, refuse writes or accept possibly conflicting ones (CAP) |
| Latency vs consistency | Read from a nearby replica (fast, maybe stale) or the leader (slow, fresh) |
| Latency vs throughput | Batching improves throughput but delays individual items |
| Normalisation vs denormalisation | Fewer duplicates vs faster reads |
| SQL vs NoSQL | Rich queries and transactions vs simple scale-out |
| Push vs pull | Precompute feeds on write vs assemble them on read |
| Sync vs async | Simple and immediate vs decoupled and resilient |
| Build vs buy | Control vs time to market |
Case studies in this track
Practise the framework end to end: URL shortener, chat system, news feed, video streaming, and distributed cache.
Key takeaways
- System design composes standard blocks: DNS, CDN, load balancers, stateless servers, caches, databases, queues, object storage.
- Non-functional requirements (scale, latency, availability, consistency) drive the architecture.
- Interview framework: requirements → estimates → API/data → high-level design → deep dives → wrap-up.
- Always state the trade-offs behind each choice.