Learn to Code
All tracks
Learn to Code

Free lessons from scratch to pro — every language, databases and DevOps.

AboutContactPrivacy PolicyTerms of Use

Your progress is saved in this browser. © 2026 Learn to Code

SD
System Design
0/13 completed
Beginner
What is system design?How the internet worksBack-of-the-envelope estimation
Intermediate
Scaling basicsLoad balancersCachingDatabases at scale
Advanced
Sharding and consistent hashingMessage queues and event streamingConsistency, CAP and distributed transactionsReliability and observability
Pro
Designing a URL shortenerDesigning a chat app
Tracks / System Design / Beginner

What is system design?

Writing a function that works is programming. Designing a product that serves millions of users, stays up when servers fail, keeps data safe, and remains affordable is system design. It's about choosing and connecting components (servers, databases, caches, queues, CDNs) and understanding the trade-offs between them.

System design is also a standard interview for mid-level and senior engineers: "Design a URL shortener", "Design WhatsApp", "Design a news feed". This track teaches the building blocks, then uses them in complete designs.

The simulations in this track run as Python in your browser. They're tiny models of real systems: enough to see why consistent hashing moves fewer keys, how caches change latency, or what a quorum guarantees.

From one server to many

Almost every system starts like this:

  users ──▶  one server (web app + database)

and, as it grows, ends up something like this:

                         ┌──────────── CDN (images, JS, CSS) ◀──────┐
  users ──▶ DNS ──▶ load balancer ──▶ app servers (×N, stateless) ───┤
                                          │         │          │
                                     cache (Redis)  │     message queue ──▶ workers
                                                    ▼
                                  primary DB ──replicates──▶ read replicas
                                       │
                                  object storage (S3), search index, analytics

Each box exists to solve a specific problem, and each adds cost and complexity. The skill is knowing which problems you actually have.

The qualities we design for

Quality Question Typical tools
Scalability Can it handle 10× more users? Horizontal scaling, caching, sharding, queues
Availability Is it up when users need it? Redundancy, failover, multiple zones
Reliability Does it work correctly, even when parts fail? Replication, retries, idempotency, backups
Latency Is it fast? Caching, CDNs, indexes, being close to users
Consistency Do all users see the same, correct data? Transactions, quorums, a single source of truth
Durability Is data never lost? Replication, backups, write-ahead logs
Cost Can we afford it? Right-sizing, managed services, caching
Maintainability Can the team understand and change it? Simplicity, clear boundaries, observability

You can't maximise them all. Every design decision is a trade-off: caching improves latency but risks stale data; more replicas improve availability but complicate consistency; microservices help large teams but add network failures.

Numbers every engineer should know

Rough orders of magnitude guide good decisions. Memory is far faster than disk, and disk is faster than the network across the world:

Python · editable

Consequences you'll see throughout this track: keep hot data in memory (caches), keep users close to servers (CDNs, regions), and avoid many sequential network calls in one request.

Approaching a design problem

Use the same steps for real projects and for interviews:

  1. Clarify requirements.
    • Functional: what must it do? ("Users shorten URLs; visiting a short URL redirects.")
    • Non-functional: scale, latency, availability, consistency. ("100M new URLs a month, redirects under 50 ms, 99.99% available.")
  2. Estimate the scale: requests per second, storage, bandwidth (next lessons show how).
  3. Define the API and data model: endpoints, main entities, how they're accessed.
  4. High-level design: draw the main components and the request flow for the key use cases.
  5. Deep dives: the hardest parts. Bottlenecks, the database choice, caching, failure handling.
  6. Trade-offs and evolution: what you'd monitor, what breaks first at 10× scale, alternatives you rejected and why.

In interviews, there's no single right answer. Interviewers want to see you ask good questions, reason about trade-offs, and justify choices with numbers.

Practice

  1. Pick an app you use daily (a food-delivery app, a music streaming service). List its functional and non-functional requirements.
  2. Sketch its components as boxes and arrows, starting from one server and adding only what you can justify.
  3. For each box you added, write down which quality it improves and what it costs.
✎ Check your understanding

1.What is a non-functional requirement?

2.Roughly how much slower is a round trip between continents than a RAM reference?

3.What is usually the first step in a system design discussion?