🌍 System Design · subject

System Design System Design Interview Practice Syllabus

The System Design Interview Practice syllabus for System Design in full: 7 chapters and 23 topics, every one listed below, plus 50 System Design Interview Practice flashcards with answers.

7Chapters
23Topics
50Flashcards

System Design Interview Practice syllabus: all 7 chapters

Expand any chapter to see its topics and sub-topics.

  1. The Interview Framework

    4 topics
    • Clarifying Requirements and Scope
    • Functional and Non-Functional Requirements
    • High-Level Design and API Contracts
    • Deep Dive, Bottlenecks, and Trade-offs
  2. Designing Social and Feed Systems

    3 topics
    • Design a News Feed (Facebook, Twitter)
    • Design a Social Network Graph
    • Design Instagram
  3. Designing Communication Systems

    3 topics
    • Design a Chat System (WhatsApp, Messenger)
    • Design a Notification Service
    • Design a Video Conferencing System
  4. Designing Storage and Sharing Systems

    3 topics
    • Design a URL Shortener (TinyURL)
    • Design a Pastebin
    • Design a File Storage Service (Dropbox, Google Drive)
  5. Designing Media and Streaming Systems

    3 topics
    • Design a Video Streaming Platform (YouTube, Netflix)
    • Design a Web Crawler
    • Design a Search Autocomplete System
  6. Designing Location and Marketplace Systems

    3 topics
    • Design a Ride-Sharing Service (Uber, Lyft)
    • Design a Proximity Service (Yelp, Nearby)
    • Design a Hotel or Ticket Booking System
  7. Designing High-Throughput Systems

    4 topics
    • Design a Rate Limiter
    • Design a Distributed Job Scheduler
    • Design an Ad Click Aggregator
    • Design a Payment System

