Study companion · updated December 2026

The System Design Primer, with practice for every topic

The System Design Primer on GitHub is one of the most widely shared free resources for learning system design. This page does not replace it. It lists what the primer covers, section by section, and gives you a Codemia problem, lesson or course for each topic and each of its exercises, so you can practise a design and get feedback on it after you read.

Video transcript

The System Design Primer is one of the most widely shared free resources for learning system design. It's an open source repository on GitHub, by Donne Martin. It's organised by concept, and it starts with the first trade-offs. Performance and scalability, latency and throughput, availability and consistency.

Then it follows a request in. Domain name system, content delivery networks, load balancers, reverse proxies, and the application layer. Then data. Relational and NoSQL databases, caches, queues, and the protocols that connect them. It even ships with Anki flashcards for revision.

It also works through classic interview questions with solutions, like Pastebin, a Twitter timeline, and a web crawler. Codemia's companion maps all of it. 17 topics and 14 exercises, each linked to a lesson, a problem, or a course.

So read one section, then close it, and design the matching problem on a 45 minute timer. The AI reviewer points out what your design is missing. When the exercises feel easy, move on to full mock rounds. Find the map on codemia.io/system-design-primer.

Free

open source on GitHub

17

topics mapped

14

exercises mapped

62

Codemia links

What the primer is

The primer is an open source repository by Donne Martin. It gathers the ideas behind large systems into one long, well organised guide: the trade-offs that come first, then DNS, CDNs, load balancers, databases, caches, queues and protocols, then a set of interview questions with worked solutions. It ships with Anki flashcards for spaced revision and has been translated by its community into many languages.

People like it because it is free, it is organised by concept, and it links out to the original papers and engineering posts for depth. If you are new to system design, reading it end to end is a good start. Go to the repository on GitHub for the primer itself.

Its sections, in the order the primer takes them:

  1. The first trade-offs

    Performance vs scalabilityLatency vs throughputAvailability vs consistency (CAP theorem)
  2. Consistency and availability patterns

    Consistency patternsAvailability patterns
  3. Getting traffic to your servers

    Domain name systemContent delivery networkLoad balancerReverse proxyApplication layer
  4. Data

    Database: RDBMSDatabase: NoSQLCache
  5. Asynchronism and communication

    AsynchronismCommunicationSecurity
  6. Appendix

    Powers of two and latency numbers

The primer, topic by topic

The primer's main sections in its order, by name. Next to each is where to practise or go deeper on Codemia. Lessons explain one idea with diagrams; problems open a workspace where you design the system and get AI feedback.

One request, from DNS and a CDN through a load balancer and reverse proxy to the app server, cache and database.

The first trade-offs

  1. Performance vs scalability

    What it means for a system to scale, and why a fast system can still fail to scale.

  2. Latency vs throughput

    How the two pull against each other, and which one a design should aim for.

  3. Availability vs consistency (CAP theorem)

    CP and AP choices, plus PACELC, which covers the normal case with no partition.

Consistency and availability patterns

  1. Consistency patterns

    Weak, eventual and strong consistency, and how quorums let you tune between them.

  2. Availability patterns

    Fail-over, replication, and how availability adds up across components.

Getting traffic to your servers

  1. Domain name system

    How a name becomes an address, and where caching sits on the way.

  2. Content delivery network

    Push and pull CDNs, cache keys and invalidation at the edge.

  3. Load balancer

    Algorithms, health checks, and layer 4 against layer 7.

  4. Reverse proxy

    What a proxy in front of your servers does, and how it differs from a load balancer.

  5. Application layer

    Splitting services, how they find and call each other.

Data

  1. Database: RDBMS

    Replication, federation, sharding, denormalization and query tuning.

  2. Database: NoSQL

    Key-value, document, wide column and graph stores, and when to pick SQL instead.

  3. Cache

    Where caches sit, and cache-aside, write-through, write-behind and refresh-ahead.

Asynchronism and communication

  1. Asynchronism

    Message queues, task queues and back pressure.

  2. Communication

    TCP, UDP, RPC and REST, and what each costs.

  3. Security

    Authentication between users and services, and encryption in transit.

Appendix

  1. Powers of two and latency numbers

    The reference tables, put to work in estimates that change a design.

The primer exercises, mapped

The primer works through a handful of classic interview questions with its own solutions. Read its solution first, then close it and design the matching Codemia problem from scratch, out loud and on a timer. Where Codemia has no exact match, the note says so and points at the closest practice.

