System Design
How apps serve millions: load balancers, caches, databases and queues, then build each design on AWS, Azure or Google Cloud. With interview walkthroughs.
49 lessons, 31 of them free.
Foundations
- What Is System Design?: How big apps are built, and the 7-step framework for every interview.
- 10,000 users at once: what really happens: Follow a crowd of 10,000 users into a website and add, one layer at a time, everything that keeps it standing.
- How to Approach a System Design Interview: Run any system design interview with a repeatable 7-step plan, a 45-minute clock and quick capacity math.
- How the Internet Works: DNS, HTTP, TCP: What actually happens when you type google.com and press Enter.
- API Design: REST, GraphQL, gRPC: How apps talk to servers, and how to design clean endpoints.
Cloud Building Blocks
- AWS Fundamentals: Regions, AZs & IAM: Know where your AWS resources physically live, how to survive a data center failure, and how IAM decides who may do what.
- Compute on AWS: EC2, Lambda, ECS/Fargate, EKS: Pick the right way to run code on AWS and explain how Auto Scaling adds and removes servers as traffic changes.
- Storage: S3, EBS & EFS: Choose between block, file and object storage, and use S3 well: keys, storage classes, lifecycle rules, versioning and presigned URLs.
- VPC Networking: Design a VPC with public and private subnets, route tables, NAT and firewalls, and trace exactly why a packet is allowed or dropped.
- Serverless on AWS: Build an API with API Gateway, Lambda and DynamoDB, orchestrate work with EventBridge and Step Functions, and judge when serverless is the right call.
Scaling & Data
- Scaling & Load Balancers: Bigger machine vs more machines, and how traffic gets shared.
- Caching (Redis & CDN): Keep popular answers close by so you don't recompute them.
- Databases: SQL, NoSQL, Sharding: Pick the right database and split data when it gets too big.
- Choosing a Database on AWS: Pick the right AWS database (RDS, Aurora, DynamoDB, ElastiCache, DocumentDB, Neptune, OpenSearch, Redshift, Timestream) from the access pattern, consistency need and scale.
- DynamoDB Data Modeling: Design DynamoDB partition and sort keys from your access patterns, use single-table design and GSIs, and avoid hot partitions.
- Consistent Hashing: Spread data over servers so adding a server only moves a little data.
Distributed Systems
- CAP, PACELC & Consistency: Explain CAP with a real partition, use PACELC for the everyday latency trade-off, pick a consistency level, and reason with quorums (R + W > N).
- Replication, Failover & Sharding: Compare leader-follower, multi-leader and leaderless replication, explain failover and leader election (Raft intuition), and shard data by range or hash without painful rebalancing.
- Monolith vs Microservices: One big app or many small ones? Trade-offs every architect argues about.
- Message Queues & Rate Limiting: Do slow work later, and stop any one user from flooding you.
- Event-Driven Architecture: SQS, SNS, EventBridge & Kinesis: Choose between queues, pub/sub, an event bus and streams on AWS, and build consumers that survive retries, poison messages and duplicate delivery.
Production in the Cloud
- Reliability: SLOs, Retries & Circuit Breakers: Keep systems up when parts fail, and measure 'up' properly.
- Observability: Logs, Metrics & Traces: Use logs, metrics and traces on AWS (CloudWatch, Logs Insights, X-Ray / OpenTelemetry), define SLIs with percentiles instead of averages, and build M-out-of-N alarms that page only when it matters.
- Security: Auth, Encryption & Least Privilege: Explain who can call your API and what they may touch: Cognito logins, JWTs checked by API Gateway, IAM roles, KMS encryption and WAF, and validate a token's claims yourself.
- AWS Well-Architected & Cost Optimization (Pro): Review any AWS design against the six Well-Architected pillars with one concrete check each, pull the right cost levers, and compute the cheapest commitment level for a usage profile.
- Choosing a Cloud: AWS vs GCP vs Azure vs Open Source: The same building blocks with different names, and how to pick.
Interview Walkthroughs
- Interview Walkthrough: URL Shortener (Pro): Put it all together: design bit.ly with the 7-step framework.
- Interview Walkthrough: Design WhatsApp (Pro): Real-time messaging for a billion users, step by step with the 7-step framework.
- Interview Walkthrough: News Feed (Instagram/X) on AWS (Pro): Design a home feed for hundreds of millions of users on AWS: estimates, APIs, data model, fan-out on write vs read, the hybrid for celebrities, ranking and caching, and code the k-way merge that builds a page of the feed.
- Interview Walkthrough: Ride Sharing (Uber) on AWS (Pro): Design an Uber-style system on AWS: stream driver locations through Kinesis, index them by geohash cells in ElastiCache, search nearby drivers ring by ring, match without double-booking, and run the trip as a state machine.
- Interview Walkthrough: Video Streaming (YouTube/Netflix) on AWS (Pro): Design a YouTube/Netflix-style service on AWS: presigned uploads to S3, MediaConvert transcoding into an HLS/DASH bitrate ladder, CloudFront delivery, adaptive bitrate on the client, metadata and view counts, and the egress bill. Then write the player's rendition picker.
Low-Level Design
- Low-Level Design: How to Approach the Round: Turn a short brief like 'design a shopping cart with coupons' into clean, working classes: requirements, entities, relationships, APIs and the few design patterns that matter (Strategy, Factory, Observer, State), and know what the interviewer is grading.
- LLD: Design a Parking Lot: Design and code the most asked machine-coding problem: spots of different sizes, a fair rule for picking a spot, tickets, hourly fees with a pricing strategy, and the follow-ups interviewers love (floors, EV spots, many gates at once).
- LLD: Design an Elevator System: Model an elevator as a state machine (idle, moving, doors open) with the State pattern, plug in a scheduling strategy (LOOK, the classic 'keep going while there is work ahead'), and code a tick-by-tick simulation that an interviewer can test.
- LLD: Design a Rate Limiter (Classes and Strategies): Write the classes behind a rate limiter: fixed window, sliding log and token bucket as interchangeable strategies, a factory that gives each user their own limiter, and a clear answer to 'what happens when two threads call allow() at once?'.
- LLD: Design Splitwise (Expense Sharing): Design an expense-sharing app: equal, exact and percent splits as strategies, one net balance per person instead of a tangle of IOUs, rounding that never loses a rupee, and a 'settle up' that turns many debts into a few payments.
- LLD: Design Movie Ticket Booking (BookMyShow): Design the booking core of a BookMyShow-style app: shows and seat maps, all-or-nothing seat holds that expire, confirm and release, a swappable SeatLockProvider, and exactly why two people can never end up with the same seat even when they click at the same moment.
Advanced: Distributed Systems Deep Dive
- Consensus & Leader Election (Raft, Leases, Fencing) (Pro): Explain how a cluster agrees on one leader and one history even when machines crash and messages get lost: Raft terms, votes and quorum commits, plus leases and fencing tokens for everything else.
- Distributed Transactions: 2PC, Sagas & the Outbox (Pro): Keep data consistent when one business action touches several services: why two-phase commit blocks, how sagas undo work with compensations, and how the outbox and idempotency keys make retries safe.
- Clocks, Unique IDs & CRDTs (Pro): Order events across machines without trusting wall clocks: Lamport and vector clocks, IDs that need no coordinator, and CRDTs that merge concurrent updates without losing any.
- Stream Processing: Partitions, Offsets, Windows & Watermarks (Pro): Design pipelines that process endless event streams: partitioned logs, consumer groups and offsets, at-least-once versus exactly-once, event-time windows with watermarks, and back-pressure.
Advanced: Planet-Scale Systems
- Multi-Region Disaster Recovery (Pro): Turn RPO and RTO targets into the cheapest DR strategy that meets them, choose how data replicates between regions, and fail over and back without split brain.
- Search Systems: Inverted Indexes at Scale (Pro): Build an inverted index with a real analyzer, answer AND queries by intersecting posting lists, rank with BM25 ideas, and design a sharded, near-real-time search service with autocomplete.
- Data Lakes, Warehouses & Lakehouses (Pro): Separate OLTP from OLAP, choose between a lake, a warehouse and a lakehouse, and cut query cost with columnar files, partitioning and table formats like Apache Iceberg.
Advanced Walkthroughs
- Advanced Walkthrough: A Dynamo-style Key-Value Store (Pro): Design a key-value store that never refuses a write: consistent hashing with virtual nodes, N/R/W quorums, versions, hinted handoff, read repair and Merkle-tree anti-entropy, and code the replica picker that sits at its heart.
- Advanced Walkthrough: A Payment System (Pro): Design a payment system that never charges twice and never loses a cent: idempotency keys, a payment state machine, a double-entry ledger, safe retries against external card processors, and nightly reconciliation, then code an idempotent ledger.
- Advanced Walkthrough: A Collaborative Editor (Google Docs) (Pro): Design real-time collaborative editing: WebSocket sessions, one ordering server per document, operational transformation vs CRDTs, presence, snapshots plus an op log, and offline edits, then code the server's transform loop.
- Advanced Walkthrough: A Web Crawler (Pro): Design a crawler that fetches a billion pages a month without hammering any website: the URL frontier, per-host politeness, robots.txt, URL and content dedup, distributed workers and recrawl scheduling, then code the polite frontier.
- Advanced Walkthrough: Ticket Booking (Ticketmaster) (Pro): Design ticket sales for a stadium on-sale where millions chase thousands of seats: seat holds with a timeout, optimistic vs pessimistic locking, conditional writes that make double booking impossible, and a virtual waiting room, then code the hold-and-book rules.