System Design System Design Interview Practice flashcards — 50 questions with answers

  1. What are the four main phases of a typical system design interview?

    1) Clarify requirements and scope, 2) Estimate scale (back-of-envelope) and define functional/non-functional requirements, 3) High-level design with API contracts and data model, 4) Deep dive into components, bottlenecks, and trade-offs.

  2. In the requirements-clarification phase, what is the difference between functional and non-functional requirements?

    Functional requirements describe WHAT the system does (features, behaviors, e.g. 'user can post a tweet'). Non-functional requirements describe HOW WELL it does it (scalability, availability, latency, consistency, durability, cost).

  3. List the key non-functional requirements (NFRs) a candidate should always consider.

    Scalability, availability, latency/performance, consistency, durability, reliability/fault-tolerance, security, and cost/maintainability.

  4. Give the standard capacity-estimation formula for converting a daily active user count to average requests per second (QPS).

    $$\text{QPS}_{\text{avg}} = \frac{\text{DAU} \times \text{actions per user per day}}{86400}$$ since one day has $86400$ seconds.

  5. How do you estimate peak QPS from average QPS in capacity planning?

    Multiply by a peak factor, commonly $2\times$ to $10\times$: $$\text{QPS}_{\text{peak}} \approx (2\text{ to }10) \times \text{QPS}_{\text{avg}}$$

  6. State the CAP theorem and its practical implication for distributed system design.

    CAP theorem: a distributed system can guarantee at most two of Consistency, Availability, and Partition tolerance. Since network partitions are unavoidable, in practice you choose between CP (consistency) and AP (availability) during a partition.

  7. What is the difference between strong consistency and eventual consistency?

    Strong consistency: every read returns the most recent write (all replicas agree immediately). Eventual consistency: replicas may diverge temporarily but converge to the same value if no new writes occur; reads may return stale data.

  8. Define latency vs. throughput and give their typical units.

    Latency is the time to service a single request (units: ms). Throughput is the number of requests processed per unit time (units: QPS or requests/s). Optimizing one can trade off the other.

  9. What are the two main content-delivery strategies for a news feed, and their trade-off?

    Fan-out on write (push): precompute each user's feed at post time — fast reads, expensive writes for high-follower users. Fan-out on read (pull): assemble feed at read time — cheap writes, slower reads. Hybrid: push for normal users, pull for celebrities.

  10. In a news feed, why is a pure fan-out-on-write model problematic for celebrity accounts (the 'hotkey' problem)?

    A celebrity with millions of followers triggers millions of feed writes per post, causing write amplification and hotspots. The hybrid solution pushes to normal followers but pulls celebrity posts at read time.

  11. What data structure and store are commonly used to hold a user's precomputed news feed for fast retrieval?

    A Redis (in-memory) list or sorted set keyed by user ID, storing recent post IDs (not full posts), typically capped to a fixed length (e.g. the latest ~500-800 IDs).

  12. How is a social network's friendship/follow relationship best modeled and stored at scale?

    As a graph: nodes = users, edges = relationships. Stored in adjacency-list form (followers and following lists), often in a wide-column store or a dedicated graph database; sharded by user ID. Edges may be directed (follow) or undirected (friendship).

  13. For a social graph, how do you compute 'friends of friends' or degrees of separation efficiently?

    Use breadth-first search (BFS) over the adjacency lists. Degree of separation = BFS depth. For large graphs, bidirectional BFS from both endpoints reduces the search space from $O(b^d)$ to roughly $O(b^{d/2})$.

  14. In Instagram's design, why are images stored in object/blob storage rather than a relational database?

    Blob/object stores (e.g. S3) are optimized for large binary files, offer cheap durable storage and CDN integration, while the database stores only metadata (photo ID, URL, owner, captions). This separates heavy media from queryable metadata.

  15. What is the role of a CDN in serving photos/videos, and what metric does it optimize?

    A CDN caches static media at edge locations close to users, reducing latency and origin load. It optimizes read latency and offloads bandwidth from origin servers, improving cache-hit ratio for popular content.

  16. In Instagram, how do you generate globally unique, roughly time-sortable photo IDs across shards?

    Use a distributed ID generator like Snowflake: a 64-bit ID composed of a timestamp, a machine/worker ID, and a per-ms sequence number. This yields unique, monotonically increasing (time-sortable) IDs without a central bottleneck.

  17. What protocol is typically used to maintain a persistent connection for real-time chat message delivery?

    WebSocket (a full-duplex, persistent TCP connection). It allows the server to push messages to online clients without polling; long-polling is a fallback.

  18. In a chat system, how are messages delivered to an offline recipient?

    They are stored in a persistent message/inbox store (message queue or DB per user). When the recipient reconnects, the server pushes queued messages; a sync/pull retrieves anything missed. Delivery/read receipts track state.

  19. What database characteristics suit a chat system's message storage, and why?

    A write-heavy, horizontally scalable store like a wide-column DB (e.g. Cassandra/HBase) partitioned by (user or channel ID) with messages ordered by timestamp/message ID. It supports high write throughput and range scans of recent messages.

  20. How does a service track which server holds a user's active WebSocket connection in a distributed chat system?

    A presence/session service maps user ID → connection-server ID (stored in a fast store like Redis). To route a message, the sender's server looks up the recipient's server and forwards the message, often via a message queue or pub/sub.