Close the primer, then design the matching problem yourself on a timer.
  1. Pastebin (or Bit.ly)

    Short keys, storage for the paste, and read-heavy caching.

  2. Twitter timeline and search (or Facebook feed and search)

    Fan-out on write against fan-out on read, and an index for search.

  3. A web crawler

    The URL frontier, politeness, duplicate detection and recrawl.

  4. Mint.com

    Pulling in transactions, categorizing them and running batch jobs over them. The closest Codemia practice is a batch pipeline and a personal finance agent.

  5. The data structures for a social network

    Storing a huge graph across machines and searching paths through it.

  6. A key-value store for a search engine

    A cache for query results: eviction, sharding and keeping it warm.

  7. Amazon's sales rank by category

    Counting events at scale and keeping top-k lists fresh.

  8. A system that scales to millions of users on AWS

    Growing one server into a fleet: autoscaling, a managed database and a cache tier.

The object-oriented design questions

The primer also has a short set of object-oriented design questions. These come up in low level design rounds, and Codemia has a separate object-oriented design catalogue for them.

  1. Hash map

    Buckets, collisions and resizing.

  2. Least recently used cache

    A hash map plus a doubly linked list, as a class design and as a coding problem.

  3. Call center

    No matching Codemia problem yet; the OOD course covers the same class modelling.

  4. Deck of cards

    Modelling cards, decks and the games built on them.

  5. Parking lot

    The classic OOD question, plus a system design version.

  6. Chat server

    Users, rooms and messages as classes, then the distributed version.

What to add for a senior interview

The primer is a reference, and it does what a reference should. It even includes a short outline of how to approach an interview question. A senior or staff interview grades a few things that are hard to learn from any reference, because they only improve with practice:

  1. A framework you can run on a clock

    Knowing the steps is not the same as fitting requirements, a high level design, two deep dives and a wrap up into 45 minutes. The free System Design Interview Framework course drills that timing.

  2. Trade-offs said out loud

    Interviewers score why you chose something, and what you gave up. Practise naming the alternative every time; the lesson on talking through trade-offs shows how.

  3. Estimation that changes the design

    The latency and powers-of-two tables are inputs. The skill is turning them into a decision, such as whether a dataset fits in memory. See estimation that changes the design.

  4. Feedback on your own design

    Reading a model answer tells you what a good design looks like, not what yours is missing. On Codemia you submit your own design to a problem and the AI reviewer points out the gaps.

  5. Mock rounds

    The last step is a full spoken round with follow-up questions. The AI mock interviewer runs one and grades it against a rubric.

How to use it with Codemia

A 45 minute round: requirements, a high level design, two deep dives and a wrap up.
  1. Read one primer section

    Take one section at a time, such as caching or databases, and read it with the links it gives.
  2. Fill the gaps with a lesson

    If a part did not click, open the matching Codemia lesson from the table above.
  3. Design a problem that uses it

    Pick a mapped problem, set a 45 minute timer, and design it in the workspace without notes.
  4. Read the feedback and the editorial

    Compare what the AI flagged with the written editorial, then note the one thing you would change.
  5. Rehearse full rounds

    Once the exercises feel easy, move to the full problem catalogue and AI mock interviews. For an order to study in, see the system design roadmap.

Studying from Alex Xu's books as well? The chapter-by-chapter companion maps every chapter of both volumes to a Codemia problem.

Here is what a practice round looks like on Codemia, from picking a problem to the AI review:

Questions people ask

Frequently asked

What is the System Design Primer?

A free, open source GitHub repository by Donne Martin, donnemartin/system-design-primer, that collects the building blocks of large-scale systems in one place: scalability, consistency and availability, DNS, CDNs, load balancers, databases, caches, queues and protocols. It also has worked interview questions with solutions and Anki flashcards for revision.

Is the System Design Primer enough for a system design interview?

It is a strong base for the concepts. Most people also need to practise the interview itself: running a 45 minute design out loud, choosing what to go deep on, defending trade-offs and getting feedback on what they missed. That part needs practice problems and mock rounds, not more reading.

Is the System Design Primer still up to date?

The fundamentals it covers have not changed much, and they are what most interviews still test. Newer topics such as stream processing, vector search or LLM serving are outside its scope, so add those from other material if your role needs them.

How long does it take to go through the System Design Primer?

Reading it closely takes most people two to four weeks alongside a job. Working through the exercises and then practising each one as a timed design takes longer, and is where most of the interview benefit comes from.

System Design Primer or Alex Xu?

They suit different stages. The primer is a free reference organised by concept. Alex Xu's System Design Interview books walk through one full design per chapter. Many people read the primer for the building blocks and use the books, or a set of practice problems, for full designs.

Where can I practise the primer exercises with feedback?

Each primer exercise has a matching problem on Codemia, listed on this page. You write or draw a design in the workspace and get AI feedback on it, then read the written editorial for that problem.

Start with the first primer exercise

Design a URL shortener, the Bit.ly half of the primer's first question. It is free on Codemia, with AI feedback on your design.

Design a URL shortener