Interview Q&A: Intermediate

The classic system design interview prompts, each with a real model answer: patterns for scaling reads and writes, and the designs interviewers reach for most — rate limiters, chat apps, feeds, caches, and more.

On the roadmap:Interview Ready · step 7: Practise under pressure

Lesson 3 of 7 · 75 min read · quiz · exercise

How to use this lesson

This is the core of most real interviews: one well-known pattern applied to one system, repeated across dozens of the systems you're most likely to be asked about. Read a question, sketch your own answer out loud, then compare against the model answer below.

What design pattern should I reach for when reads overwhelm the database?

A cache in front of the hot data, read replicas to spread read load, or a CDN if the content is cacheable and geographically distributed. Which one depends on how fresh the data needs to be and how it's accessed — a cache suits data with a clear hot set and tolerance for a little staleness; read replicas suit workloads that need fresher data but can tolerate routing reads away from the primary.

What pattern fits when writes overwhelm a single database?

Sharding to spread writes across machines, a queue in front of the database to smooth out bursts, or a storage engine built for write-heavy workloads (an LSM-tree-based store, for example) that's optimised for sequential writes rather than random ones.

How do I handle a "hot key" — one piece of data that gets disproportionate traffic?

Replicate that specific key across multiple nodes or caches so no single node absorbs all the load, split it if it's naturally divisible (for example, splitting a counter into several shards that get summed), or add a layer of local, short-lived caching in front of it so repeated requests don't all hit the same backend node.

What's the standard fix for a slow or flaky external dependency?

A timeout so a slow dependency can't hang your request indefinitely, a circuit breaker that stops calling a dependency that's clearly failing (so you fail fast instead of piling up retries), a bulkhead so one dependency's failure doesn't exhaust resources needed by the rest of the system, and a queue if the call can be made asynchronous instead of blocking the user-facing request.

How do I prevent the same action being applied twice when a client retries?

An idempotency key: the client generates a unique key per logical operation and sends it with every attempt (including retries); the server stores which keys it has already processed and returns the original result for a repeat instead of redoing the side effect. This matters most anywhere a retry could otherwise double-charge, double-send, or double-decrement something.

When is a Bloom filter actually useful?

Whenever you need a fast, memory-cheap "have I seen this before" check at scale, and you can tolerate occasional false positives (it says yes when the real answer is no) but never false negatives (it never says no when the real answer is yes). Classic uses: checking whether a URL has already been crawled, whether a username is already taken before hitting the real database, or whether a cache even needs to be checked at all.

How do I spread load evenly across nodes when nodes come and go?

Consistent hashing. See the full answer under consistent hashing below — the short version is that it avoids rehashing almost everything every time a node joins or leaves, unlike plain modulo hashing.

What's the standard response to a system being overloaded?

Rate limiting to cap how much traffic any one client can send, load shedding to deliberately drop or degrade some requests rather than let the whole system fall over, and backpressure so that a struggling downstream component can signal upstream callers to slow down instead of being silently overwhelmed.

What is consistent hashing, and why use it over simple modulo hashing?

Consistent hashing maps both servers and keys onto a ring (a hash space), and each key is owned by the next server clockwise from it. Compared to plain hash(key) % N, adding or removing a server only reshuffles the keys between that server and its neighbor on the ring — not nearly all of them, which is what happens when N changes in modulo hashing. It's used anywhere you need to shard data or route requests across a server pool that can grow or shrink without a full, expensive rebalance: distributed caches, partitioned databases, load balancers routing by key.

How would you design a rate limiter, and which algorithm would you pick?

Clarify first whether the limit is per-user, per-IP, or global, and whether bursts should be allowed. The common algorithms: fixed window (simple, but allows a burst of 2x the limit at window edges), sliding window log (accurate, but stores a timestamp per request), sliding window counter (a good practical default — approximates the sliding window cheaply using two fixed windows), and token bucket (naturally allows controlled bursts, which fits most API rate limits). For a distributed system, the counters live in a fast shared store like Redis, and you accept a small amount of over-admission as the price of not adding a synchronous bottleneck. Token bucket or the sliding window counter is the right default for most "design a rate limiter" prompts.

