skip to content

learn.smmeyer.devsystem-design13

system-design/13

interview mode · studio · ~6h practice

Common interview design problems

outcome

Recognize reusable design shapes without forcing memorized solutions.

Plan a practice session · ~6h including exercises
Read + trace the worked example
30 min
Assignment + constraint variations
210 min
Timed drill + repeated explanations
100 min
Closed-book recall + self-review
20 min

This is a suggested practice budget, including drawing, variations, and repeated drills. Reading is the first block. Split the work across sessions and use the rubric to judge when to move on.

why this matters

Problems differ, but their hard parts repeat: fan-out, ordering, large blobs, prefix lookup, leases, idempotency, collaboration, and scarce compute. Build a pattern library, not answer scripts.

coverage

  • Content: URL shortener, file storage, search/autocomplete, feed.
  • Communication: chat, notifications, collaborative editor.
  • Infrastructure: metrics/logging, scheduler, cache, gateway, flags.
  • Transactions: payment-like workflows and ledgers.
  • AI products: LLM chat, coding agent, inference API, RAG search.

mental model

Classify the dominant shape, then reuse mechanisms with new invariants.

  1. 1 →Classify

    Fan-out? order?

  2. 2 →Choose

    Pattern + store

  3. 3 →Prove

    Invariant + scale

  4. 4 →Stress

    Failure + abuse

Read in numbered order: classify → choose → prove → stress.

lessons

01Map prompts to dominant difficulty

Feeds are fan-out and ranking. Chat is ordered low-latency delivery plus offline sync. File storage is metadata plus immutable blobs. Autocomplete is prefix retrieval under a tight latency budget. Payments are ledgers and idempotent state transitions.

Classifying a prompt means finding its invariant and dominant access pattern, not matching it to a memorized diagram. A feed emphasizes fan-out and freshness; chat emphasizes conversation ordering and delivery; file storage separates metadata from large immutable bodies. Start with one representative request and ask which part becomes difficult under the supplied scale and failure constraints.

Compare two feed accounts. An author with 200 followers can fan out new posts to follower inboxes cheaply. An author with 20M followers creates an expensive write burst. A hybrid can precompute ordinary authors and merge celebrity posts at read time. It adds read complexity and freshness rules, but targets the actual skew. “Use fan-out on write” is incomplete without the follower distribution.

Reuse reasoning patterns across prompts: stable operation IDs for retries, bounded queues for overload, authorization at data access, and measured triggers for scaling. Keep the product-specific semantic question visible. Duplicating a recommendation is annoying; duplicating a money movement can break an invariant. The same infrastructure component does not imply the same acceptable failure behavior.

  • Name the hardest invariant
  • Name the hottest path
  • Name the acceptable degradation

02Infrastructure prompts need operators

Schedulers, caches, gateways, metrics systems, and feature flags are judged through control/data plane separation, propagation behavior, tenant isolation, and operational safety.

A job scheduler has a control path for submitting and inspecting work and a data path for acquiring and executing it. Explain who owns a lease, how a stale worker is fenced, and how fairness is measured. A distributed cache similarly needs placement, membership, eviction, hot-key handling, and behavior during node loss. The operator's recovery path is part of the design.

For a metrics platform, high ingestion throughput is only one difficulty. Unbounded label combinations can create huge series counts; retention and aggregation choices affect storage and queries. For feature flags, compare a control plane that edits configuration with a serving path that evaluates a cached version. Decide what happens if updates stop propagating while application traffic continues.

Build a short comparison page after several problems. Record the core invariant, hot path, partition key, failure response, and first scaling trigger for each. If all rows say “cache, queue, database,” revisit the designs: you have recorded components instead of the mechanisms that distinguish the problems.

  • Configuration rollout needs versions and rollback
  • Control plane outage should not always stop data plane
  • Think about cardinality and noisy neighbors

03AI prompts combine familiar patterns

LLM chat adds expensive streaming compute to messaging. Coding agents add long-running job orchestration and sandboxed tools. RAG adds search indexing, ACLs, and grounded generation. Inference APIs add admission and GPU scheduling.

Map AI prompts to familiar systems before adding model-specific concerns. An LLM chat service combines conversation storage with expensive streaming compute. A coding agent combines job orchestration, repository state, tool execution, and verification. Enterprise RAG combines document ingestion, search, permissions, evidence assembly, and generation. Each still needs ordinary ownership and recovery rules.

Then identify what changes: variable output quality, token-shaped demand, model capability differences, and untrusted text influencing proposed actions. A successful HTTP response can contain a wrong answer. Track request availability separately from supported task completion, and define cost per useful result rather than only cost per model call.

Practice one prompt with different constraints instead of adding new prompts forever. Reduce the scale by ten, remove a region, revoke access mid-run, or double output length. Explain exactly which earlier decision changes. This makes transfer visible: you are adapting a mechanism to evidence rather than reciting the same architecture faster.

  • Reuse known primitives; emphasize new failure modes
  • Separate model quality from system reliability
  • Close with evals and cost

worked example

The same feed design meets two very different accounts

Most authors have 200 followers, while one celebrity has 10M. The product needs a fresh home feed with ranked posts.

  1. Write the read and publish paths separately. Pushing one normal post creates about 200 feed entries; pushing the celebrity's post creates 10M.
  2. A hybrid can fan out ordinary authors on write and merge celebrity posts on read. Name how ranking and pagination combine the two sources.
  3. Define idempotent post delivery and a versioned cursor so retries and delayed fan-out do not silently duplicate or skip entries.
  4. Test a new celebrity post during a worker backlog and decide which freshness or ranking guarantee degrades first.

