Skip to content

The System Design Interview

The system design interview does not test whether you know Kafka. It tests whether you can turn an ambiguous goal into a structured design, make decisions with stated trade-offs, and go deep where it matters. The interviewer is steering; your job is to make steering easy.

I use RADIO: Requirements first — functional, non-functional, scale and constraints, with explicit out-of-scope items. Then Architecture: the high-level components and the request path. Then the Data model and API: entities, access patterns and endpoints. Then Optimisation and trade-offs: caching, partitioning, replication, consistency. Throughout I estimate — queries per second, storage, bandwidth — because numbers turn opinions into decisions. I state my plan at the start, then go deep where the interviewer steers, always naming what I am trading away.

Ask, write down, confirm:

  • Functional: three to five core user stories. “Shorten a URL and redirect it” beats “a URL shortener”.
  • Non-functional: availability and latency targets, consistency needs, durability, security, compliance, cost sensitivity.
  • Scale: daily active users, reads versus writes, payload size, growth over one to three years.
  • Out of scope: say it explicitly. “I’ll assume authentication is an existing service. Fair?”

Two clarifying questions that almost always pay off: “read-heavy or write-heavy?” and “is eventual consistency acceptable here?”

Draw five to eight boxes and the arrows. A reliable default shape:

client → CDN → load balancer → API layer → services → cache → database
↘ queue → workers → third-party APIs

Then walk one request through end to end. This forces you to notice the missing piece — where the write goes, how the cache is invalidated, what happens on retry.

Name the boundaries: trust boundary, failure domain, synchronous versus asynchronous. Anything that can be asynchronous should be.

  • Entities and relationships, with the primary key and access pattern for each.
  • Storage per entity: relational for transactions and joins, document for flexible documents, KV for high-volume lookups, search index for text, object storage for blobs, time-series for metrics.
  • API shape: the two or three endpoints that matter, with method, path, request and response. Mention pagination, idempotency keys for writes, and versioning.
POST /links { long_url } -> 201 { short_code, short_url }
GET /{code} -> 302 Location: long_url
GET /links/{code}/stats -> 200 { clicks, referrers, ... }

The data model is where seniority shows. “I’d store it in a table” invites “which index, and what happens when that index no longer fits in memory?”

Optimisation and trade-offs (10–15 minutes)

Section titled “Optimisation and trade-offs (10–15 minutes)”

Pick the two or three bottlenecks the numbers imply:

  • Read-heavy → cache at the edge and in the app tier; read replicas; denormalise.
  • Write-heavy → queue and batch; partition by key; append-only logs.
  • Large objects → object storage plus a CDN, never the database.
  • Hot keys → shard the key, add a random suffix, or pre-aggregate.
  • Cross-region latency → replicate reads, keep writes regional, accept staleness.

For each, say what you gain and lose. “I’d add a cache with a 60-second TTL — I gain latency and database load, I lose freshness for up to a minute, which is fine for view counts but not balances.”

You are graded on order of magnitude and on whether the numbers drive decisions, not on arithmetic.

10M daily users × 2 requests = 2 × 10^7 requests/day
≈ 230 requests/second average
peak ≈ 3× average ≈ 700 requests/second
payload 500 bytes ≈ 0.35 MB/s egress at average
storage: 2 × 10^7 × 500 B ≈ 10 GB/day ≈ 3.6 TB/year

Anchors: a day is ~86,400 seconds, so 1M/day ≈ 12/s. Memory access is nanoseconds, disk seek microseconds to milliseconds, a cross-region round trip tens of milliseconds.

  • State the plan. “I’ll spend five minutes on requirements, ten on the high-level design, then go deeper on storage and scaling. Does that work?” The highest-value sentence in the round.
  • Offer options, then choose. “A queue or a synchronous call. I’d pick the queue because the email provider is slow and can fail; the cost is a small delay.”
  • Manage time. At 30 minutes, say where you are and what you would cover next.
  • Take the steer. If they say “tell me about the database”, stop drawing and go deep — that is where the signal is.
  • Admit gaps specifically. “I haven’t run Kafka at this scale; I’d size it with vendor guidance and load-test before committing.” Better than bluffing.

Have one prepared deep dive per layer, because you will be asked for one:

  • Storage: indexing, partition key choice, replication lag, compaction.
  • Caching: cache-aside versus write-through, TTL, invalidation, stampede protection.
  • Queues: at-least-once delivery, ordering, backpressure, dead letters, idempotent consumers.
  • Consistency: what a user sees between a write and a read on a replica.
  • Failure: what happens when each box dies, and what the user experiences.
  1. What happens when the cache is cold after a deploy?
  2. How do you handle a hot partition?
  3. What is your consistency model, and where does a user see stale data?
  4. How do you deploy this without downtime?
  5. What breaks first at 10× traffic?
  • Jumping to components. Drawing Kafka before knowing the read/write ratio.
  • No numbers. Without QPS and storage, every decision is arbitrary.
  • Buzzwords without depth. Naming five technologies and explaining none.
  • Ignoring the steer. They are telling you where the rubric is.
  • Designing for Google scale at startup scale. Over-engineering is a failure mode.