Skip to main content

System Design Interview — Examples & Questions

Master system design interviews with all 28 complete architectural chapters from the System Design Notes guide (complete with all 392 diagrams), plus 9 classic FAANG case studies and 19 distributed systems building blocks.

How to Approach Any System Design Question

  1. 1 Clarify requirements — functional and non-functional (scale, latency, consistency)
  2. 2 Estimate scale — daily active users, requests per second, storage needs
  3. 3 Design high-level architecture — components and data flow
  4. 4 Deep-dive into bottleneck components — DB schema, caching, sharding strategy
  5. 5 Discuss trade-offs — SQL vs NoSQL, push vs pull, consistency vs availability
  6. 6 Identify and address failure modes — what happens when X goes down?

System Design Chapters (All 28 Chapters)

Complete, chapter-by-chapter architectural breakdowns with all 392 system diagrams, algorithms, and deep dives.

28 Chapters Available
Chapter 01 Medium
22 min read

Chapter 1: Scale From Zero to Millions of Users

A comprehensive, step-by-step architectural guide to evolving a web application from a single server to a globally distributed, highly available system serving millions of users.

Scalability Load Balancer Database Replication
Chapter 02 Medium
15 min read

Chapter 2: Back-of-the-Envelope Estimation

Master quick, high-precision back-of-the-envelope calculations for system design interviews: powers of two, latency benchmarks, availability nines, and Twitter QPS estimates.

Estimation QPS Latency
Chapter 03 Medium
16 min read

Chapter 3: A Framework for System Design Interviews

The battle-tested 4-step framework to ace any 45-minute system design interview: clarifying requirements, high-level architecture, deep dive bottlenecks, and wrap-up.

Interview Framework Scope High-Level Design
Chapter 04 Medium
20 min read

Chapter 4: Design a Rate Limiter

Design a distributed API rate limiter to protect services from DoS attacks and traffic spikes. Covers Token Bucket, Leaking Bucket, Sliding Window Log, and Redis clustering.

Rate Limiting Token Bucket Leaky Bucket
Chapter 05 Medium
18 min read

Chapter 5: Design Consistent Hashing

Deep dive into consistent hashing to solve data skew and hotkey issues. Covers hash ring topologies, server lookups, node additions/removals, and virtual node balancing.

Consistent Hashing Hash Ring Virtual Nodes
Chapter 06 Hard
26 min read

Chapter 6: Design a Key-Value Store

Architect a highly available, fault-tolerant distributed key-value store with tunable consistency, quorum replication, vector clocks, SSTables, LSM trees, and gossip protocols.

Key-Value Store CAP Theorem Quorum Consensus
Chapter 07 Medium
16 min read

Chapter 7: Design a Unique ID Generator in Distributed Systems

Design an ultra-fast, 64-bit unique ID generator that scales to tens of thousands of IDs per second without database bottlenecks. Covers Snowflake, UUID, and Ticket Servers.

Unique ID Twitter Snowflake UUID
Chapter 08 Medium
18 min read

Chapter 8: Design a URL Shortener (TinyURL)

Design a high-scale URL shortening service like TinyURL or Bitly. Covers Base62 encoding, hash collision resolution, 301 vs 302 redirects, DB schema, and edge caching.

URL Shortening Base62 Encoding Hash Collisions
Chapter 09 Hard
24 min read

Chapter 9: Design a Web Crawler

Architect an internet-scale distributed web crawler capable of crawling billions of web pages. Covers URL frontier, politeness, Bloom filter deduplication, and streaming storage.

Web Crawler BFS Robots.txt
Chapter 10 Medium
20 min read

Chapter 10: Design a Notification System

Design a scalable notification engine that sends millions of push notifications, SMS alerts, and emails daily with deduplication, template rendering, and retry queues.

Notifications APNS FCM
Chapter 11 Medium
22 min read

Chapter 11: Design a News Feed System

Design a social media news feed system. Deep dive into Fan-out-on-Write (push) vs Fan-out-on-Read (pull), celebrity hotkeys, hybrid feed generation, and multi-tiered caching.

News Feed Fan-out on Write Fan-out on Read
Chapter 12 Hard
28 min read

Chapter 12: Design a Chat System

Architect a 1-on-1 and group chat system serving millions of concurrent connections. Covers WebSockets, presence servers, message sequence IDs, and multi-device synchronization.

