IRInterview Ready

System Design

System design interviews reward structured thinking more than trivia. Start with the component library to deeply understand the building blocks (what they are, how to use them, trade-offs, and the trick questions interviewers love), then study fully worked case studies that show how those blocks combine into real architectures.

Component Library

Traffic Management

What defines this category? (expand for interview framing)

Traffic management is about controlling how requests reach your servers before your business logic ever runs: which server handles a request, how close to the user it's served from, and how much of it you let through at all. The core mental model is a funnel with several narrowing stages — DNS/anycast picks a region, a CDN absorbs anything cacheable at the edge, a load balancer spreads what's left across a fleet, an API gateway adds cross-cutting policy, and rate limiting caps abuse before it reaches anything expensive. Candidates who treat this as 'just put a load balancer in front' miss that these components form a pipeline, each shedding load so the next layer sees a smaller, safer slice of traffic. It matters because almost every system design interview starts with 'how do requests get to my servers,' and a crisp answer here signals you think about a system as layers of defense, not a single box that does everything.

Watch for

  • The question mentions spiky, uneven, or global traffic across many servers or regions.
  • There's a need to protect backend services from abusive clients, bots, or bursts (rate limits, quotas, throttling).
  • The interviewer asks 'what happens if this one server goes down' or 'how do you scale to millions of users.'
  • Static or semi-static content (images, video, JS bundles) needs to be served with low latency worldwide.
  • The system needs a single entry point that can enforce auth, routing, or versioning across many backend services.

Common mistakes

  • Drawing one generic 'load balancer' box and never specifying L4 vs L7, algorithm, or health-check strategy.
  • Forgetting the load balancer itself needs redundancy (active-active pairs, anycast, multiple LB IPs) and can become a single point of failure.
  • Conflating rate limiting (protecting the system) with quotas (a business/product concern) and applying the wrong granularity (per-IP vs per-user vs per-API-key).
  • Ignoring cache invalidation when a CDN is proposed — 'just cache it' without saying how stale content gets purged.
  • Not distinguishing global load balancing (routing users to a region) from local load balancing (routing within a fleet), leading to a flat, unscalable design.

Connects to

PerformanceReliabilityDistribution & PartitioningSecurity

Performance

What defines this category? (expand for interview framing)

Performance components exist to make the common case fast by avoiding unnecessary work: recomputation, redundant I/O, or scanning data that isn't relevant. The dominant technique is caching in its many forms (in-process, distributed, edge, database buffer pool), complemented by probabilistic structures like Bloom filters that answer 'is this definitely not present' in constant time and space. The mental model an interview candidate should hold is that performance work is really a trade of memory and staleness for latency — you're never getting something for free, you're choosing where in the stack to pay the cost. This category matters because nearly every system design question eventually gets to 'the database can't take this load' or 'this needs to respond in under 100ms,' and the answer is almost always a well-placed cache or a way to skip work entirely, not a bigger database.

Watch for

  • The interviewer emphasizes strict latency budgets (sub-100ms reads, real-time feel).
  • The read:write ratio is heavily skewed toward reads (e.g. 1000:1), suggesting a cache would absorb most traffic.
  • There's a need to cheaply check membership or existence before doing an expensive lookup (e.g. 'has this user seen this ad,' deduping).
  • The question involves hot keys or celebrities — a small number of items receiving a disproportionate share of traffic.
  • Recomputation of the same expensive result happens repeatedly for the same or similar inputs.

Common mistakes

  • Proposing a cache without an eviction policy or invalidation strategy, hand-waving 'we'll just cache it.'
  • Not addressing cache stampede/thundering herd when a hot key expires under high concurrency.
  • Using a Bloom filter as if it can confirm presence (false positives are allowed, false negatives are not) rather than only rule out absence.
  • Choosing write-through caching for a write-heavy workload where the added write latency isn't justified.
  • Ignoring cache warm-up/cold-start behavior after a deploy or failover, causing a stampede on the database.

Connects to

Traffic ManagementStorageData Processing

Storage

What defines this category? (expand for interview framing)

Storage is about choosing the right system to durably hold data and expose the right access pattern — not just 'where do bytes live' but 'what queries need to be fast, what consistency do we need, and how does this scale.' The core skill is matching a data shape and access pattern (key-value lookups, full-text search, large binary blobs, relational joins) to the storage system built for it, rather than defaulting to a single relational database for everything. A candidate with a strong mental model treats storage choice as a first-class design decision made early, because it constrains almost everything downstream: how you shard, how you keep replicas consistent, and how expensive certain queries become. This matters in interviews because 'what database would you use and why' is one of the most common and most differentiating questions asked.