Show the other 30 System Design Interview Practice flashcards
  1. What are the core components of a notification service supporting push, SMS, and email?

    1) Notification producers/API, 2) a message queue for buffering and decoupling, 3) notification workers/dispatchers, 4) third-party channel adapters (APNs/FCM for push, SMS gateway, email/SMTP provider), plus a template service and rate limiter.

  2. Why is a message queue essential in a notification service?

    It decouples producers from senders, absorbs traffic spikes (buffering), enables retries with backoff for failed deliveries, and allows independent scaling of workers. It also supports at-least-once delivery with idempotency keys to avoid duplicates.

  3. How do you prevent sending duplicate notifications when using at-least-once delivery?

    Attach a unique idempotency/dedup key to each notification and store recently sent keys (e.g. in a cache/DB). Before sending, check whether the key was already processed; skip if so.

  4. What real-time transport protocol underlies most video conferencing systems, and why not TCP?

    WebRTC using RTP/UDP. UDP is preferred over TCP because low latency matters more than perfect reliability — retransmitting late audio/video is worse than dropping it. WebRTC adds NAT traversal (STUN/TURN) and congestion control.

  5. Compare SFU and MCU architectures for multi-party video conferencing.

    SFU (Selective Forwarding Unit): each client sends one stream; the server forwards streams to others without decoding — low server CPU, higher client bandwidth. MCU (Multipoint Control Unit): server mixes all streams into one composite — high server CPU, low client bandwidth. SFU scales better for large calls.

  6. What are STUN and TURN servers used for in WebRTC?

    STUN helps a client discover its public IP/port for NAT traversal to establish a direct peer connection. TURN relays media through a server when a direct peer-to-peer connection fails (symmetric NAT/firewall), at the cost of extra latency and bandwidth.

  7. In a URL shortener, how many characters are needed with a base-62 encoding to represent a given number of URLs?

    With base-62 (a-z, A-Z, 0-9), $n$ characters encode $62^{n}$ URLs. For example $62^{7} \approx 3.5 \times 10^{12}$ and $62^{6} \approx 5.7 \times 10^{10}$, so 7 characters comfortably cover trillions of URLs.

  8. Describe two approaches to generate short codes for a URL shortener and a trade-off of each.

    1) Hash the long URL (e.g. MD5/SHA) and take the first few base-62 chars — risk of collisions requiring checks. 2) Use an auto-increment/distributed counter and base-62 encode it — no collisions and short, but IDs are predictable/enumerable. A key-generation service can pre-generate unique keys.

  9. Why is a URL shortener a read-heavy system, and how does that shape its design?

    Redirects (reads) vastly outnumber creations (writes), often $100{:}1$ or more. Design emphasizes caching hot short codes (e.g. Redis), CDNs, and read replicas; the redirect path returns an HTTP 301/302 to the long URL.

  10. What is the difference between HTTP 301 and 302 redirects for a URL shortener?

    301 (permanent): browsers/caches remember it, so future requests skip the service — reduces load but loses per-click analytics. 302 (temporary): every click hits the service, enabling click tracking/analytics at the cost of higher load.

  11. How does a Pastebin design differ from a URL shortener in storage terms?

    Pastebin must store the actual paste content (potentially large text blobs) plus a unique key, whereas a URL shortener stores only a short mapping to an existing URL. Pastebin often puts large content in object storage/blob store and metadata in a DB, and supports expiration/TTL.

  12. How is expiration (TTL) typically implemented for pastes or short links?

    Store an expiry timestamp with each record. Lazily delete on access (return 404 if expired) and/or run a background cleanup job / use the store's native TTL (e.g. Redis EXPIRE, DynamoDB TTL) to reclaim space.

  13. In a file storage service like Dropbox, what is chunking and why is it used?

    Files are split into fixed-size blocks/chunks (e.g. 4 MB). Benefits: only changed chunks are re-uploaded/downloaded (delta sync), enables deduplication of identical chunks, parallel transfers, and resumable uploads.

  14. How does deduplication work in a cloud file storage system?

    Each chunk is hashed (e.g. SHA-256). Before storing, the system checks whether a chunk with that hash already exists; if so it stores only a reference, avoiding duplicate storage. This is content-addressed storage.

  15. What is the metadata service responsible for in a Dropbox-style design?

    It tracks file/folder structure, versions, chunk lists and their order, sharing permissions, and per-device sync state. It coordinates conflict resolution and drives clients' sync operations, while actual chunks live in block/object storage.

  16. How do clients stay in sync in a file storage service without constant polling?

    A notification/long-poll or WebSocket service tells clients when changes occur; the client then queries the metadata service for the diff and downloads only changed chunks. This is a push-notify + pull-metadata pattern.

  17. What is adaptive bitrate streaming (ABR) in a video streaming platform?

    The video is pre-encoded (transcoded) into multiple resolutions/bitrates and segmented (e.g. via HLS/DASH). The player dynamically switches segments based on measured bandwidth/buffer, maximizing quality while avoiding rebuffering.

  18. Describe the transcoding pipeline for an uploaded video (YouTube/Netflix).

    Upload → store raw file → a processing pipeline (often DAG of tasks / message queue) splits the video, transcodes into multiple codecs/resolutions/bitrates, generates thumbnails and segments (HLS/DASH manifests), then distributes to CDN edge caches for delivery.

  19. Why is a CDN critical for a video streaming platform, and what content does it serve?

    Video segments are large and latency-sensitive at massive scale; CDNs cache segments at edge locations near viewers, cutting latency, reducing origin bandwidth, and improving cache-hit rates. Popular content is pushed to many edges; the long tail is fetched on demand.

  20. What are the main components of a web crawler?

    URL frontier (queue of URLs to fetch), fetcher/downloader, DNS resolver, HTML parser/extractor, content deduplicator, URL filter, and storage. A seen-URL set prevents re-crawling, and a scheduler enforces politeness and priorities.

  21. How does a web crawler enforce politeness and avoid overloading a single host?

    It respects robots.txt and rate-limits requests per host/domain (crawl delay), typically by partitioning the URL frontier by hostname so each host is fetched by one worker with a controlled interval between requests.

  22. How does a crawler detect and avoid crawling duplicate or already-seen URLs/content?

    Maintain a 'seen URLs' set (often a Bloom filter for space efficiency) to skip re-crawling. For content dedup, hash page content (or use SimHash/MinHash for near-duplicate detection) and compare against stored fingerprints.

  23. What is a Bloom filter and why is it useful in a crawler or cache system?

    A Bloom filter is a probabilistic set that tests membership using $k$ hash functions over an $m$-bit array. It has no false negatives but a tunable false-positive rate $$p \approx \left(1 - e^{-kn/m}\right)^{k}$$ It uses far less memory than storing all elements — ideal for 'have I seen this URL?' checks.

  24. What data structure powers an efficient search-autocomplete/typeahead system?

    A trie (prefix tree). Each node represents a prefix; terminal/aggregated nodes store the top-$k$ most frequent completions for that prefix, so a lookup walks the prefix path and returns precomputed suggestions in near $O(\text{prefix length})$ time.

  25. How are the top-k suggestions kept fast in an autocomplete system despite constant query updates?

    Precompute and cache the top-$k$ completions at each trie node (or store prefix→suggestions in a cache). Frequency counts are updated asynchronously/offline from query logs and periodically rebuilt, so serving reads stay $O(1)$/fast and don't block on writes.

  26. In a ride-sharing service (Uber), how are drivers and riders matched geospatially at scale?

    Locations are indexed with a geospatial scheme — geohash or a hierarchical grid like Uber's H3 (hexagonal cells) or a quadtree. A rider query finds nearby driver cells, then ranks candidates by ETA/distance. Driver locations update frequently in an in-memory geo index.

  27. What is a quadtree and how is it used in location-based services?

    A quadtree recursively subdivides 2D space into four quadrants until each leaf holds at most a threshold number of points. It enables efficient range and nearest-neighbor queries by pruning quadrants, adapting resolution to point density (dense areas subdivide more).

  28. Explain geohash and why it enables efficient proximity search.

    Geohash encodes a lat/long into a short string by interleaving bits of latitude and longitude; shared prefixes correspond to nearby locations. Proximity search reduces to prefix matching, and neighboring cells are checked to handle boundary cases. Longer geohash = smaller, more precise cell.

  29. In a proximity service like Yelp, how do you find all businesses within a radius of a user?

    Index businesses by geohash/quadtree/H3 cell. Compute the user's cell plus adjacent cells covering the search radius, fetch candidate businesses in those cells, then filter by exact Haversine distance and rank by distance/rating.

  30. State the Haversine formula used to compute great-circle distance between two lat/long points.

    $$a = \sin^{2}\!\left(\frac{\Delta\varphi}{2}\right) + \cos\varphi_{1}\cos\varphi_{2}\sin^{2}\!\left(\frac{\Delta\lambda}{2}\right)$$ $$d = 2R\,\arcsin\!\left(\sqrt{a}\right)$$ where $\varphi$ is latitude, $\lambda$ is longitude, and $R$ is Earth's radius ($\approx 6371$ km).

System Design System Design Interview Practice FAQ

What is in the System Design System Design Interview Practice syllabus?

System Design System Design Interview Practice is split into 7 chapters: The Interview Framework, Designing Social and Feed Systems, Designing Communication Systems, Designing Storage and Sharing Systems, Designing Media and Streaming Systems, Designing Location and Marketplace Systems and Designing High-Throughput Systems. Together they contain 23 topics.

How many chapters are in System Design System Design Interview Practice?

7 chapters, containing 23 topics. The largest chapter is The Interview Framework, with 4 topics.

Are there flashcards for System Design System Design Interview Practice?

Yes — a 50-card System Design Interview Practice deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.