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

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

Distributed Systems

Production in the Cloud

Interview Walkthroughs

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.