Skip to content
Preptima

System Design interview questions and answers

Open-ended design rounds broken into the building blocks they draw on, plus full case studies worked end to end with explicit trade-off reasoning.

70 published across 12 topics.

Requirements gathering, capacity estimation, and structuring the first ten minutes of a design round.

hardScenarioDesign

How do you execute the Inverse Conway Maneuver on a 200-person engineering org that accidentally built a distributed monolith mirroring their dysfunctional silos?

A pragmatic guide to dismantling component teams, breaking database monoliths, and surviving the political fallout of organizational restructuring. Use this engineering leadership answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects org design to the point an interviewer is testing.

3 minsenior, staff
mediumDesign

How do you spend the first ten minutes of a system design round?

Spend roughly three minutes agreeing the functional scope, three pinning the numbers that change the architecture, and four turning those numbers into a derived estimate of request rate, storage and bandwidth — then state which design decision each number forces.

5 minmid, senior, staff
hardScenarioDesign

How do you force product leadership to prioritize paying down toxic technical debt in a hyper-growth scale-up that only cares about shipping features?

A cynical engineering leader's framework for categorizing technical debt, quantifying business risk, and negotiating with product managers. Use this engineering leadership answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects tech debt to the point an interviewer is testing.

3 minsenior, staff
All 5 in Design Fundamentals

Horizontal versus vertical scaling, load-balancer strategies, and stateless service design.

mediumDesignConcept

When do you scale out instead of up, and what does that force you to change?

Scale up while one machine can still hold the workload, because it costs no distributed complexity; scale out once you need redundancy or exceed the largest instance. Scaling out only works if the tier is stateless, which means externalising session state rather than pinning users to a node.

6 minmid, senior
All 5 in Scalability & Load Balancing

Caching

5 questions

Cache placement, eviction, invalidation, and the stampede and coherence failure modes.

hardDesignScenario

A popular key expires and forty thousand requests reach the database in the same second. What do you change?

A cache stampede happens when one hot key expires and every concurrent miss rebuilds the same value. Let one request rebuild while the rest wait or serve stale, then prevent repeats with stale-while-revalidate, jittered TTLs and refresh-before-expiry. Use this caching answer to show the decision, trade-off, and evidence rather than a memorised definition.

5 minmid, senior, staff
hardScenarioDesign

How do you execute a global CDN cache invalidation for a critical security patch without melting your origin servers under a thundering herd?

A cynical look at global cache invalidation, the necessity of origin shielding, and why relying on manual purges is an architectural anti-pattern. Use this distributed systems answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects caching to the point an interviewer is testing.

3 minsenior, staff
hardDesignConcept

How do you handle cache invalidation, and what goes wrong at scale?

Pick a write policy that matches your consistency requirement rather than treating invalidation as an afterthought, then defend against the three failure modes that only appear under load: stampede on expiry, staleness from lost invalidation messages, and unbounded growth from missing eviction.

5 minmid, senior, staff
hardDesign

Where do you put the cache, and how big does it need to be?

Choose the layer by who else can reuse the same bytes and how tolerable staleness is that far from the user, then size it from the working set rather than the dataset. Watch the miss rate, not the hit rate: origin load is proportional to misses, so 99 percent falling to 95 is a fivefold traffic increase.

6 minmid, senior, staff
All 5 in Caching

Choosing a store, sharding and partitioning, replication topologies, and storage-engine trade-offs.

hardDesign

How do you choose a datastore, and then how do you choose its shard key?

Choose the store from the dominant access pattern and the invariants it must enforce, not from a category label. Choose the shard key so the most frequent query is answerable from one shard, the key has enough distinct high-traffic values to spread load, and shards can be split later without rewriting every row.

6 minsenior, staff, lead
hardScenarioDesign

When a transatlantic cable is severed and your multi-region database inevitably enters split-brain, how do you resolve the conflicting writes without data loss?

An uncompromising examination of split-brain resolution, quorum consensus, fencing tokens, and why timestamp-based last-write-wins is fundamentally flawed. Use this distributed systems answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects databases to the point an interviewer is testing.

3 minsenior, staff
All 8 in Databases & Storage

CAP and PACELC in practice, consistency models, consensus, and what you give up under partition.

hardDesignConcept

Two users edit the same record while offline and both reconnect. How do you reconcile the two versions without silently losing one of the edits?

