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.
Explain the difference between horizontal scaling and vertical scaling for a server-side component. Give one concrete example of each, and describe the benefits and limits of both.
Sample Answer
Direct answer
Vertical scaling means giving one machine more resources, more vCPU, more RAM; horizontal scaling means adding more machines and spreading load across them. Vertical scaling is simpler because the application doesn't have to change at all, but it has a hard ceiling, the biggest machine available, and concentrates failure in one box. Horizontal scaling has effectively no ceiling and shrinks the blast radius of any single machine failing, but it requires the application to tolerate running as multiple, coordinated instances rather than one.
Structured elaboration
Concrete examples
- Vertical: moving a relational database from a 4-vCPU/16 GB box to a 16-vCPU/128 GB box, with no code change required.
- Horizontal: adding more stateless web server instances behind a load balancer, whose internal balancing algorithm is its own topic and not re-derived here.
Failure domain
Vertical scaling keeps a single point of failure regardless of how big the box gets. Horizontal scaling spreads risk, but only if the application is actually stateless or its state is externalized to a shared cache or session store; otherwise "horizontal" is cosmetic, since any one instance still holds state nothing else can serve.
Cost is not just a resilience argument
Cloud pricing for a single bigger machine is usually not linear with its capacity; the largest instance sizes often carry a premium. That is a computable, not just intuitive, reason horizontal scaling is often cheaper at a given capacity level, not only more resilient (worked example below).
A practical default
Default to horizontal for anything stateless and customer-facing. Reach for vertical only for components that are genuinely hard to distribute, a single-writer relational database primary, some legacy single-threaded systems, and even then pair it with a replication and failover plan, since vertical scaling alone still leaves a single point of failure.
Worked example
Say a 4-vCPU instance costs $0.20/hour and a 32-vCPU instance, 8 times the vCPUs, costs $2.40/hour, 12 times the price, a common cloud pattern where the largest instance sizes carry a premium rather than a linear price-per-vCPU:
4 vCPU$0.20/hr=$0.05 per vCPU-hour (small instance),32 vCPU$2.40/hr=$0.075 per vCPU-hour (large instance)
To cover 100 vCPU-equivalents of load, the same figure from the instance-sizing question above:
⌈4100⌉=25 small instances×$0.20/hr=$5.00/hr (horizontal)
⌈32100⌉=4 large instances×$2.40/hr=$9.60/hr (vertical, chunkier boxes)
Scaling out with many small instances here is essentially half the cost of the same capacity in a few large boxes, purely from the assumed per-vCPU pricing premium at the top end, and it spreads that 100 vCPU-equivalents of load across 25 failure domains instead of 4. This is illustrative pricing, not any specific vendor's current rate, but the shape, larger instances costing more per unit of capacity, is common enough to be worth checking for any real vendor before assuming vertical scaling is free of a cost penalty beyond its availability risk.
Trade-offs & pitfalls
- Assuming vertical scaling is always simpler and cheaper because it "requires no code changes"; it can cost more per unit of capacity and still leave a single point of failure.
- Scaling horizontally without externalizing state first, sessions or in-memory caches tied to one instance, producing a fleet of instances that isn't actually interchangeable and defeats the point.
- Not having a plan for vertical scaling's eventual ceiling; if a component structurally can't be distributed, that is a standing operational risk worth naming explicitly, not a decision to defer indefinitely.
- What separates a senior answer: bringing in the cost-per-unit-of-capacity angle alongside the resilience angle, since stakeholders outside engineering often hear only the failure-domain argument and miss that horizontal can also be the cheaper option.
Explain the difference between latency and throughput, and how the two relate to each other.
Sample Answer
Direct answer
Latency is how long a single request takes from request to response; throughput is how many requests the system completes per unit time. They are related through concurrency: at a fixed level of concurrency, throughput is roughly concurrency divided by latency, so throughput can be raised either by lowering per-request latency or by running more requests concurrently, at least until the system runs out of capacity, at which point requests start queueing and both latency and its variance rise sharply.
Structured elaboration
Little's Law is the bridge between the two
L=λW
where L is the average number of requests in the system (concurrency), lambda is the arrival rate (throughput), and W is the average time each request spends in the system (latency). This one relationship connects the two metrics completely.
Two regimes
- Below capacity: adding concurrency raises throughput roughly linearly without raising latency much, since the extra work overlaps with idle capacity.
- Near or above capacity: requests start queueing behind each other, and latency rises non-linearly. A small increase in load causes a disproportionate jump in the tail, a pattern basic queueing models (for example M/M/1: the standard textbook queueing model for one server with random arrivals and random service times, the model that produces the classic curve where wait time explodes as utilization approaches 100%, named here, not derived) predict and production systems reliably show.
Why percentiles, not the average, matter once load is near capacity
The mean can look fine while a growing minority of requests wait behind a queue; the 95th and 99th percentile (P95/P99) surface exactly what the average hides.
The two are not always aligned
Batching, processing many items in one call to raise throughput, typically raises the latency of any individual item in the batch. A system tuned to maximize throughput at all costs (large batches, very high concurrency) can make its own P99 latency worse, which is why the metric worth optimizing depends on the workload: a public, user-facing API should optimize for tail latency at a given throughput target; an overnight batch job should optimize for total throughput and mostly ignore any single item's latency.
Worked example
Suppose a service's actual processing time per request (its service time) is 10 ms, and the target is 500 requests/sec sustained. Little's Law says the average number of requests being served concurrently at that point is:
L=λ×Wservice=500 req/s×0.01 s=5 concurrent requests
If the worker pool has exactly 5 workers, the system is running at 100% utilization, and queueing theory's core warning applies: at or near full utilization, queue length and wait time become highly unstable, since there is no slack to absorb any variance in arrival timing or request duration. Sizing to a target utilization of about 75% instead:
capacity=ρtargetL=0.755≈6.7⇒7 workers
gives the system headroom to absorb bursts without its tail latency exploding, at the cost of running roughly 40% more capacity than the bare-minimum number, capacity that sits partly idle most of the time. That headroom is not waste; it is the price of a stable P99.
Beyond the mechanics, defending a capacity decision to non-engineering stakeholders usually means presenting this same relationship visually: a P50/P95/P99 latency trend next to a throughput trend over the same time window, so a viewer can see the point where rising throughput starts dragging tail latency up, rather than being told about it in the abstract.
Trade-offs & pitfalls
- Quoting only an average latency number, which hides that the system may already be close to its queueing knee for a meaningful fraction of requests.
- Treating "increase throughput" and "decrease latency" as the same goal; batching and running near full utilization both raise throughput while making individual-request latency worse.
- Sizing capacity to exactly the average expected load instead of leaving headroom, which looks efficient on a spreadsheet and causes a tail-latency incident on the first genuinely busy day.
- What a senior answer adds: naming which of the two metrics the workload actually cares about, rather than reciting the definitions of latency and throughput and stopping there.
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.
A platform team wants mutual TLS between every internal service, not just at the edge. What does that buy you over perimeter-only encryption, and what does it cost?
Sample Answer
Direct answer
Mutual TLS (mTLS, where both client and server present and verify certificates, not just the server) everywhere assumes the internal network is not trustworthy, so a compromised service or a misconfigured firewall rule cannot be used to eavesdrop on or impersonate another service. Perimeter-only encryption assumes the internal network is a trusted zone once past the edge, cheaper to run, but means one breached internal host has broad access to plaintext traffic between every other internal service.
Structured elaboration
mTLS everywhere: contains lateral movement, since a compromised pod cannot silently sniff or spoof traffic between two other services; costs certificate issuance and rotation infrastructure (usually a service mesh sidecar, a small helper process deployed alongside each service instance that handles the mTLS handshake and certificate rotation for it so the application code doesn't have to), added CPU for handshakes and encryption on every hop, and new per-hop latency; certificate expiry becomes a new outage class if rotation automation breaks.
Perimeter-only: no security gain past the edge, everything inside the perimeter is implicitly trusted; much lower CPU and latency overhead internally, no per-service certificate management; a single compromised internal host has plaintext access to everything else inside the perimeter.
Worked example
A request chain touches 5 internal services, each handshake plus encryption overhead adding 2ms per hop, a stated assumption for this exercise:
added latency=5×2ms=10ms
Against a 200ms end-to-end SLA:
200ms10ms=5%
a cost worth paying for a payments or healthcare system handling regulated data, and possibly not worth paying for an internal analytics dashboard with no sensitive data in the path.
Trade-offs and pitfalls
The most common failure is not the crypto overhead, it is operational: certificate rotation automation breaking silently until certificates expire and take down the whole mesh at once. Teams that adopt mTLS everywhere without investing in automated rotation and monitoring often experience their first real outage from the mTLS layer itself, not from an attacker.
What the interviewer probes next
Expect questions on rolling this out incrementally without a big-bang cutover, monitoring that catches certificate rotation failure before it becomes an incident, and whether you would carve out exceptions for latency-critical hot paths.
You're designing for a messaging app with 1M monthly active users. Midway through, you learn a new feature will increase message throughput by 10x. What changes about your design, and how do you decide what to revisit versus leave alone?
Sample Answer
Direct answer
A 10x jump in message throughput doesn't uniformly stress every part of a messaging app's design; it stresses the components whose load scales directly with message volume (the message broker, delivery workers, database writes for messages) and leaves largely untouched the components whose load scales with something else (user authentication, profile lookups, once-per-session connection setup). Deciding what to revisit versus leave alone comes down to tracing which components' load is actually a function of message throughput.
Structured elaboration
For each system component, ask: does its load scale with message volume, with active user count, or with something independent of both? That answer decides whether the 10x change touches it.
Scales with message throughput, revisit: the message broker/queue (partition count and per-partition throughput), delivery/fan-out workers, database write capacity for message storage, and any per-message monitoring or logging pipeline.
Scales with user count or session activity, mostly leave alone: authentication, user profile storage, push-notification token registration, and connection/session management, none of which get 10x busier just because message volume did.
Needs a fresh look regardless: cost forecasting (10x throughput changes the cost curve even where architecture doesn't change), and operational readiness (on-call load, alerting thresholds, and mean time to detect/restore all need revisiting because incidents become more consequential at higher throughput, even in components that didn't need architectural changes).
Worked example
Assume, as illustrative pinned inputs, 1 million monthly active users (MAU) sending an average of 50 messages/user/day:
baseline total msgs/day=1,000,000 MAU×50 msgs/user/day=50,000,000 msgs/day
baseline avg=86,400 s50,000,000≈579 msgs/s
After the 10x throughput change:
after 10x=579×10≈5,787 msgs/s average
and, using an illustrative 4x peak-to-average ratio for messaging traffic during busy hours:
illustrative peak (4x average)≈5,787×4≈23,148 msgs/s
That rise from roughly 579 to nearly 23,000 msgs/s at peak is what forces a hard look at broker partition count and delivery-worker concurrency. Meanwhile the authentication service, whose load tracks login attempts per MAU rather than messages sent, sees no comparable change and doesn't need re-architecting just because this number moved.
Trade-offs & pitfalls
- The most common mistake is treating a throughput change as a blanket "redesign everything" trigger; tracing each component's actual load driver is what separates urgent work from unaffected components.
- Cost still needs re-forecasting even for unaffected components' surrounding infrastructure (network egress, storage growth), because 10x more messages moving through the system has cost implications beyond the components that need architectural change.
- Don't defer operational readiness (alert thresholds, on-call capacity, incident runbooks) just because it isn't an architectural change; an incident at 10x throughput is a bigger incident even if the design handles the load correctly.
- If the 10x increase is concentrated in a small subset of highly active users rather than spread evenly, the actual bottleneck (a handful of hot conversations or channels) may look different from what a uniform-average calculation like the one above would suggest; validate the assumption behind the average before committing to a fix.
Unlock Full Question Bank
Get access to all System Design Methodology and Trade-off Analysis interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.