WebSocket HTTP Long-Polling Presence Servers
Chapter 13 Medium
20 min read

Chapter 13: Design a Search Autocomplete System

Design real-time search typeahead suggestion system returning top 5 suggestions under 100ms. Covers Trie serialization, frequency aggregation, sampling, and browser caching.

Trie Data Structure Autocomplete Typeahead
Chapter 14 Hard
26 min read

Chapter 14: Design YouTube

Design a planetary-scale video upload and streaming platform. Covers video transcoding DAGs, adaptive bitrate streaming (HLS/DASH), geo-distributed CDN caching, and presigned URLs.

Video Streaming MPEG-DASH HLS
Chapter 15 Hard
25 min read

Chapter 15: Design Google Drive

Architect a cloud storage and multi-device synchronization service like Google Drive. Covers block-level chunking, delta sync, content-addressable storage, and strong consistency.

Cloud Storage Block Storage Delta Sync
Chapter 16 Medium
24 min read

Chapter 16: Proximity Service

Design a proximity search service discovering nearby points of interest (restaurants, hotels). Explores 2D spatial indexing, Geohash precision boundaries, and Quadtrees.

Geohash Quadtree Spatial Index
Chapter 17 Hard
26 min read

Chapter 17: Nearby Friends

Architect real-time proximity friend finder updating locations every few seconds. Covers WebSocket connections, Redis Pub/Sub channels, location caching, and battery efficiency.

Location Tracking WebSocket Redis Pub/Sub
Chapter 18 Hard
30 min read

Chapter 18: Design Google Maps

Design global map navigation and routing engine. Covers vector tile hierarchies, shortest-path road algorithms (Dijkstra/A*), real-time traffic overlay, and adaptive rerouting.

Routing Algorithm A* Search Map Tiles
Chapter 19 Hard
32 min read

Chapter 19: Distributed Message Queue

Architect a high-throughput distributed commit log message queue. Covers partitions, zero-copy network transfer (sendfile), consumer group rebalancing, and replication protocols.

Message Queue Apache Kafka Commit Log
Chapter 20 Hard
28 min read

Chapter 20: Metrics Monitoring and Alerting System

Architect real-time infrastructure monitoring platform tracking billions of telemetry metrics daily. Covers time-series database design, push vs pull collection, and alert evaluation.

Prometheus Time-Series DB OpenTSDB
Chapter 21 Hard
30 min read

Chapter 21: Ad Click Event Aggregation

Design real-time advertising analytics platform aggregating ad clicks with exactly-once processing, tumbling window rollups, out-of-order event watermarking, and click fraud filtering.

Stream Processing Apache Flink Kafka
Chapter 22 Medium
24 min read

Chapter 22: Hotel Reservation System

Architect reservation engine preventing double-booking under concurrency. Covers optimistic vs pessimistic locking, 2-phase commits, inventory countdowns, and reconciliation.

Hotel Booking Double Booking Prevention Optimistic Locking
Chapter 23 Hard
28 min read

Chapter 23: Distributed Email Service (Gmail)

Design internet-scale email service like Gmail. Covers SMTP/IMAP protocol handlers, distributed mail storage, spam/virus filtering pipelines, and real-time full-text inbox search.

SMTP IMAP POP3
Chapter 24 Hard
32 min read

Chapter 24: S3-like Object Storage

Design highly durable object storage system (11 nines durability). Covers block data nodes, erasure coding vs replication, multipart uploads, and lifecycle garbage collection.

Object Storage AWS S3 Erasure Coding
Chapter 25 Medium
22 min read

Chapter 25: Real-time Gaming Leaderboard

Architect real-time gaming leaderboard serving millions of active players. Covers Redis Sorted Sets (ZADD/ZRANK), skip lists, distributed score sharding, and periodic archive snapshots.

Gaming Leaderboard Redis Sorted Set Skip List
Chapter 26 Hard
28 min read

Chapter 26: Payment System

Design reliable, audit-compliant financial payment processing system. Covers idempotency keys, payment status state machines, double-entry ledgers, and automated reconciliation.

Payment Gateway Idempotency Double-Entry Accounting
Chapter 27 Hard
30 min read

Chapter 27: Digital Wallet