Accepting writes on both sides means conflicts are inevitable, so the design choice is who resolves them. Last-write-wins discards an edit by clock accident; version vectors detect the conflict and hand it back; CRDTs merge deterministically but only for the operations they model. Use this conflict resolution answer to show the decision, trade-off, and evidence rather than a memorised definition.

6 minmid, senior, staff
All 3 in Consistency & Availability

Queues versus logs, delivery guarantees, ordering, backpressure, and exactly-once claims.

hardScenarioDesign

Your services talk through events and one consumer has been down for an hour. What has it missed, and how does it catch up?

A Kafka-style consumer down for an hour has missed an offset range, not necessarily lost data. If retention still covers the gap, it resumes from the committed offset; catch-up needs surplus throughput, idempotent handlers, event-time logic and a plan for retention expiry. Use this event driven answer to show the decision, trade-off, and evidence rather than a memorised definition.

6 minmid, senior, staff
hardDesignCase Study

Every message must survive the phone being wiped, and a user has 40,000 of them. Where do they live and how are they paged?

The server holds one row per message, partitioned by conversation and clustered by descending sequence so a page is a contiguous read, and clients page by keyset cursor rather than offset. Per-user state moves to a side table so the body stays shared, and if messages are end-to-end encrypted the wipe is a key-custody question, not a storage one.

6 minmid, senior, staff
hardDesignConcept

What is the difference between a queue and a log, and what does a broker mean when it claims exactly-once?

A queue distributes work and forgets each message once acknowledged; a log is a retained, partitioned, replayable record that many consumers read independently at their own offsets. Use this message queues answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects event log to the point an interviewer is testing.

6 minmid, senior, staff
All 8 in Messaging & Streaming

Resource modelling, pagination, idempotency, versioning, and backward compatibility.

All 4 in API & Contract Design

Throttling algorithms, circuit breakers, retries with jitter, bulkheads, and graceful degradation.

hardDesignScenario

Rate-limit an LLM gateway where one request can cost a hundred times another.

Rate limiting an LLM gateway by request count fails because cost is tokens, and output tokens are unknown at admission. Budget tokens per tenant, reserve input plus expected output, settle against reported usage when the stream ends, cap concurrent streams, and cancel upstream on disconnect.

5 minmid, senior, staff
hardDesignConceptScenario

One tenant bursts to ten times their normal traffic and every other customer's latency doubles. Your global rate limit was never hit. How would you design for fairness instead?

A global limit protects the service from overload but says nothing about how capacity is divided, so one tenant can consume most of it while staying under the ceiling. Fairness needs per-tenant accounting: a token bucket for the steady-state contract, a concurrency limit so expensive requests cannot hog workers, and round-robin queueing so a burst queues behind itself.

5 minmid, senior, staff
hardScenarioDesign

How do you isolate a degraded dependency and halt a cascading failure before thread pool exhaustion takes down the entire microservice ecosystem?

Analyzing architectural resilience patterns, including circuit breakers, bulkheads, adaptive load shedding, and the mitigation of retry storms. Use this distributed systems answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects resilience to the point an interviewer is testing.

2 minsenior, staff
hardDesignScenario

Your rate limiter runs in five regions with a cap of 100 requests a minute per user. One user gets 500 through. Where did the counting go wrong?

Global rate limiting fails when each region owns a local counter, because five regions each allowing 100 requests creates a 500-request ceiling. Use one atomic shared counter, route each user to an owning region, or lease regional budget deliberately. It also connects distributed counters to the point an interviewer is testing.

5 minmid, senior, staff
hardDesignConcept

You need to enforce 100 requests per minute per API key across a fleet of forty servers. Which limiting algorithm, and where does the counter live?

Fixed windows permit twice the limit across a boundary; the two sliding windows fix that at a memory or an accuracy cost; token bucket permits a bounded burst and leaky bucket smooths output instead. Across a fleet the counter must sit in one store mutated atomically, or each node silently enforces its own limit.

8 minmid, senior, staff
All 7 in Rate Limiting & Resilience

Inverted indexes, relevance scoring, and the ingestion-to-query pipeline of a search product.

All 3 in Search & Ranking Systems

Metrics, logs, traces, cardinality control, and designing systems that can be debugged live.

hardConceptScenarioDesign

Engineers added a user_id label to a few metrics and the observability bill went up tenfold. Explain what actually happened, and how you would fix it without losing the ability to debug.

Every distinct combination of label values is a separate time series with its own index entry, so an unbounded label multiplies series count by the number of users rather than adding one dimension. Metrics are the wrong tool for per-entity questions: keep labels bounded, move per-user debugging to exemplar-linked traces, and guard against the next unbounded label.

