Skip to main content

System Design Interview — Examples & Questions

Master system design interviews with 24 real-world case studies (TinyURL, Instagram, YouTube, Uber, and more) with architecture diagrams. Plus 19 foundational concepts — load balancing, caching, sharding, and more.

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 Case Studies

Medium 18 min read

Design TinyURL — URL Shortening Service

Design a URL shortening service like TinyURL that encodes long URLs into short aliases and redirects users back to the original. Covers key generation, hashing, database design, and scalability.

HashingKGSNoSQL
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 StorageKGSNoSQL
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.

CDNShardingNews 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 StorageDelta SyncMetadata
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.

WebSocketsHBaseReal-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.

TimelineFanoutSharding
Hard 24 min read

Design YouTube — Video Streaming Service

Design a video streaming platform: upload, transcode, store, and stream videos to billions of users. Covers CDN-based streaming, video deduplication, adaptive bitrate, and BLOB storage.

CDNTranscodingStreaming
Medium 18 min read

Design Typeahead Suggestion — Search Autocomplete

Design a real-time search autocomplete system that suggests the top completions as a user types. Covers trie data structures, EMA frequency weighting, distributed updates, and sub-50ms latency.

TrieEMACaching
Medium 16 min read

Design API Rate Limiter

Design a distributed rate limiter that enforces per-user or per-IP request quotas. Covers multiple algorithms (sliding window counter, token bucket, leaky bucket), Redis-based counters, and trade-offs between accuracy and memory.

Rate LimitingRedisSliding Window
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 IndexElasticsearchReal-Time Indexing
Hard 20 min read

Design Web Crawler — Internet-Scale Crawling

Design a distributed web crawler that discovers and downloads billions of web pages. Covers URL frontier management, politeness policies, deduplication with bloom filters, and distributed worker coordination.

Bloom FilterBFSURL Frontier
Hard 22 min read

Design Facebook Newsfeed

Design the Facebook News Feed: a personalized, ranked stream of posts from friends and pages. Covers fanout-on-write vs fanout-on-read, feed ranking, feed aggregation service, and caching at billion-user scale.

News FeedFanoutRanking
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.

QuadTreeGeospatialProximity 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.

QuadTreeReal-TimeLocation 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.

ConcurrencyACIDLocking
Medium 18 min read

Scale From Zero to Millions of Users

A step-by-step walkthrough of how to evolve a system from a single-server setup to one that handles millions of concurrent users — covering load balancers, database replication, caching, CDN, stateless web tiers, sharding, and message queues.

ScalabilityLoad BalancerDatabase
Medium 20 min read

Design a Rate Limiter

Rate limiters protect APIs from abuse, prevent DoS attacks, and control costs on third-party API calls. Learn five rate limiting algorithms, where to place the limiter in your architecture, and how to implement distributed rate limiting with Redis.

Rate LimitingRedisAPI Gateway
Hard 22 min read

Design a Key-Value Store

Key-value stores are the backbone of modern distributed systems. Design one from scratch — covering data partitioning with consistent hashing, replication, CAP theorem trade-offs, vector clocks for conflict resolution, gossip protocol for failure detection, and Merkle trees for anti-entropy.

Key-Value StoreCAP TheoremConsistent Hashing
Medium 12 min read

Design a Unique ID Generator in Distributed Systems

Generating unique, sortable IDs at high scale in a distributed system is harder than it sounds. Compare multi-master replication, UUIDs, ticket servers, and Twitter Snowflake — and understand why Snowflake is the standard answer.

Distributed SystemsSnowflakeID Generation
Medium 18 min read

Design a Notification System

Modern applications send tens of millions of notifications daily across push, SMS, and email channels. Design a scalable notification system that handles all three, supports opt-outs, prevents data loss, and maintains reliability through message queues and retry mechanisms.

NotificationPush NotificationMessage Queue
Hard 18 min read

Design a News Feed System

A news feed aggregates your friends' posts in real time. Design the feed publishing flow (fanout on write vs fanout on read), the retrieval architecture, caching layers, and how to handle celebrity accounts without overwhelming your infrastructure.

News FeedFanoutCache
Hard 20 min read

Design a Chat System

Real-time messaging requires persistent bidirectional connections, careful message storage, and presence management. Design a chat system supporting 1-on-1 and group chat for 50 million daily active users with WebSocket, message sync across devices, and heartbeat-based presence.

ChatWebSocketReal-time
Hard 18 min read

Design a Search Autocomplete System

Search autocomplete (typeahead) returns the top-k matching suggestions as a user types. Design the trie data structure, caching strategy, data gathering pipeline, and sharding approach to handle 48,000 queries per second with sub-100ms latency.

TrieAutocompleteTypeahead
Easy 12 min read

Back-of-the-Envelope Estimation

Estimation is a core system design interview skill. Learn to reason about scale using powers of 2, latency numbers every engineer should know, availability math, and worked examples for QPS and storage calculation.

EstimationScalabilityInterview Skills

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

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