Architect digital wallet handling millions of balance transfers per second. Covers in-memory ledgers, distributed transactional patterns (2PC, TCC, Saga), and Raft replication.

Digital Wallet Distributed Transactions TC/C Pattern
Chapter 28 Hard
34 min read

Chapter 28: Stock Exchange

Design ultra-low latency stock exchange order matching engine. Covers Limit Order Books, price-time priority matching, sequence order logs, and LMAX Disruptor memory ring buffers.

Stock Exchange Order Matching Engine Limit Order Book

Additional FAANG Case Studies (9 Cases)

Classic production interview scenarios asked at Meta, Uber, Twitter, and Dropbox.

Medium 16 min read

Design Pastebin — Text Paste Service

Design a Pastebin-like service where users upload plain text and receive a unique URL to share it. Covers key generation, object storage, metadata database, expiry, caching, and horizontal scaling.

Object Storage KGS NoSQL
Hard 20 min read

Design Instagram — Photo Sharing Service

Design a photo-sharing social network like Instagram: users upload photos, follow others, and see a personalized news feed. Covers media storage, CDN, news feed generation, and database sharding.

CDN Sharding News Feed
Hard 22 min read

Design Dropbox — Cloud File Storage

Design a cloud file storage service like Dropbox that syncs files across devices, handles large file uploads efficiently via chunking, and maintains version history. Covers block servers, delta sync, and metadata management.

Block Storage Delta Sync Metadata
Hard 20 min read

Design Facebook Messenger — Real-Time Chat

Design a real-time messaging system like Facebook Messenger. Covers WebSocket-based real-time delivery, message storage in HBase, chat threading, and read receipts at massive scale.

WebSockets HBase Real-Time
Hard 22 min read

Design Twitter — Social Network and Microblogging

Design Twitter: tweet posting, following, home timeline, trending topics, and search. Covers fanout-on-write vs read strategies, timeline caching, and sharding at 200M daily active users.

Timeline Fanout Sharding
Hard 18 min read

Design Twitter Search — Real-Time Tweet Search

Design a system that indexes and searches 500M tweets per day in near real-time. Covers distributed inverted indexes, dynamic indexing for freshness, and efficient storage of tweet search data.

Inverted Index Elasticsearch Real-Time Indexing
Hard 18 min read

Design Yelp — Proximity Search Service

Design a service that finds nearby places of interest (restaurants, businesses). Covers QuadTree-based spatial indexing, dynamic grid partitioning, and efficient radius search with ranking.

QuadTree Geospatial Proximity Search
Hard 20 min read

Design Uber — Ride-Sharing Service

Design a ride-sharing service like Uber: real-time driver tracking, ride matching, surge pricing, and route calculation. Covers the DriverLocationHT for sub-second location updates and QuadTree for proximity matching.

QuadTree Real-Time Location Tracking
Hard 22 min read

Design Ticketmaster — Event Ticketing System

Design a high-concurrency event ticketing system that prevents double-booking. Covers the ActiveReservationsService with LinkedHashMap, SERIALIZABLE transactions, and in-memory seat locking to handle flash sale traffic.

Concurrency ACID Locking

Foundational Concepts

Master these building blocks before tackling case studies.

Key Characteristics of Distributed Systems

The foundational properties every distributed system must balance: scalability, reliability, availability, efficiency, and manageability. Understand these before diving into any system design interview.

14 min
Load Balancing — Distributing Traffic Across Servers

Load balancers distribute incoming requests across server pools to maximize throughput, minimize latency, and avoid overloading any single server. Covers algorithms, health checks, layer 4 vs layer 7, and session persistence.

14 min
Caching — Speed Up Reads with In-Memory Storage

Caching stores the results of expensive operations in fast in-memory storage so subsequent requests are served instantly. Covers cache-aside, write-through, eviction policies (LRU), cache stampede prevention, and CDN caching.

16 min
Data Sharding — Horizontal Database Partitioning

Sharding splits a large database into smaller, independently managed pieces (shards) spread across multiple servers. Covers horizontal vs vertical partitioning, consistent hashing, and common sharding problems.

16 min
Database Indexes — Speeding Up Reads

Indexes are data structures that allow the database to find rows without scanning the entire table. Covers B-tree indexes, composite indexes, write overhead, and when NOT to index.