Watch for

  • The question involves choosing between SQL and NoSQL, or justifying a specific database type.
  • There's a need for full-text or fuzzy search over large volumes of text (search-index territory).
  • Large binary or unstructured data (images, video, backups) needs to be stored cheaply and durably.
  • The interviewer asks about schema design, indexing strategy, or query patterns directly.
  • Data volume or growth projections are given, hinting the answer needs to address partitioning/sharding of storage.

Common mistakes

  • Defaulting to 'I'll use a NoSQL database' or 'I'll use SQL' without justifying it against the actual read/write/query pattern.
  • Not discussing replication and consistency trade-offs (sync vs async replicas, read-after-write guarantees) once a database is chosen.
  • Storing large binary blobs directly in a relational database instead of object storage with only a reference/URL in the DB.
  • Ignoring indexing costs — adding indexes for every query without considering write amplification.
  • Treating a search index as a database of record instead of a derived, rebuildable view of the primary data store.

Connects to

PerformanceDistribution & PartitioningReliability

Distribution & Partitioning

What defines this category? (expand for interview framing)

Distribution and partitioning is about splitting data or work across many machines so no single node has to hold everything or do everything, while keeping the system able to grow or shrink without massive disruption. The central mental model is that naive partitioning schemes (like `hash(key) % N`) break catastrophically when the number of nodes changes, whereas techniques like consistent hashing are specifically designed to make topology changes cheap by remapping only a small fraction of keys. This category also covers generating unique identifiers across independent nodes without a central bottleneck — a subtler distribution problem that trips up candidates who assume a single auto-increment counter is always available. It matters because almost every 'how does this scale to billions of X' question ultimately reduces to 'how do we split X across N machines and route to the right one.'

Watch for

  • The interviewer asks how the system scales horizontally past what one machine (or one database) can hold.
  • There's a need to route the same key to the same backend/shard consistently (sharding, sticky routing, cache locality).
  • Unique, sortable, or globally-ordered IDs are needed across multiple independent generators (no shared auto-increment).
  • Adding or removing nodes should minimize data movement/reshuffling.
  • Hot partitions or uneven key distribution (celebrity users, popular keys) are called out as a concern.

Common mistakes

  • Using `hash(key) % N` for sharding without realizing it reshuffles nearly all keys when N changes.
  • Ignoring hot-partition/hot-shard problems caused by skewed key distributions (e.g. sharding by user ID when one user is far more active than others).
  • Assuming a centralized auto-increment ID generator scales, without considering clock-based or coordination-free schemes for multi-region writes.
  • Not distinguishing partitioning (splitting data) from replication (copying data) and conflating the two when discussing scale.
  • Forgetting that repartitioning is an operational event that needs a migration/rebalancing plan, not just a config change.

Connects to

StorageTraffic ManagementReliability

Async Communication

What defines this category? (expand for interview framing)

This category covers decoupling producers and consumers in time: instead of a caller blocking on an immediate response, work is handed off (via a queue, pub/sub topic, or long-lived connection) and processed independently. The mental model is that synchronous request/response couples the availability and latency of two services together, while async communication trades immediate consistency for resilience — a slow or temporarily down consumer doesn't take down the producer, and consumers can be scaled or retried independently. This matters in interviews whenever the question involves fan-out to many consumers, work that can be deferred (notifications, emails, video encoding), or bidirectional low-latency updates (chat, live feeds), because reaching for synchronous HTTP everywhere in those cases is a common and easily-spotted design smell.

Watch for

  • The question involves background jobs, deferred processing, or work that doesn't need an immediate response (e.g. sending emails, resizing images).
  • One event needs to fan out to many independent downstream consumers (pub/sub, notification delivery).
  • The system needs real-time, low-latency, bidirectional updates (chat, live scores, collaborative editing).
  • There's a need to smooth out bursty producer traffic so consumers aren't overwhelmed (buffering/backpressure).
  • Retry, dead-letter, and at-least-once/exactly-once delivery semantics come up.

Common mistakes

  • Using a synchronous HTTP call chain for something that should be fire-and-forget, coupling unrelated services' uptime together.
  • Not addressing message ordering or duplicate delivery (most queues are at-least-once, not exactly-once, without extra work).
  • Forgetting a dead-letter queue or retry/backoff policy for messages that repeatedly fail processing.
  • Choosing WebSockets/long-lived connections for something that's actually just occasional server-to-client polling, adding unnecessary connection-management complexity.
  • Ignoring consumer lag and how the system behaves when consumers fall behind producers (backpressure, buffering limits).

