System Design for Interviews

Welcome

The system design round decides senior offers, and it rewards a skill that is rarely taught: reasoning about a large system out loud, in 45 minutes, while someone pushes back. This course teaches that skill on the twenty problems the round actually asks, each one worked the way the round runs.

27 chapters 20 interview problems Knowledge check on every lesson ≈27 hours to complete

About This Course

A system design interview is not a test of what you know about databases. It is forty-five minutes in which an interviewer watches you turn a one-sentence question into a design, defend it, and change it when they push. Candidates who know the material still fail it, because they draw before they ask, estimate numbers that decide nothing, or answer every push with the same box.

The course has one method, and every problem chapter follows it. Scope the problem until the numbers that matter are agreed. Draw a first design that is correct at small scale, not a straw man. Then let the interviewer's probes drive every change, and say what each change costs. The last fifteen minutes are the deep dives and the curveballs, where the problem's hard parts live.

Each problem is a chapter of its own: a free overview with the question and a timer, then four lessons that follow the clock. The quiz on each first design is the interviewer's half of the conversation, the probes that the next lesson answers. Every chapter ends with how a mid-level, a senior and a staff candidate answer the same problem differently.

Who This Is For

Engineers preparing for the system design round, pitched at the senior level, where the round weighs most. You have built and run services, you know what a database index and a cache are, and you want to reason about many machines at once under questioning.

Two courses in this catalogue go deeper into the mechanisms this one uses: Computer Science Deep Dive for one machine and one network link, and Backend Deep Dive for one service built properly. Both are recommended and neither is required. Where a mechanism needs more than an interview needs, the lesson names the course that teaches it.

What You Should Already Know

  • What a web service, a relational database, an index and a cache are, and roughly what each one is for
  • Reading a simple API: a request with a method and a path, and the response that comes back
  • Arithmetic with large round numbers: seconds in a day, bytes in a terabyte, requests a second
  • Nothing about distributed systems: partitioning, replication, consistency and consensus are all built in the course

New to this? Start with Backend Deep Dive and Computer Science Deep Dive - the first chapter of every course is free, and the rest is one membership.

How the Course Is Built

The course opens with the round itself and five chapters of building blocks: scaling reads, partitioning, replication and consistency, coordination and time, and messaging and failure. Each block lesson ends on how interviewers probe it. Twenty problem chapters follow, grouped by the kind of challenge, and a closing chapter maps problems the course does not cover onto the ones it does.

Every estimate in the course uses one sheet of sourced reference numbers, so the arithmetic agrees from the first problem to the last, and every estimate is spoken one step at a time, the way you will say it in the room.

A first design that works
Every problem starts from the design a careful team would ship on day one, correct at small scale, never a straw man drawn to be torn down.
Probes drive every change
Each new box on the board answers a push the interviewer made, and each one comes with its cost said out loud.
Numbers that decide
Estimates are made only where the result changes a decision, from one shared sheet of sourced values.
Levels, not answers
No problem has one right answer to memorise. Each chapter shows how a mid-level, senior and staff candidate handle the same question.

Chapter Map