5 minmid, senior, staff
hardScenarioDesign

Every dashboard is green and a customer tells you checkout has been broken for an hour. How does your monitoring tell nothing-is-wrong apart from nothing-is-reporting?

A green dashboard and a dead pipeline look identical, so absence of data has to be an alerting condition in its own right: heartbeats that fire when they stop arriving, an alerting path that does not share infrastructure with production, and at least one signal produced outside the system being measured. It also connects monitoring pipeline to the point an interviewer is testing.

6 minmid, senior, staff
All 4 in Observability at Scale

Tenant isolation, secrets management, defence in depth, and threat modelling a distributed system.

hardScenarioDesignConcept

A customer reports seeing another company's records in your admin console. Walk me through the first hour, and then tell me what you change so this class of bug cannot happen again.

Treat it as a confirmed breach until proven otherwise: preserve logs, scope who saw what, and start the disclosure clock alongside the investigation. The cause is almost always tenant scoping living in application code, where one forgotten filter leaks everything - so move enforcement below the code, to row-level security.

4 minsenior, lead, staff
hardDesignCase Study

Four thousand business customers share your SaaS platform. What are your tenant isolation options, and how do you make a cross-tenant data leak structurally impossible rather than merely unlikely?

Isolation runs from a tenant_id column through separate schemas and databases to a stack per tenant, trading efficiency against blast radius. Careful filtering is not an isolation model: push the predicate below the application with row-level security and scope caches and object prefixes too.

7 minsenior, staff, lead
All 4 in Security & Multi-tenancy

Full Case Studies

14 questions

Complete designs worked end to end: URL shortener, news feed, chat, ride-hailing, and more.

hardDesignCase Study

A file changes on one laptop and must appear on three others, one of which is offline. What travels over the network, and what happens when two of them edited it?

In file sync, the file itself does not travel. Changed content-hashed chunks go to a block store, then a small metadata commit names the version it replaced. Other laptops pull the new manifest and the chunks they lack. A concurrent edit fails that commit and becomes a conflicted copy, never a silent overwrite.

6 minmid, senior, staff
hardCase StudyDesign

A two-hour film must start playing within two seconds on a phone on 4G. What has to exist before the play button works?

Video streaming startup time is won before playback: transcode into an adaptive ladder, cut aligned segments, package a manifest, and cache the first low-bitrate segment near the viewer. At play time the system can only afford manifest fetch, licence check, first segment and decoder start. It also connects adaptive bitrate to the point an interviewer is testing.

6 minmid, senior, staff
hardDesignCase Study

Design the home feed for a social network.

Size it first: 200M daily actives opening the feed six times a day is 42k reads/s at peak, while 100M posts fanned out to 200 followers each is 231k feed writes/s, so writes dominate. Push to ordinary accounts, pull for high-follower ones, and store ids so deletes and blocks filter on read.

8 minmid, senior, staff
hardDesignCase Study

Design a URL shortener.

Clarify scale first, then size it: 100M new links a day at a 100:1 read ratio gives roughly 1.2k writes/s and 116k redirects/s, needing 7-character base62 keys. Generate keys from leased counter blocks scrambled by a bijection, serve reads from cache and CDN, and redirect with 302 rather than 301.

6 minmid, senior, staff
hardCase StudyDesign

A rider requests a car and forty drivers are within range. Which one do you pick, and how long do you have to decide?

Ride matching system design should rank drivers by estimated pickup time and market impact, not straight-line distance. Offer the ride under a short soft lock, use a small batching window when it improves assignment quality, and keep the rider wait within a few seconds. Use this dispatch answer to show the decision, trade-off, and evidence rather than a memorised definition.

6 minmid, senior, staff
hardScenarioDesign

How do you design a global skill-based matchmaking system that prevents grandmasters from stomping novices without making them wait in a 20-minute queue?

An authoritative breakdown of horizontal matchmaking services, constraint relaxation algorithms, and distributed locking for ticket-based lobbies. Use this matchmaking answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects SBMM to the point an interviewer is testing.

3 minsenior, staff
hardCase StudyDesign

Your origin is in one region and readers are worldwide. What do you cache, and what happens the moment you must invalidate it?

CDN caching for global reads works when cacheable bytes are separated from personalised fragments. Use content-addressed assets, tag-based purges for pages that must change, and plan for purge storms because invalidation sends cold traffic back to the one origin region. It also connects http caching to the point an interviewer is testing.

6 minmid, senior, staff
All 14 in Full Case Studies