Connects to

ReliabilityData ProcessingDistribution & Partitioning

Reliability

What defines this category? (expand for interview framing)

Reliability covers everything that keeps a distributed system correct and available when individual parts inevitably fail: consensus for agreeing on a single truth despite failures, distributed locks for mutual exclusion, circuit breakers and health checks for containing failure blast radius, and the theoretical grounding (CAP, vector clocks/CRDTs, distributed transactions) for reasoning about what guarantees are even possible. The mental model every candidate needs is that failure is not an edge case in distributed systems — it's the normal operating condition, and every component in this category exists to answer 'what happens when this part breaks, and how does the rest of the system keep working (or fail gracefully) despite it.' This is often the highest-signal category in an interview because it's where junior and senior answers diverge most sharply: junior candidates design the happy path, senior candidates design for partial failure from the start.

Watch for

  • The interviewer explicitly asks 'what happens if this server/service/region goes down.'
  • Multiple nodes need to agree on a single value or leader despite failures or network partitions (consensus, leader election).
  • A resource needs mutual exclusion across multiple processes/machines (distributed locks).
  • A downstream dependency is flaky or slow and shouldn't be allowed to cascade failure upstream (circuit breakers).
  • The question touches trade-offs between consistency and availability during a network partition (CAP theorem).

Common mistakes

  • Designing only the happy path and treating failure handling as an afterthought bolted on at the end.
  • Claiming a system is both perfectly consistent and always available during a partition, without acknowledging the CAP trade-off being made.
  • Using a distributed lock without a lease/TTL, risking permanent deadlock if the lock holder crashes.
  • Not distinguishing retry (client-side resilience) from circuit breaking (preventing repeated calls to a known-bad dependency) — using only one when both are needed.
  • Assuming two-phase commit or distributed transactions are 'free' consistency, ignoring their availability and latency cost, without considering sagas as an alternative.

Connects to

StorageTraffic ManagementObservability & OpsAsync Communication

Consensus & Replication Protocols

Algorithms (Paxos, Raft) that let a cluster of nodes agree on a single value/state despite failures.

Distributed Locks & Idempotency

Mechanisms to ensure only one actor performs a critical action at a time, and repeated attempts don't cause duplicate side effects.

Service Discovery

Lets services find the current network location of other services in a fleet where instances constantly start, stop, and move.

Circuit Breaker & Bulkhead

Stops calling a failing downstream dependency for a cooldown period, preventing cascading failures instead of piling up timeouts.

CAP Theorem & PACELC

The foundational trade-off framework: under a network partition, a distributed system must choose Consistency or Availability — and even without a partition, there's still a Latency/Consistency trade-off (PACELC).

Heartbeats & Health Checks

Periodic 'am I alive/healthy' signals that let the rest of the system detect failures and stop routing traffic to (or trusting) a broken node.

Gossip Protocol & Anti-Entropy

Nodes periodically exchange state with a few random peers, spreading information (or repairing inconsistencies) across a whole cluster without any central coordinator.

Distributed Transactions (2PC & Saga)

Techniques for keeping multiple services/databases consistent when a single logical operation must update more than one of them.

Vector Clocks & CRDTs

Techniques for detecting or entirely avoiding conflicts when multiple replicas accept writes independently and must later reconcile.

Networking & Delivery

What defines this category? (expand for interview framing)

Networking and delivery is about the plumbing that gets a request from a client's DNS lookup all the way to the correct internal service, and increasingly, how services talk to each other inside a cluster. DNS resolves a name to an address (often the first and most overlooked hop in a design), reverse proxies terminate and forward connections to internal services, and a service mesh adds a uniform, observable communication layer between microservices (mTLS, retries, traffic shaping) without changing application code. The mental model here is layered indirection: each hop exists to decouple 'who I'm talking to' from 'where that thing actually lives,' which is what makes it possible to move, scale, or replace backend services without breaking clients. It matters in interviews because candidates who skip straight from 'client' to 'server' in their diagram miss the infrastructure that makes service discovery, TLS, and internal traffic control possible at scale.

Watch for

  • The question touches how a client actually resolves and reaches a service (DNS, service discovery).
  • TLS termination, request forwarding, or hiding internal topology from external clients comes up.
  • The system has many internal microservices that need consistent retries, timeouts, mTLS, or observability without per-service code changes.
  • The interviewer asks about latency from geographically distributed clients (DNS-based geo-routing).
  • There's a need to route internal service-to-service traffic without hardcoding IPs.