How would you extend a rate limiter to work correctly across multiple regions?

A strictly accurate global counter needs synchronous coordination across regions, which adds latency to every request — usually not worth it. The practical answer is to accept eventual consistency: each region keeps a local counter and periodically syncs totals with the others (or with a central store), tolerating some over-admission during the sync window as the cost of staying fast. You explicitly trade strict enforcement for availability and low latency, and say so.

What is database sharding, and what makes a good shard key?

Sharding splits one logical database across multiple physical machines, each holding a subset of the rows, so no single machine has to store or serve the whole dataset. A good shard key distributes data and traffic evenly (avoiding hot shards), keeps data that's queried together on the same shard (avoiding cross-shard joins on the hot path), and doesn't need to change once chosen (changing it means moving data). User ID is a common shard key for user-centric data; a composite key like (tenant_id, created_at) is common in multi-tenant systems where most queries are scoped to one tenant.

What's the difference between a message queue and a pub/sub system?

A queue (like SQS or RabbitMQ in queue mode) delivers each message to exactly one consumer — it's for work distribution, where you want one worker to handle each job. Pub/sub (like Kafka topics or SNS) delivers each message to every subscriber — it's for fan-out, where multiple independent systems all need to react to the same event. Kafka in particular is often used for both: consumer groups let multiple instances of the same service share the work, while separate consumer groups let different services each get their own full copy of the stream.

Design a file-sharing service with expiring links

Core flow: a user uploads a file to object storage (S3-like), and the service returns a shareable link. Signed URLs: rather than proxying file downloads through your own servers, generate a time-limited signed URL that lets the client download directly from object storage — this avoids your servers becoming a bandwidth bottleneck. Expiry: bake the expiry into the signed URL itself (object storage services support this natively) rather than tracking it separately. Access control: if links need to be revocable before their natural expiry, you need an indirection layer — a lookup table mapping link id to file, which you can mark as revoked.

Design a feature-flag service

Core requirement: extremely low-latency reads (flags are checked on nearly every request path) with safe defaults if the service is unreachable. Design: flags are typically pushed to each application server's local memory (via a background sync or a long-lived connection) rather than queried over the network on every check — a network call per flag check would add unacceptable latency to every request. Targeting: rules (by user, percentage rollout, or segment) are evaluated locally against the cached flag definitions. Safety: if the flag service is unreachable, the client falls back to the last known values or a hardcoded safe default, never to a hard failure.

Design a configuration distribution service

Similar to a feature-flag service but for broader application configuration. Core requirement: every instance of a service must eventually converge on the same configuration, and a bad config push should be easy to detect and roll back quickly. Design: a central config store with versioning, pushed (or pulled on a short interval) to subscribing instances; each instance validates a new config before applying it and can reject an invalid one rather than crash. Consistency: this is a case where you explicitly accept a propagation delay (not every instance updates in the same millisecond) in exchange for not needing synchronous coordination across every instance on every change.

Design a leaderboard for millions of players