12 min
Proxies — Forward and Reverse Proxies

Proxies sit between clients and servers to add filtering, caching, logging, SSL termination, and anonymity. Covers forward proxies, reverse proxies, and open proxies.

10 min
Redundancy and Replication

Redundancy eliminates single points of failure by having multiple copies of components. Replication keeps those copies in sync. Covers primary-replica replication, synchronous vs asynchronous, and multi-master.

12 min
SQL vs NoSQL — Choosing the Right Database

SQL databases offer ACID guarantees and rich query capabilities. NoSQL databases sacrifice some consistency for horizontal scalability and schema flexibility. Know when to use each.

14 min
CAP Theorem — Consistency, Availability, Partition Tolerance

The CAP Theorem states that a distributed system can provide at most two of three guarantees: Consistency, Availability, and Partition Tolerance. Every distributed database is a CAP trade-off.

12 min
Consistent Hashing — Minimal Resharding for Distributed Systems

Consistent hashing distributes keys across servers such that adding or removing a server remaps only K/N keys (where K is keys and N is servers) — not all keys. Essential for distributed caches and databases.

14 min
Long-Polling, WebSockets, and Server-Sent Events

Three techniques for pushing data from server to client in real time: long-polling (oldest), Server-Sent Events (unidirectional push), and WebSockets (full-duplex bidirectional). Know when to use each.

12 min
Performance vs Scalability

Understand the critical difference between a system that is slow for everyone versus one that breaks under load. Learn how to design for both performance and scalability from the start.

7 min
Latency vs Throughput

Two fundamental performance metrics that every system designer must understand: how fast a single request completes (latency) and how many requests the system handles per second (throughput).

7 min
Availability Patterns — Failover and Replication

High availability requires two complementary strategies: failover (detecting failure and switching to a backup) and replication (keeping backup copies of data and services ready). Learn active-passive vs active-active failover and how to measure the nines.

10 min
Domain Name System (DNS)

DNS translates human-readable domain names into IP addresses. Understanding DNS hierarchy, record types, TTLs, and routing strategies is fundamental to designing globally distributed, highly available systems.

8 min
Content Delivery Networks (CDN)

A CDN caches content at globally distributed edge nodes, reducing latency for users worldwide and offloading traffic from your origin servers. Learn how CDNs work, when to use push vs pull, and how to design around CDN limitations.

9 min
Reverse Proxy and Load Balancer Patterns

A reverse proxy sits in front of your servers, handling SSL termination, caching, compression, and request routing. Understand how reverse proxies differ from load balancers and when to use each.

8 min
Microservices and Service Discovery

Microservices decompose a monolith into small, independently deployable services. Learn when microservices make sense, how services find each other via service discovery, and the key tradeoffs of distributed service architectures.

10 min
Asynchronism — Message Queues and Task Queues

Asynchronous processing decouples the request-response cycle from expensive work, enabling higher throughput, better fault tolerance, and smoother user experiences under load. Learn message queues, task queues, and back pressure.

10 min

Seminal Engineering Papers & Production Deep Dives

Foundational whitepapers and production engineering blogs referenced throughout these 28 chapters.

Frequently Asked Questions

What is system design in a software engineering interview?

System design interviews test your ability to design large-scale distributed systems. You are given an open-ended problem (e.g., "design Twitter") and must architect a scalable, reliable solution covering components like load balancers, databases, caches, message queues, and CDNs.

How do I prepare for system design interviews?

Study the foundational concepts (load balancing, caching, sharding, replication, CAP theorem, consistent hashing) then practice designing real systems (TinyURL, Twitter, YouTube, Uber). Use a structured approach: clarify requirements, estimate scale, design the high-level architecture, dive into components, and discuss trade-offs.

What companies ask system design questions?

System design interviews are standard at FAANG companies (Google, Amazon, Meta, Apple, Netflix) and most mid-to-large tech companies. They typically start for senior software engineer roles and above, though some companies ask them for mid-level engineers too.

What is the difference between vertical and horizontal scaling?

Vertical scaling (scale up) means adding more resources to a single server — more CPU, RAM, or disk. It has a hard limit and creates a single point of failure. Horizontal scaling (scale out) means adding more servers. It is more resilient but requires distributed systems techniques like load balancing and sharding.

Buy me a coffee
Daily Practice
0/0