Common mistakes

  • Omitting DNS from the design entirely, or treating it as instantaneous with no caching/TTL/propagation delay considerations.
  • Confusing a reverse proxy (client-facing, hides backend topology) with a forward proxy (client-side, hides client identity).
  • Proposing a service mesh for a system with only a handful of services, adding significant operational complexity for little benefit.
  • Not considering DNS TTL and caching when discussing failover speed — clients may keep hitting a dead IP for the TTL duration.
  • Treating service discovery as solved by 'just use a config file with IPs,' which doesn't work once instances are ephemeral (autoscaling, container restarts).

Connects to

Traffic ManagementReliabilitySecurity

Data Processing

What defines this category? (expand for interview framing)

Data processing is about transforming and analyzing data at scale, either in scheduled bulk chunks (batch) or continuously as it arrives (stream). The core mental model is a spectrum of latency vs. completeness: batch jobs can look at a complete, stable dataset and produce fully correct aggregates but only periodically, while stream processing gives near-real-time results by processing events as they flow through, at the cost of having to handle out-of-order data, windowing, and approximate or eventually-corrected results. Recognizing which end of that spectrum a requirement sits on — 'nightly report' versus 'live dashboard' — is what separates a workable design from an over- or under-engineered one. This matters in interviews whenever the question involves analytics, recommendations, fraud detection, or any derived data that isn't simply CRUD on a primary store.

Watch for

  • The question involves analytics, aggregation, or reporting over large historical datasets.
  • There's a need for near-real-time metrics, dashboards, or alerts as events happen (fraud detection, live counters).
  • Data must be transformed, enriched, or joined from multiple sources before being useful (ETL/ELT).
  • The interviewer mentions 'eventually consistent' derived views or materialized aggregates.
  • Out-of-order or late-arriving events are called out as a concern.

Common mistakes

  • Defaulting to stream processing for something that's actually a once-a-day batch report, adding unnecessary operational complexity.
  • Ignoring windowing semantics (tumbling, sliding, session windows) and how late-arriving events are handled in stream processing.
  • Recomputing full aggregates from scratch instead of using incremental/streaming aggregation for large, continuously growing datasets.
  • Not distinguishing exactly-once processing guarantees (hard, expensive) from at-least-once with idempotent writes (usually sufficient and simpler).
  • Coupling the processing pipeline directly to the primary transactional database instead of reading from a queue/log, risking load on the OLTP path.

Connects to

Async CommunicationStoragePerformance

Observability & Ops

What defines this category? (expand for interview framing)

Observability and ops covers how you know what your system is actually doing in production and how you safely change its behavior without redeploying: metrics, logs, and traces to answer 'what happened and why,' and feature flags to control rollout and blast radius of new behavior independently of deployment. The mental model is that a system you can't observe is a system you can't operate — you cannot debug, capacity-plan, or safely roll back what you can't measure, and you cannot safely ship risky changes without a way to turn them off instantly. This category is often under-discussed by candidates by default, but bringing it up unprompted (e.g. 'I'd add tracing here to debug cross-service latency, and gate this new ranking algorithm behind a flag') is a strong signal of production experience, since it shows the design accounts for its own lifecycle after launch, not just its initial correctness.

Watch for

  • The interviewer asks 'how would you know if this broke in production' or 'how do you debug a latency spike.'
  • The system spans multiple services and a request's path through them needs to be reconstructed (distributed tracing).
  • There's a need to gradually roll out a risky change, run an A/B test, or instantly disable a broken feature without a redeploy.
  • Capacity planning or SLA/SLO definition comes up ('99.9% of requests under 200ms').
  • The question involves debugging a specific failure scenario after the fact.

Common mistakes

  • Treating observability as an afterthought mentioned only if the interviewer explicitly asks, instead of proactively designing for it.
  • Conflating metrics (aggregate numeric trends), logs (discrete event records), and traces (per-request causal chains) as interchangeable.
  • Proposing feature flags without addressing flag cleanup/staleness, letting the codebase accumulate permanent dead branches.
  • Not considering the storage and query cost of high-cardinality metrics or verbose logging at scale.
  • Assuming alerting is free — not distinguishing symptom-based alerts (user-facing SLO breach) from cause-based alerts (leading to alert fatigue).

Connects to

ReliabilityTraffic ManagementData Processing

Security

What defines this category? (expand for interview framing)