Core requirement: fast reads of "top N" and "rank of player X," with frequent score updates. Design: a sorted set (Redis's ZSET is the canonical tool here) gives you O(log N) inserts/updates and O(log N + M) range queries for the top M entries, which is exactly the shape this problem needs. Scale beyond one node: shard the leaderboard (for example, by game region or by league/tier) so no single sorted set has to hold every player, and maintain a smaller global leaderboard only for the very top ranks, which changes far less often.

Design a distributed key-value store (like DynamoDB or Redis, at a conceptual level)

Partitioning: use consistent hashing to spread keys across nodes, so the cluster grows without a full rebalance. Replication: each key's data is replicated to multiple nodes for durability and availability — often with one node as the designated "coordinator" for a given key, or a leaderless design where any replica can accept a write (quorum-based: a write succeeds once W replicas acknowledge, a read succeeds once R replicas agree, and W + R > N gives strong consistency within that key). Conflict resolution: if two writes to the same key happen concurrently on different replicas (common in leaderless, multi-region designs), you need a way to resolve it — last-write-wins (simple, can silently drop a write), or vector clocks (preserves both versions for the application or user to resolve). Durability: writes typically go to an in-memory structure plus a write-ahead log, so a crash can replay the log instead of losing data.

Design a distributed cache

Core decisions: eviction policy (LRU is the common default — evict the least-recently-used entry when the cache is full), and how to keep the cache consistent with the source of truth. Consistency approaches: cache-aside (the application checks the cache first, falls back to the database on a miss, and writes through to the cache after — simple, but can briefly serve stale data) versus write-through (every write updates both the cache and the database together — fresher, but slower writes). Hot keys: a single very popular key can overwhelm one cache node even with good hashing; mitigate with local, short-lived caching at the application layer in front of the shared cache, or by replicating that one key across multiple cache nodes.

Design a cloud file storage and sync service (like Dropbox)

Core flow: a client watches a local folder, detects changes, and syncs them to the cloud; other clients signed into the same account pull the changes down. Chunking: large files are split into fixed-size chunks, each hashed; only changed chunks are re-uploaded on an edit, which is far more bandwidth-efficient than re-uploading whole files. Deduplication: because chunks are content-addressed (identified by their hash), identical chunks across different files or users are only stored once. Conflict handling: if the same file is edited offline on two devices before syncing, the service needs a conflict-resolution strategy — commonly, keep both versions and let the user choose, rather than silently picking one. Notifications: a long-lived connection or push notification tells other online clients a change happened, so they don't have to poll.

Design an object storage service (like S3, at a conceptual level)

Core requirement: store arbitrarily large blobs durably and cheaply, accessed by key, with very high durability guarantees (often stated as "eleven nines"). Durability approach: erasure coding — splitting data into fragments with added parity fragments, so the original can be reconstructed even if several fragments are lost, using less storage overhead than full replication for the same durability. Metadata: object metadata (key, size, location of fragments, access permissions) is stored separately from the object data itself, usually in a fast, strongly consistent store, since metadata lookups happen on every request.

Design a time-series metrics database

Core requirement: extremely high write throughput (every service emits metrics continuously) with queries that are almost always range-based ("show me this metric over the last hour"). Write path: writes are append-only and batched, favoring a storage engine optimized for sequential writes. Downsampling: raw, high-resolution data is only useful for a short recent window; older data is aggregated into coarser resolutions (one-minute, then hourly, then daily rollups) to keep long-term storage bounded, since nobody needs second-level granularity for a metric from a year ago.

Design a multi-tenant SaaS database

Core decision: how much isolation each tenant gets, which is a spectrum, not a binary choice — a shared database with a tenant_id column on every table (cheapest, but a noisy tenant can affect others and a bug can leak data across tenants if a query forgets the filter), a shared database with per-tenant schemas (more isolation, more operational overhead), or a fully separate database per tenant (best isolation, most expensive and hardest to operate at scale). Noisy neighbours: whichever model you pick, monitor and rate-limit per-tenant resource usage; a single tenant running an expensive query shouldn't degrade the experience for everyone else sharing that infrastructure.

Design a search service for a catalogue

Core data structure: an inverted index — a mapping from each term to the list of documents containing it — is what makes full-text search fast; building this is usually the point of the question, not implementation details of a specific search engine. Relevance ranking: beyond just "does this document contain the term," rank by signals like term frequency, how many of the search terms matched, and business signals (popularity, recency). Freshness: catalogue changes need to reach the index — either near-real-time (the index is updated as items change, adding write complexity) or on a periodic rebuild (simpler, but search results lag behind the real catalogue).

Design a deduplication system for uploaded media

Core approach: hash each uploaded file (or, for near-duplicates rather than exact copies, use a perceptual hash that's similar for visually similar images) and check the hash against previously seen hashes before storing a new copy. Exact duplicates: a simple hash-and-lookup table handles this cheaply. Near-duplicates (the same photo re-compressed, resized, or lightly edited): this needs similarity search rather than exact matching, which is a meaningfully harder problem an interviewer may or may not expect you to go deep on — naming the distinction is often enough.

Design a chat application (like WhatsApp or Slack)

Core requirements to clarify: one-to-one vs. group chat, online presence, delivery/read receipts, message history. Connection model: HTTP polling doesn't scale for real-time delivery; use WebSockets (or long polling as a fallback) so the server can push messages to connected clients. Routing a message: client sends to its connected server; that server looks up which server the recipient is connected to (via a presence/connection registry, often in a fast store like Redis) and forwards it, or queues it if the recipient is offline. Storage: messages are append-heavy and read by conversation, which fits a wide-column or document store partitioned by conversation ID well. Group chat complicates fan-out: a message to a 500-person group means 500 deliveries, so large groups are often handled differently from 1:1 chats (e.g., a separate fan-out path). Extensions: end-to-end encryption (keys never touch the server), read receipts (a separate lightweight write path so they don't block message delivery), multi-device sync.

Design a news feed (like Twitter or Instagram)

The central trade-off is fan-out: when a user posts, do you push it to every follower's feed immediately (fan-out on write), or compute each person's feed when they open the app (fan-out on read)? Fan-out on write is fast to read but expensive for users with millions of followers (a celebrity's post means millions of writes). Fan-out on read is cheap to write but slow for users following thousands of people. Most real systems use a hybrid: fan-out on write for typical users, fan-out on read (or a separate path) for accounts with very large follower counts. Ranking: a simple version is reverse-chronological; a realistic one scores posts by recency, engagement, and relevance to the viewer, usually computed by a separate ranking service rather than at fan-out time. Storage: each user's precomputed feed is a list of post IDs, often cached, with the full post content fetched or cached separately.

Design a photo-sharing app

This combines a media pipeline with a news feed, so draw on both answers above. Upload path: the original photo goes to object storage; a background job generates resized/compressed variants (thumbnail, feed-size, full-size) so clients never have to download and resize a full-resolution image just to show a thumbnail. Serving: images are served through a CDN, not directly from your origin storage, given how read-heavy and bandwidth-intensive image delivery is. Feed: the feed-fan-out question above applies directly — the feed stores post metadata and image references, not the images themselves.

Design a chat application with presence (online/offline/away status)

Builds on the chat design above, with presence as the added piece. Core challenge: presence state changes very frequently (every connect/disconnect) but doesn't need strong durability — it's fine to lose a little presence accuracy, it's not fine to add latency to message delivery because of it. Design: presence is typically kept in a fast, in-memory store (not the durable message store) with a short TTL, refreshed by a heartbeat from each connected client; a missed heartbeat after a timeout flips the user to offline. Fan-out of presence changes: only notify the subset of other users who actually care (contacts or conversation participants), not everyone, to avoid a presence change triggering a broadcast storm.

Design a notification system (push, email, SMS)

Entry point: an internal API that other services call to request a notification, decoupled from the actual sending via a queue — the caller shouldn't block on a third-party provider's response time. Fan-out by channel: a notification might need to go out as a push notification, an email, and an SMS depending on user preference; a worker reads the queue, checks the user's preferences and quiet hours, and routes to the right provider-specific sender. Reliability: third-party providers (APNs, FCM, an email service, an SMS gateway) fail sometimes — retries with backoff, and a dead-letter queue for ones that keep failing so they don't silently vanish. Rate and dedup: a user shouldn't get the same notification twice from a retried request (idempotency key again) or get flooded (per-user rate limiting on noisy notification types).

Design nested comments at scale

Core data modeling question: how do you store a tree of arbitrary depth efficiently? A naive parent-id-per-row model needs a recursive query to fetch a whole thread, which doesn't scale well. Common alternatives: materialized path (store each comment's full ancestor path as a string, so fetching a subtree is a prefix query) or nested sets. Hot threads: a viral post's comment thread gets both heavy read and heavy write traffic concurrently; pagination (loading top-level comments first, replies on demand) and caching the most-viewed threads are the standard mitigations.

Design nearby places search

Core problem: "find things within X km of this point" doesn't work well as a naive query over raw latitude/longitude, because there's no simple index that captures 2D proximity. Geospatial indexing: a geohash (encodes a lat/long into a string where nearby locations often share a prefix) or a quadtree (recursively divides the map into cells, subdividing further where density is high) both turn "nearby" into "same cell or an adjacent cell," which is a fast, indexable lookup. Trade-off between the two: geohashes are simpler and work well with standard database indexes; quadtrees adapt better to uneven density (a quadtree cell in a dense city center is smaller than one in a sparse rural area).

Design a ride-hailing dispatch system (like Uber or Lyft)

Core problem: match riders to nearby available drivers continuously, as both move. Location indexing: use the same geospatial indexing as nearby-places search above. Driver location updates: drivers' apps send location pings every few seconds; this is a very high write volume, so updates often go through a message queue rather than hitting the database directly, with the geospatial index updated asynchronously. Matching: when a rider requests a ride, query the index for nearby available drivers, rank by distance/ETA, and offer the ride to one driver at a time (or a small batch) with a short timeout before moving to the next. State: a driver's state (available, en route, in a trip) needs to be consistent enough that two riders don't get matched to the same driver — this is a place to discuss consistency explicitly.

Design a maps and navigation service

Core components: map tile serving (pre-rendered map images at various zoom levels, served from a CDN since they're static and extremely cacheable), and route calculation (a graph search over the road network — Dijkstra's algorithm or, more practically at scale, A* with precomputed shortcuts, since plain Dijkstra over a continent-scale road graph is too slow for interactive use). Traffic: live traffic conditions are layered onto the base graph as dynamic edge weights, updated from aggregated anonymized location data from users' devices. Scale point to raise: the road graph itself is huge and mostly static, which is why heavy precomputation (contraction hierarchies and similar techniques) is used to make real-time route queries fast, rather than searching the full graph fresh on every request.

Design a food-delivery platform

Core entities: orders, restaurants, couriers, and the matching between an order and an available courier. Flow: an order is placed, the restaurant confirms and starts preparing, and courier assignment happens either immediately (assign a nearby courier right away) or once the food is nearly ready (reduces the courier's wait time at the restaurant, at the cost of a slightly less predictable pickup time). Status tracking: order status needs to be pushed to the customer in near-real-time (similar to the live-updates pattern above) rather than polled. This shares most of its hard parts with the ride-hailing design — geospatial matching of couriers to orders — so lean on that answer and focus the differentiation on the order lifecycle and restaurant-side flow.

Design a video streaming platform (like YouTube or Netflix)

Upload path: a user uploads a raw video file, which is stored and then transcoded (converted into multiple resolutions and formats) by a background job — this is CPU-intensive and asynchronous, so the uploader doesn't wait for it. Adaptive streaming: the video is split into small chunks at each resolution; the player requests whichever resolution chunk fits the viewer's current bandwidth, switching up or down as network conditions change (this is what HLS/DASH protocols implement). Serving: video chunks are served through a CDN, given how bandwidth-heavy and cacheable video delivery is — this is usually the single biggest infrastructure cost in the whole system, worth naming explicitly.

Design a music streaming service

Shares most of its hard parts with video streaming above (adaptive delivery, CDN-heavy serving) but the catalogue and recommendation side is usually the differentiating focus. Catalogue: metadata (artists, albums, tracks, playlists) fits a relational model reasonably well given its structured relationships. Playback: similar chunked, CDN-served delivery as video, just much lower bandwidth per stream. Recommendations: usually explicitly out of scope for a pure systems design answer unless asked — if asked, point to an offline model trained on listening history serving precomputed recommendations, refreshed periodically rather than computed live per request.

Design a large file upload service with resume support

Core problem: uploading a very large file over an unreliable connection shouldn't require starting over from zero after a failure partway through. Design: chunk the file client-side and upload chunks individually, tracking which chunks have been acknowledged by the server; on reconnect, the client asks the server which chunks it already has and resumes from there instead of re-sending everything. Integrity: hash each chunk (and the whole file once reassembled) so corruption from a bad network can be detected and that one chunk re-sent, rather than discovering corruption only after the full upload completes.

Design a payment processing system

Core requirement: correctness matters more than almost anything else here — you cannot lose track of money, and every operation needs to be idempotent (see the idempotency answer above) because retries are inevitable in payment flows. Design: a ledger-based model (recording every change as an immutable entry, rather than just mutating a balance in place) makes reconciliation and auditing possible after the fact. Reconciliation: run periodic jobs comparing your internal ledger against the payment processor's records to catch any discrepancy — in payments, you explicitly build in redundant verification rather than trusting a single code path to always be correct.

Design a flash sale or ticket-drop system

Core problem: a huge, concentrated spike of demand for a small, fixed amount of inventory, where overselling is unacceptable. Design: put a queue in front of the checkout flow so the spike hits a cheap, fast gate rather than the database directly — only a steady, manageable rate of requests actually attempts to reserve inventory. Inventory reservation: hold inventory with a short-lived reservation (not a permanent decrement) when a user starts checkout, released automatically if they don't complete payment within a time window, so abandoned checkouts don't permanently lock up stock. Oversell prevention: the actual decrement needs to be atomic (a conditional update that only succeeds if stock is still available) — this is the one place in the whole design where you cannot tolerate eventual consistency.

Design an e-commerce inventory service

Shares the reservation and atomic-decrement logic from the flash sale design above, generalized to everyday (not just spike) traffic. Consistency requirement: inventory counts need strong consistency for the actual decrement, even if other parts of the product catalogue (price, description) can tolerate eventual consistency fine. Multi-warehouse: at scale, inventory is split across warehouses/regions, and an order needs to pick which warehouse fulfills it — a decision that factors in proximity to the customer and current stock, adding a small optimization problem on top of the core consistency problem.

Design a web crawler

Core loop: maintain a frontier (queue) of URLs to visit; pop a URL, fetch it, extract new URLs from the page, add the ones you haven't seen to the frontier, repeat. Avoiding duplicate work: a seen-URL set (a bloom filter is a common choice — cheap and avoids the false negatives case because a crawler can tolerate the rare false positive of skipping one already-fresh page, rather than needing exact tracking). Politeness: don't hammer one domain — a per-domain queue with a delay between requests to the same host, respecting robots.txt. Scale: the frontier and seen-set are sharded (often by domain, so the politeness rule is easy to enforce per shard), and many crawler workers pull from their shard independently. Freshness: re-crawl pages on a schedule based on how often they historically change, rather than treating every page as equally fresh forever.

Design a distributed job scheduler or cron service

Core problem: run scheduled jobs reliably, exactly once, even though the scheduler itself might be running on multiple instances for availability. Leader election: use a consensus mechanism (see Raft/Paxos) so only one instance actually triggers each scheduled job at its due time, while the others stand by ready to take over if the leader fails. Exactly-once effects: even with a single leader triggering jobs, the job execution itself needs idempotency, because a leader failover right after triggering but before confirming completion could cause a job to run twice. Retries: failed jobs need a retry policy (with backoff) distinct from the scheduling logic itself.

Design a unique ID generator for a distributed system

Core requirement: generate IDs that are unique across many machines without needing a single coordinating counter (which would be a bottleneck and a single point of failure). Common approach: a Snowflake-style ID — a 64-bit number composed of a timestamp, a machine/worker ID, and a per-millisecond sequence number, so each machine can generate IDs independently and they're still globally unique and roughly sortable by creation time. Trade-off versus UUIDs: Snowflake-style IDs are sortable and more compact, which helps database index locality; random UUIDs need zero coordination at all but have worse index locality since they insert in random order.

Design a load balancer or API gateway

The load-balancer half is answered above. What an API gateway adds on top: a single entry point that handles cross-cutting concerns before requests reach backend services — authentication, rate limiting, request routing to the right service, and sometimes response transformation or aggregation (combining calls to multiple backend services into one client-facing response). Why centralize this: so every backend service doesn't need to reimplement auth and rate limiting itself; the trade-off is that the gateway becomes a critical, high-traffic component that itself needs to be highly available and low-latency.

Design a metrics and alerting platform

The storage side is answered under the time-series database question above. What alerting adds: a rules engine that continuously evaluates metric values (or rates of change) against thresholds, and fires an alert when a condition is met for a sustained period (not on a single spike, to avoid noisy false alarms). Alert routing and deduplication: many underlying metric breaches often stem from one root cause — a good system groups related alerts together and routes them to the right on-call person, rather than paging someone for twenty separate alerts from the same incident.

Design a log aggregation pipeline

Core flow: logs are generated across many services and machines, shipped to a central pipeline (often via a lightweight agent on each host), and indexed for search. Write path: similar to the metrics database — very high write volume, favoring append-friendly storage. Indexing for search: logs are typically indexed (often with an inverted-index-based search engine, same core idea as the catalogue search question above) so operators can query by service, time range, and free text during an incident. Retention: raw logs are expensive to keep forever, so a tiered retention policy (full detail for recent logs, aggregated or deleted after a window) is standard.

Design a CI/CD and deployment system

Core flow: a code change triggers a pipeline — build, test, then deploy — with each stage gating the next so a failing test stops a bad change from reaching production. Deployment strategies: blue-green (run the new version alongside the old, then switch traffic over, enabling instant rollback by switching back) versus canary (route a small percentage of traffic to the new version first, watch for errors, then gradually increase) versus rolling (replace instances one at a time). Rollback: whichever strategy you pick, the ability to revert quickly if something goes wrong in production is the feature that actually matters most — an interviewer is often listening for whether you treat rollback as a first-class part of the design, not an afterthought.

Design a secrets management service

Core requirement: store sensitive credentials (API keys, database passwords, certificates) so that services can retrieve what they need without secrets ever being committed to code or config files in plaintext. Encryption: secrets are encrypted at rest, and access is gated by an authentication/authorization layer so a service can only read the specific secrets it's been granted access to. Rotation: secrets should be rotatable without downtime — this usually means a service fetches its secret at startup (or on a refresh interval) rather than having it baked in, so a rotated secret propagates without a redeploy. Audit: every access to a secret is logged, since knowing who read what and when is often as important as the encryption itself for compliance.

Design an uptime monitoring service

Core flow: periodically send synthetic requests (probes) to a target URL or service from multiple geographic vantage points, and alert if it's down or slow. Why multiple vantage points matter: a service that's unreachable from one region but fine elsewhere is a very different problem (and alert) than a service that's genuinely down everywhere — probing from several locations distinguishes a real outage from a regional network issue. Avoiding false alarms: a single failed probe could be a transient blip; most systems require a few consecutive failures (or failures from multiple vantage points) before firing an alert, trading a little detection speed for a lot less noise.

Design a recommendation system

Two-phase design: offline training (a model is trained periodically, often overnight, on historical interaction data — this is compute-heavy and doesn't need to be fast) and online serving (given a user, quickly return their top recommendations, which does need to be fast). Serving approach: recommendations are usually precomputed in batch for each user and cached, rather than computed fresh on every request, specifically because the model inference itself is too slow to run inline with a user-facing request. Cold start: new users or new items with no interaction history are a known hard edge case — the common fallback is popularity-based or content-based recommendations until enough interaction data accumulates.

Design a real-time analytics dashboard

Core requirement: show metrics that update continuously as new events arrive, rather than on a batch delay. Design: a stream processing layer continuously aggregates incoming events into rolling windows (last minute, last hour), writing results somewhere queryable fast (often the same kind of time-series store discussed above). Trade-off to name: exact, batch-computed aggregates are always correct but delayed; streaming aggregates are near-real-time but may need occasional reconciliation against a batch recomputation to correct for any approximation or late-arriving data.

Next: harder, multi-system designs

Once these feel comfortable, move on to the Advanced lesson — designs that combine several patterns at once, have sharper correctness requirements, or come up less often but separate strong candidates when they do.

Check your understanding

Question 1 of 4

0 correct so far

Two different design questions share the same core challenge. What should you do?

Go deeper

  • System Design Interview, volumes 1 and 2 by Alex Xu: the same question style at book length, with worked diagrams
  • System design primer by Donne Martin (GitHub): a free, community-maintained study guide covering the same ground
  • systemdesign.io by systemdesign.io: another free resource covering common system design interview questions

© 2026 forcsguy.com. Original lesson text and diagrams. Books and sites linked above belong to their authors.