System Design Methodology and Trade-off Analysis Questions
The end-to-end approach to an open-ended design problem and the judgment that resolves it: clarifying scope and constraints, gathering functional and non-functional requirements, capacity and back-of-envelope estimation, and mapping requirements to a high-level architecture, then reasoning explicitly about competing options on cost, complexity, latency, and reliability to defend a choice. Covers driving a design interview from ambiguity to a proposal, trade-off frameworks, decision-making under uncertainty and incomplete information, reversible-versus-irreversible decisions, and defending choices under scrutiny. The process-and-judgment skill underneath every system-design case study.
When a compliance, legal, or security constraint is genuinely non-negotiable, how does that change the way you do trade-off analysis? Give an example where a constraint like that eliminated an otherwise-attractive option outright.
Sample Answer
Direct answer
A genuinely non-negotiable constraint (a legal, regulatory, or security requirement with no waiver path) changes trade-off analysis from optimizing across all options to first pruning the option set down to only what's compliant, and only then optimizing cost, performance, or time-to-market among what's left. It doesn't get a weight in a scoring matrix alongside other factors; it eliminates options before scoring starts.
Structured elaboration
Treat a hard constraint as a filter applied in a distinct first pass, before any cost or performance comparison: list every candidate architecture, remove any that violate the constraint outright (not "weight them lower", remove them), and only run the normal trade-off analysis (cost, latency, time-to-market) across what survives. This ordering matters because scoring an already-infeasible option wastes analysis effort and can create a false sense that it was seriously considered.
Two realistic examples of constraints that eliminate options outright, not just penalize them:
PCI-DSS (Payment Card Industry Data Security Standard) card-data scope. If a design stores raw card numbers to power broader analytics, that option is gone the moment PCI-DSS applies, regardless of how much better the analytics would be; the only surviving options tokenize card data (replace the real card number with a random, non-sensitive placeholder token that maps back to it only inside the certified payment vault) or route it through an already-certified payment gateway.
Regulatory data residency. A requirement that a jurisdiction's data (for example, European Union customer data under data-protection law) must remain within that jurisdiction's borders eliminates any single-region deployment outside it outright, even if that region is meaningfully cheaper or already has spare capacity; there's no scoring adjustment that makes a non-compliant region viable.
Worked example
An illustrative scenario: a new payments feature needs to store transaction detail for both fraud analytics and customer support. Three candidate designs exist: (A) store full raw card data plus transaction detail for maximum analytics flexibility, (B) tokenize card data and store only tokens plus transaction metadata, (C) tokenize card data and additionally keep only aggregated, non-identifying analytics rather than per-transaction detail. Once PCI-DSS scope is applied as a hard filter, option A is eliminated outright, not down-weighted, because storing raw card data outside a certified, PCI-scoped environment isn't a slower or costlier version of the same design, it's a design that isn't legally available. The remaining trade-off analysis, cost and analytics fidelity, runs only between B and C: B keeps more per-transaction detail at a higher tokenization and storage cost (illustratively, storing a token plus full transaction metadata for 10 million transactions/month at roughly $0.0004/record runs about $4,000/month), C is cheaper (aggregating to per-customer monthly summaries cuts that record volume by roughly 95%, to around $200/month) but sacrifices per-transaction granularity for fraud analysis. That second-stage comparison is where a normal cost-vs-capability trade-off analysis applies; the first stage had none, only elimination.
Trade-offs & pitfalls
- The most common mistake is treating a hard constraint as one more weighted factor in a scoring matrix; that understates it and risks a stakeholder pushing back with "can we just accept a bit more risk here," when the honest answer is there's no risk-acceptance path available.
- Document what was eliminated and why, not just what was chosen; a stakeholder who wasn't in the room needs to see that the more attractive option was never actually on the table, not that it lost a close call.
- Distinguish a genuinely non-negotiable constraint from a strongly-preferred one; treating a soft preference as a hard filter needlessly shrinks the option set and can be walked back once challenged, which undermines trust in the rest of the analysis.
- Residual risk still needs to be documented and mitigated even after the hard filter is applied; "compliant" doesn't mean "risk-free," it means the specific eliminated risk is off the table.
For a content-moderation system, would you run every post through one large general-purpose model, or a cheap first-pass filter that only escalates uncertain cases to an expensive model? How do you decide?
Sample Answer
Direct answer
A cascade, a cheap filter first and an expensive model only on the fraction it is unsure about, wins whenever the input mix is skewed toward easy cases, because it lets you pay the expensive model's cost only on the hard tail. A single large model wins when you cannot build a cheap filter with high enough recall on the escalation decision itself, since a weak filter silently drops cases that needed the expensive model's judgment.
Structured elaboration
- Cascade design: a cheap stage-1 classifier resolves confident cases directly; anything below a confidence threshold is escalated to the expensive stage-2 model.
- What matters most: not the cascade's average accuracy, but the stage-1 filter's recall on "this needs escalation," a miss there means the expensive model never sees a case that needed it.
- Complexity cost: two models to version and monitor for drift, and request latency now varies by path length, some requests take one hop, some take two.
- Single model: simpler to operate, but every request pays the expensive model's full cost, even the easy 90%.
Worked example
10 million posts/day, cheap filter $0.0001/post, expensive model $0.01/post, and the filter confidently resolves 90% while escalating the other 10%:
cascade cost=10,000,000×$0.0001+1,000,000×$0.01=$1,000+$10,000=$11,000/day
all-expensive cost=10,000,000×$0.01=$100,000/day
That is roughly 89% cheaper. But if the filter's recall on "needs escalation" is only 95% against a true escalation population of 1,000,000:
missed escalations=1,000,000×(1−0.95)=50,000/day
50,000 posts a day get moderated by the wrong tier, a real cost that has to be weighed against the $89,000/day saved.
Trade-offs and pitfalls
Cascades only make sense if you can actually measure the filter's recall on the escalation decision, not just its overall resolve rate. Latency variance (a two-hop tail versus a one-hop median) can also blow past a p99 budget if not accounted for.
What the interviewer probes next
Expect follow-ups on how you would set and validate the confidence threshold, how to monitor drift when the two models retrain on different schedules, and how adversarial inputs crafted to slip past the cheap filter change the design.
You're serving fine-tuned models for multiple enterprise customers on the same platform. Would you run them on a shared GPU cluster with logical isolation, or give each customer dedicated infrastructure? What tips the decision?
Sample Answer
Direct answer
Shared infrastructure with strong logical isolation (separate namespaces, per-tenant auth tokens, tenant tagging, resource quotas) is usually the right default, since it pools GPU utilization across customers whose peaks rarely align, cutting cost significantly. Dedicated infrastructure per tenant is worth the extra cost when a customer's contractual or regulatory requirements demand a hard blast-radius boundary, where their data or model weights must never be reachable from another tenant's compute, even in a bug scenario.
Structured elaboration
Shared, logical isolation: pooled GPU utilization means one customer's idle hours cover another's peak, most of the cost saving in multi-tenant serving; the security posture depends entirely on the isolation layer (auth, routing, process isolation) being bug-free, since one flaw there is a cross-tenant leak.
Dedicated per-tenant: no pooling benefit, meaningfully more expensive at the same load; a compromise of the isolation layer cannot cross tenant boundaries since there's no shared compute to cross into; more fleets to patch, but any incident is contained to one tenant.
Worked example
20 customers, each needing a peak of 4 GPUs for 2 hours a day, spread through the day. Dedicated:
dedicated GPUs=20×4=80
Shared, sized to the busiest overlap window (at most 6 customers overlapping at once):
shared GPUs=6×4=24
a little over 3x fewer GPUs. That gap is exactly what a customer with hard isolation requirements, like a bank, is asking you to give up when it demands dedicated infrastructure.
Trade-offs and pitfalls
"Logical isolation" is a spectrum: container-level is weaker than VM-level, which is weaker than physically separate hardware. The mistake is treating isolation as binary instead of naming exactly which layer, network, compute, storage, or model weights, needs separation, since compliance often only demands one specific layer.
What the interviewer probes next
Tenant-scoped quotas to stop a noisy tenant from starving others, whether you'd offer a middle tier of dedicated compute with a shared control plane, and how incident response differs between the two designs.
You're building a RAG pipeline over a company's internal documentation. How do you decide the chunk size for your retrieval index, and what breaks if you get it wrong?
Sample Answer
Direct answer
Retrieval-augmented generation (RAG) retrieves relevant text chunks from an index and feeds them into an LLM's prompt at query time. Small chunks give the retriever precise, high-relevance hits but each one carries little surrounding context, so the model can answer confidently from an incomplete fragment. Large chunks preserve context but dilute relevance and cost more tokens per retrieved item. The right size is set empirically against the documents' natural unit of meaning and your context-window budget.
Structured elaboration
Chunk size affects: retrieval precision and recall, how well-grounded the generated answer is, index storage size, how many chunks (top-k) you can afford to retrieve within your token budget, and re-embedding cost whenever documents change.
Worked example
Suppose your context budget for retrieved text is 4,000 tokens and you retrieve the top 5 chunks. With 200-token chunks:
5×200=1,000 tokens used
leaving headroom, but a chunk that short may split an answer from the exception clause on the next sentence. With 800-token chunks:
5×800=4,000 tokens used
your entire budget is spent on 5 units, so a wrong top-5 pick leaves no room for a corrective sixth chunk. The cost gap is real too: at $0.002 per 1,000 input tokens and 100,000 queries/day,
small-chunk cost=100,000×1,000 tokens×$0.002/1000=$200/day
large-chunk cost=100,000×4,000 tokens×$0.002/1000=$800/day
Large chunks cost 4x more per day at this volume.
Trade-offs and pitfalls
Too-small chunks fragment context and increase the chance of a technically-correct-but-misleading answer; too-large chunks reduce retrieval precision and raise both latency and per-query cost. A common pitfall is picking a chunk size once and never revisiting it as document structure or the embedding model changes.
What the interviewer probes next
Expect follow-ups on overlapping (sliding-window) chunks to avoid splitting a fact across a boundary, chunking by structural boundaries like headings instead of a fixed token count, and how you would build an evaluation set to actually measure whether the chosen size is working.
A product needs an LLM to answer questions using the company's constantly-changing internal knowledge base. Would you reach for retrieval-augmented generation, fine-tuning, or just a longer prompt? Walk me through the choice.
Sample Answer
Direct answer
For knowledge that changes often, retrieval-augmented generation (RAG: retrieving relevant text and inserting it into the prompt at query time) is almost always the right default, since updating the knowledge base just means re-indexing documents, not retraining a model. Fine-tuning (further training the model's weights on your own examples) teaches style or a reasoning pattern, not facts that go stale. A longer prompt with a snippet pasted in works at small scale but hits a hard ceiling on cost and context length.
Structured elaboration
RAG: near-instant freshness, cheap updates, lower hallucination risk since the model is grounded in retrieved text, but adds a retrieval hop and a second system to maintain.
Fine-tuning: poor freshness, every update needs a retrain and redeploy; good for tone or a narrow task, not facts, since knowledge frozen at training time goes stale immediately.
Prompt stuffing: instant freshness, free per-update but expensive per-query, and hits a hard ceiling at the context window.
Worked example
A knowledge base of 50,000 documents, hundreds of edits daily. Stuffing a curated subset of the most relevant material into a prompt costs roughly 10,000 tokens per call (about 20 pages worth), but that subset is a sliver of the 50,000-document corpus, so anything outside it is invisible to the model, and it still costs more per query than retrieving 3-5 relevant chunks via RAG (about 1,500 tokens). Fine-tuning the full set would need a retrain every time a meaningful fraction changes, a cadence that can't keep up with hundreds of daily edits.
Trade-offs and pitfalls
RAG's quality depends entirely on retrieval quality, a bad retriever undermines even a strong model. Teams often reach for fine-tuning to "teach the model facts," which usually fails since fine-tuning shifts behavior and style far more reliably than it encodes new factual recall.
What the interviewer probes next
Combining RAG with light fine-tuning, how to evaluate retrieval quality separately from generation quality, and what to do when no retrieved document contains the answer.
Unlock Full Question Bank
Get access to all 10 System Design Methodology and Trade-off Analysis interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.