Security in a system design interview is primarily about authentication and authorization — proving who a caller is and deciding what they're allowed to do — plus the broader posture of not trusting any input or hop by default. The mental model is defense in depth: identity is established once (login, token issuance) and then verified cheaply at every subsequent hop (API gateway, service mesh, individual services) rather than re-checked expensively or, worse, trusted implicitly after the first check. This matters in interviews because security is easy to bolt on as an afterthought ('we'll add auth later'), and interviewers specifically probe whether a candidate treats identity, token expiry/revocation, and least-privilege access as first-class design constraints rather than a checkbox mentioned at the end.

Watch for

  • The question involves user login, sessions, or API access control.
  • Multiple services need to trust a caller's identity without each one re-implementing authentication.
  • Sensitive data or actions require distinguishing authentication (who you are) from authorization (what you can do).
  • Token expiry, revocation, or refresh comes up as a concern.
  • The interviewer asks how to prevent a specific class of abuse (credential stuffing, replay attacks, privilege escalation).

Common mistakes

  • Treating authentication and authorization as the same concept and not designing separate mechanisms for each.
  • Choosing JWTs for sessions that need instant revocation without addressing how a stateless token can actually be invalidated before expiry.
  • Re-authenticating on every internal service call instead of propagating a verified identity/token through the request chain.
  • Not considering token expiry/refresh flow, leading to either overly long-lived tokens (risk) or constant re-logins (poor UX).
  • Bolting security on at the end of the design instead of stating identity and access-control assumptions up front.

Connects to

Traffic ManagementNetworking & DeliveryObservability & Ops

Case Studies

Well-known interview questions, fully worked: requirements, capacity estimation, high-level design, deep dives, bottlenecks, and likely follow-ups.

Design a URL Shortener (e.g. bit.ly)

Easy

Asked at: Google, Amazon, Bloomberg

A service that converts long URLs into short aliases and redirects visitors from the alias to the original URL. The canonical 'first system design question' — great for practicing capacity estimation, key generation, and read-heavy caching.

Design Twitter / a Social Media News Feed

Hard

Asked at: Meta, Twitter/X, LinkedIn, Amazon

Users follow other users, post short messages ('tweets'), and see a reverse-chronological (or ranked) feed aggregating tweets from everyone they follow. The core challenge is the fan-out problem: efficiently generating feeds for users who follow thousands of accounts, and for celebrities with hundreds of millions of followers.

Design Uber / a Ride-Sharing Dispatch System

Hard

Asked at: Uber, Lyft, Amazon, Google

Riders request a trip; the system must find and dispatch a nearby available driver in real time, track live locations of both parties, and compute dynamic pricing. The core challenge is efficient real-time geospatial matching at scale, plus keeping millions of location updates flowing continuously.

Design a Chat/Messaging App (WhatsApp-style)

Medium

Asked at: Meta/WhatsApp, Amazon, Microsoft

One-to-one and group real-time messaging with delivery/read receipts and offline message delivery. The core challenges are real-time delivery to online users, reliable storage/delivery for offline users, and message ordering.

Design a Rate Limiter

Medium

Asked at: Amazon, Stripe, Google, Cloudflare

A standalone service/library that throttles the number of requests a client can make in a given time window, used to protect APIs from abuse and overload. A great 'systems building block' question that tests algorithmic + distributed-systems depth without requiring huge architecture diagrams.

Design a Distributed Cache (e.g. a Memcached/Redis-like system)

Hard

Asked at: Amazon, Meta, Google

Design the caching layer itself: a horizontally scalable key-value store that sits in front of a slower backing store, distributing keys across many cache nodes with minimal disruption as nodes are added/removed.

Design Pastebin (Code/Text Sharing Service)

Easy

Asked at: Amazon, Google, Microsoft

A service allowing users to paste code/text snippets, get a unique URL, and share it. Similar to URL shortener but with larger content payloads and syntax highlighting needs. Classic for practicing object storage, CDN caching, and read-heavy design patterns.

Design a Web Crawler

Hard

Asked at: Google, Amazon, Microsoft, Meta

A distributed system that discovers, fetches, and indexes web pages at scale, respecting politeness policies (robots.txt, rate limits). Core challenges: URL frontier management, duplicate detection, distributed coordination, and respectful crawling (not DDoS-ing target sites).

Design a News Feed / Instagram Photo Feed

Hard

Asked at: Meta, Instagram, Twitter/X, TikTok, LinkedIn

Users post content (photos, videos, text updates) and see a personalized feed of posts from accounts they follow. Very similar to the Twitter case study but with heavier media (images/videos), more emphasis on ranking/recommendation, and the fan-out-on-write vs. fan-out-on-read tradeoff at its most pronounced.