System Design
Scale, store and ship systems that stay up - and explain them in an interview.
Take this course in the learning hubLessons
- How to run a design interviewKnow the order to attack a design question in, and what the interviewer is actually grading.
- Requirements and napkin mathTurn a vague prompt into functional requirements, non-functional targets, and rough numbers.
- Scaling out behind a load balancerWhen to buy a bigger machine, when to add more of them, and what a load balancer needs from you.
- Caching that actually helpsPick the right caching pattern and the right layer, and know what a cache costs you.
- Invalidation and the CDNKeep cached data from going stale, and push static content to an edge near the user.
- SQL or NoSQLChoose a datastore from the access pattern instead of from fashion, and defend the choice.
- Indexes: from scan to seekUnderstand what an index does, when the database ignores yours, and what indexes cost on writes.
- Replication and shardingCopy data for reads and availability; split data for size and write throughput. Know which problem you have.
- Consistent hashingSee why modulo sharding breaks on resize and how a hash ring keeps almost every key where it was.
- CAP and consistency modelsSay what a distributed store gives up during a network partition, and name the consistency you need.
- Queues and async workMove slow work off the request path with a queue, and handle retries, ordering, and poison messages.
- Rate limits and idempotencyStop one client from sinking the service, and stop retries from charging a customer twice.
- Design: URL shortenerWalk a full small design end to end: key generation, storage, redirects, and the read path.
- Design: news feedCompare fan-out on write and on read, and see why real feeds use both at once.
- Observability and failureKnow when your system is broken before users tell you, and keep one slow dependency from taking it all down.
- API design and paginationShape an API that survives its own future, and page through data without OFFSET.
- What happens when you type a URLFollow one request from a hostname to HTML, and see where the milliseconds really go.
- Files, blobs and direct uploadsKeep big files out of the database and off your app servers, and serve them from the edge.
- Generating unique ids at scalePick an id scheme that stays unique across shards without wrecking your index.
- Distributed locks and leader electionMake exactly one node run a job, and see why a lock with a TTL is not safe on its own.
- Pushing updates: polling to WebSocketsChoose between polling, SSE and WebSockets, and know what an open socket costs you.
- Search and the inverted indexSee how full-text search actually works, and why a LIKE query is not a search feature.
- Bloom filters and sketchesAnswer set and count questions in kilobytes instead of gigabytes, by giving up exactness.
- Storage engines: B-tree vs LSMUnderstand why Postgres and Cassandra behave so differently on writes, reads and disk.
- Multi-region and disaster recoveryDecide what you can lose and how long you can be down, then design the failover for it.
- Safe rollouts, canaries and migrationsShip so a bad build reaches 1% of traffic, and change a schema with nobody noticing.
- Design: a chat systemAssemble the pieces: connections, ordering, delivery to offline devices, and history.
- Tail latency and why p99 becomes typicalFan out to enough services and the rare slow case happens to almost everyone.
- Estimation that holds up under questioningBack-of-envelope numbers, and the ones worth memorising.
- Backpressure: what to do when you cannot keep upEvery system has a limit; the design choice is how it behaves at that limit.
- Failure domains and blast radiusDesigning so that one failure stays one failure.
- Defending a design decisionWhat separates a senior answer from a confident one.