Chapter 1
The Round
What the interviewer is scoring, the four phases and their minutes, scoping and estimating out loud, the API and data before any boxes, taking a probe, and what each level shows.
Chapter 2
Scaling Reads and the Stateless Tier
Stateless copies of a service, caching at scale, when the cache hurts, read replicas and their lag, and the edge.
Chapter 3
Partitioning Data
When one machine stops being enough, range, hash and directory placement, consistent hashing, hot partitions, and choosing the partition key from the access pattern.
Chapter 4
Replication and Consistency
Leaders, followers and leaderless stores, quorums, the consistency models an interview uses, CAP and PACELC stated precisely, and concurrent writes.
Chapter 5
Coordination, Transactions and Time
Why agreement is hard, leader election and consensus, leases and fencing, clocks and ordering, transactions across partitions, and IDs without a coordinator.
Chapter 6
Messaging and Failure
Queues, logs and pub-sub, delivery semantics, backpressure and load shedding, failure across many services, and the arithmetic of nines across regions.
Chapter 7
URL Shortener
The opening problem: a read path built for a hundred clicks per link, keys handed out without one point of coordination, and the redirect code that decides whether clicks can be counted.
Chapter 8
Real-Time Leaderboard
A top ten any index can read beside a rank that costs 2 seconds to count, a sorted set that must outlive its process, and a global rank split by score because hash shards never lighten the one read that hurts.
Chapter 9
Search Autocomplete
A keystroke budget that rules out computing anything at query time, an index rebuilt on a slow path and swapped in whole, and one-letter prefixes so hot that they have to be answered before a partition ever sees them.
Chapter 10
Key-Value Store
A store told to keep answering when machines fail: choosing the quorum dials, learning who is alive with no master, handing data off while a machine is down, and deciding who resolves two writes to one key.
Chapter 11
Rate Limiter
An algorithm everyone names too early, one count shared by twenty servers inside a 5-millisecond budget, an overshoot stated as a number, and what each route does when the counter store dies.
Chapter 12
Web Crawler
A frontier that must honour priority and every host's clock at once, a seen set too big for memory under 60,000 checks a second, and an open web of endless calendars and servers that drip a byte a second.
Chapter 13
Metrics Monitoring and Alerting
Two million points a second that no table can hold, one label that multiplies what the store must remember, and a page that has to go out while the system sending it is down.
Chapter 14
Distributed Message Queue
Two hundred thousand messages a second for five groups that read at their own pace, a yes that has to outlive the broker that said it, and a fleet sized by what it keeps rather than how fast it moves.
Chapter 15
Notification System
Three providers you do not run, a campaign that would leave a sign-in code three hours back in line, and a duplicate whose price changes with the channel.
Chapter 16
Proximity Service
An index that quietly reads a strip of the planet, a downtown and a prairie in one scheme, and the nearest place sitting just across a cell's edge.
Chapter 17
News Feed
A post that costs one write or fifty million, a cached list that must hold IDs and not posts, and a feed that keeps moving while someone scrolls it.
Chapter 18
Chat
A tier that holds 20 million connections open, a number on every message that does the work real time gets the credit for, and a phone back from a day away with no queue waiting for it.
Chapter 19
Video Streaming
A sum that draws the edge before anything else, an upload that has to survive a dropped connection, encoding tasks that may run twice, and a long tail that costs far more per hour watched than any hit.
Chapter 20
File Sync
A one-byte edit that must not resend two gigabytes, thirty million devices that should stop asking, and two offline edits that only a person can settle.
Chapter 21
Ad-Click Aggregation
Two numbers from one record, a fast one for the chart and a right one for the invoice; a click that arrives after its minute has gone out; and a crash that must not count half a minute twice.
Chapter 22
Object Storage
A durability target worked as a sum, where the cheaper code turns out safer until a zone fails; metadata kept apart from the bytes and split by range; and objects at both extremes, ten kilobytes and fifty terabytes.
Chapter 23
Hotel Reservation
A last room two guests press for in the same millisecond, a run of nights held across a card payment, and a hundred searches per booking on a copy that may be wrong while the booking may not.
Chapter 24
Payment System
A charge whose outcome nobody knows after a timeout, a ledger that has to explain any balance line by line, and a daily file from an outside party who holds half the truth.
Chapter 25
Digital Wallet
A transfer whose two sides live on two shards and must never be seen half done, a balance an auditor can rebuild for any past moment, and a running proof that no money was created or destroyed.
Chapter 26
RAG Chatbot
An answer that may never draw on a document its asker cannot open, an index that has to forget a deleted policy within minutes, and a rented model whose time, price and ceiling set the morning peak.
Chapter 27
After the Book
A plan built on timed, spoken attempts and one log, the five moves that lose a round and how to catch them in your attempts, seven questions mapped onto the twenty, and the course that owns each mechanism this book left as a box.

Disclaimer

This course is an independent educational project created and maintained by Sergey Okinchuk. It is provided for learning and reference purposes only.

No affiliation. This course is not affiliated with, sponsored by, endorsed by, or officially connected to any company, product, book or interview-preparation service mentioned. All opinions, interpretations, and recommendations expressed are the author's own.

Trademarks. Product and company names referenced are the property of their respective owners. Use of these names is for identification and educational purposes only and does not imply any endorsement.

Not a guarantee. Interview formats differ between companies and change over time. This material teaches a way of reasoning about systems under questioning; it does not promise any interview outcome. Reference numbers are orders of magnitude from cited sources, not measurements of any particular system.

No warranty. This material is provided "as is" without warranty of any kind. The author accepts no liability for any loss or damage arising from reliance on the content.