Design decision: Choose fan-out policy from follower distribution and freshness requirements, with a measured threshold for the hybrid.

Limit: This is one design direction. Follow churn, deletion, ranking computation, and feed retention can change the decision.

Teaching scenario · traffic, prices, and capacity values are illustrative.

assignment

Produce: Three design packets for a feed, a notification service, and a job scheduler, plus a comparison page.

Paper, a text editor, or a spreadsheet is enough. Model access and paid services are optional.

  1. For each system, spend one pass on requirements, estimates, API/data model, critical path, and failure behavior.
  2. Use the chapter drill for timed presentations; review recordings for unquantified claims and missing ownership.
  3. Compare what changed across problems: ordering, fan-out, leases, idempotency, and retention. Redraw the weakest design after feedback.

Change a constraint

  • Inject one random failure card into each packet.
  • Repeat the weakest problem at one tenth the scale and remove unnecessary components.

Self-review rubric

  • Each design follows its workload rather than a memorized template.
  • The hardest path has numbers and an explicit invariant.
  • The comparison explains why similar components have different responsibilities.

If a criterion is missing, revise that part of the artifact before rating your practice below.

Compare a sample artifact after your attempt

One defensible answer under these assumptions. Compare the reasoning and checks with your work; other designs can satisfy the same contract.

These are condensed design packets to compare with your longer artifacts. Use supplied scale rather than copying a universal topology.

Feed: author/post IDs; publish/read APIs; ordinary-author fan-out
      + celebrity read merge; freshness budget; failed fan-out replay
Notifications: submit/status APIs; preference version + business ID;
      outbox; provider reconciliation; queue-age SLO; spend bounds
Scheduler: submit/status/cancel APIs; job + attempt + generation;
      fenced claim/commit; per-tenant resource share; stale-worker test
Compare: feed → fan-out/skew; notifications → duplicate external effect;
         scheduler → valid ownership/fairness
Each packet: estimates + access checks + metrics + first scaling trigger

A 10M-follower author can make pure fan-out-on-write expensive, while 200-follower authors may fit it well. Notifications need an effect contract beyond broker delivery. Scheduler leases need protected-resource enforcement. Reduce scale by ten and remove unnecessary components, but preserve the business invariant and explicit failure behavior.

Check your artifact

  • All three packets name APIs, durable state, and a successful request trace.
  • Each has a different hardest path and a concrete failure test.
  • A constraint change causes a justified mechanism change rather than the addition of the same cache/queue/CDN stack.

A tempting mistake: Copying one architecture across all prompts can conceal differences between stale content, duplicate messages, and conflicting job owners.

cumulative practice

Relay · build and evolve a private file service

Project brief

Keep one design document for Relay, a tenant-aware file service. Start with 100k daily users, ten downloads per user/day, 10k uploads/day, 1 MB typical bodies, 30-day retention, and a 5× download peak. Files are private to workspaces. Treat these as fictional planning assumptions. Later chapters add previews, recovery, regional constraints, compute, and an assistant. Record each change rather than replacing the earlier version; the final review combines the whole packet. These activities share the chapter's existing practice budget.

Keep one project document across this track. Reconstruct earlier reasoning before opening notes, then revise the same artifact. Use part of the assignment and review budget for this work. If you enter mid-course, sketch the earlier decisions first using the linked chapters.

Add to your project: Relay's integrated packet plus a comparison with notifications and scheduling.

Reconstruct Relay's upload, download, preview, and assistant paths without notes. Compare their dominant resources and invariants. Inject a viral file and one repeated ticket action; identify which previously learned mechanism addresses each.

Compare cumulative reasoning after your attempt

Downloads emphasize authorized bandwidth and hot-object serving; previews emphasize durable work and fenced publication; the assistant adds evidence quality, token capacity, and controlled effects. A viral file may call for caching/coalescing and source admission without weakening access. A repeated ticket uses effect identity and reconciliation, not a cache TTL. The same packet should retain APIs, ownership, workload estimates, metrics, and recovery traces for all paths.

Keep your first attempt and revision together. If your answer differs, identify the assumption or mechanism that explains the difference before rating your recall.

senior signal

Begin by saying what family the prompt belongs to and which two hard parts you will prioritize. That establishes a crisp interview agenda.

failure patterns

  • Memorizing one canonical architecture
  • Giving every prompt the same cache/queue/CDN stack
  • Skipping product semantics to discuss scale
  • Practicing only the high-level diagram

knowledge checks

Start with these quick checks, then explain the closed-book questions in your own words.

  1. 01Dominant hard part in collaborative editing?

    select an option to check your answer

  2. 02Dominant hard part in payment-like design?

    select an option to check your answer

closed-book recall

Close the worked example and explain these from memory. Answers are self-reviewed. Drafts stay on this page; save anything you want to keep in chapter notes.

Rate the assignment and recall together

Use the assignment rubric as evidence. Completion is your own judgment; this score schedules practice.

interview drill

Shuffle the drill deck and complete three 40-minute designs this week: one content, one infrastructure, and one AI-native system.

  • 3 mocks
  • 40 min each
  • record yourself
  • score rubric
compare a strong approach after your attempt

For each: spend 5 minutes on contract/scale, 8 on high-level design, 7 on data/APIs, 12 on the hardest path, and 8 on failure/security/ops. Review for explicit tradeoffs, not box count. Re-do the weakest deep dive 48 hours later.

Compare decisions and failure behavior, then repeat with a changed constraint. Keep your own wording.

Use the timed mock workspace →

references

Sources offer deeper context. Provider capabilities and API contracts can change; check current official docs before implementing.

notes

saved locally