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 eventual consistency and strong consistency. Give two product scenarios where eventual consistency is acceptable, and two where it is not, along with your reasoning.
Sample Answer
Direct answer
Strong consistency means every read after a write returns that write, as if there were only one copy of the data. Eventual consistency means replicas are allowed to disagree temporarily after a write, and are only guaranteed to converge if writes stop arriving. The trade-off: strong consistency gives simpler application logic at the cost of higher latency and lower availability during network trouble, while eventual consistency gives lower latency and higher availability at the cost of the application having to tolerate, or actively resolve, temporarily stale or conflicting data.
Structured elaboration
The consistency spectrum, not just two points
| Model | Ordering guarantee | Latency/availability cost | Needs application-level handling? |
|---|---|---|---|
| Eventual | None across unrelated writes; replicas converge with no fixed bound if writes stop | Lowest | Yes: conflict resolution, and no built-in bound on staleness |
| Causal | Writes that are causally related (a reply, then its parent comment) are seen in the same order everywhere; unrelated writes can still reorder | Moderate | Yes, but less: needs the system to track causal relationships (named here, not derived) |
| Strong (linearizable) | Every read sees the latest write immediately, everywhere | Highest, and reduced availability under partition | Minimal: the store does the work for you |
Why "eventual" has no built-in deadline
"Eventually" is not a duration; it is a promise that convergence happens once writes stop. The actual staleness window at any moment depends on the replication pipeline's replay capacity versus the current write rate (worked example below), which is a capacity problem, not a fixed property of the word "eventual."
Worked example
Suppose a replication pipeline can apply writes at 5,000 writes/sec sustained, and normal traffic sends 3,000 writes/sec. The replica keeps up, and staleness stays bounded by pure network propagation delay (milliseconds). If a promotional event spikes incoming writes to 6,000 writes/sec, the pipeline falls behind by:
6,000−5,000=1,000 writes/sec of backlog
so after 60 seconds of that spike, the replica is:
1,000×60=60,000 writes behind
an ever-growing staleness window until the spike ends or the pipeline gets more replay capacity. This is the concrete question an eventual-consistency design has to answer: not "how long is eventually," but "what happens to staleness when write rate exceeds replay capacity, and what backpressure or scaling kicks in when it does."
Two scenarios where eventual consistency is acceptable
- Social feed likes and comment counts: a like missing for a few seconds is invisible to the user experience and self-corrects on the next refresh.
- Near real-time analytics dashboards: aggregates lagging by seconds is normal and expected, and nobody is making a financial decision off the exact current second.
Two where it is not
- Financial account balances and transfers: a stale read can let a user believe funds are available when they aren't, or let two operations both proceed against the same balance.
- Inventory reservation at checkout: a stale stock count can oversell an item, which is a customer-facing failure and an operational one (an order that can't actually be fulfilled).
The same distinction shows up at the feature level in machine learning. An online feature store computing a rolling 7-day purchase count can safely be eventually consistent; a few seconds of lag rarely changes a recommendation. But if the offline training pipeline computes that same rolling count from a different, out-of-sync snapshot than the one used at serving time, the model trains on a systematically different feature distribution than it sees in production. That training-serving skew is a strong-consistency requirement in disguise: the question isn't "is the count right," it's "was the count computed from the same consistent point-in-time snapshot on both sides."
Trade-offs & pitfalls
- Assuming "eventual" implies a short, informal default delay; there is no bound unless the team designs one, backed by a replay-capacity-versus-write-rate analysis like the one above.
- Reaching for causal consistency without realizing it requires tracking machinery (commonly version vectors: a small per-replica counter attached to each write that lets the system tell whether one write happened before, after, or concurrently with another, named here only) to know which writes are causally related; it is not a free upgrade over plain eventual consistency.
- Applying strong consistency everywhere "to be safe" and paying its latency and availability cost even for the majority of operations, like a social feed's like count, that never needed it.
Your company must cut its cloud bill by 30% within six months, without adding more than 10% to customer-visible latency, and without breaching any existing SLOs. How would you approach finding a plan that fits inside all three ceilings at once?
Sample Answer
Direct answer
Treat this as a constrained optimization, not a wishlist: list every cost lever, estimate each one's savings and its latency/service-level-objective (SLO) risk independently, combine the savings correctly (multiplicatively, since each lever applies to whatever cost remains after the prior ones, not additively), and sequence the lowest-risk, highest-confidence levers first so you are validating architecture changes only if the safe levers don't already close the gap.
Structured elaboration
Categorize levers by risk to latency and SLOs, not just by savings size:
- Commitment-based (reserved capacity, savings plans on predictable baseline usage): near-zero runtime risk, same infrastructure, different billing.
- Right-sizing and off-peak scheduling: low risk if headroom and monitoring are retained, touches capacity, not request-path logic.
- Caching improvements: moderate risk, changes the request path and introduces a staleness trade-off, needs a pilot.
- Consolidation or replacing a managed service: highest risk, changes topology or introduces new operational surface, needs a staged rollout with a rollback path.
Execution plan: run the low-risk levers first and measure actual savings against current spend, only reach for a higher-risk lever if the low-risk set doesn't clear the target, and size that higher-risk lever to close exactly the remaining gap rather than over-applying it.
Worked example
Assume four levers, sequenced from lowest to higher risk, each estimated independently:
| Lever | Estimated savings | Latency/SLO risk |
|---|---|---|
| Reserved capacity / savings-plan commitments | 15% | Near-zero (same instances) |
| Right-sizing overprovisioned instances | 10% | Low, if headroom retained |
| Off-peak scheduling for non-serving capacity | 8% | None, touches batch/worker capacity only |
| Caching improvements | 5% | Moderate, requires a pilot |
Combined savings are multiplicative on remaining cost, not additive, because each lever's percentage applies to whatever spend is left after the prior levers:
remaining fraction=(1−0.15)(1−0.10)(1−0.08)(1−0.05)
Computing stepwise: 0.85×0.90=0.765; 0.765×0.92=0.7038; 0.7038×0.95=0.66861.
Remaining fraction ≈0.6686, so total reduction ≈1−0.6686=0.3314=33.1%, clearing the 30% target with roughly 3 percentage points of margin for estimation error, using only levers with low-to-moderate individual latency risk and none requiring the highest-risk consolidation lever.
If these four levers had instead totaled, say, 24%, that is the point to reach for a higher-risk lever (service consolidation or replacing a managed component), sized with the same multiplicative method to close exactly the remaining gap, and gated behind a canary rollout given its higher risk to latency and SLOs.
Trade-offs & pitfalls
- Adding percentages linearly (15+10+8+5=38%) overstates the true combined savings (33.1% here) and can make a plan look like it clears the ceiling when it doesn't, always combine sequential percentage savings multiplicatively.
- Reaching for the single biggest-percentage lever first, even when it's also the highest-risk one, instead of exhausting low-risk levers first, front-loads risk unnecessarily when a safer combination might already hit the target.
- Measuring "savings" against a stale baseline instead of current spend produces accounting surprises when finance reconciles the actual bill.
- Latency and SLO risk aren't uniform across levers, track a risk budget alongside the dollar target, a plan that hits 30% savings but blows through 15% latency increase on one lever has still failed the actual constraint.
Walk me through a back-of-envelope monthly cost estimate for a simple web app expected to handle 1,000,000 requests per day and 10 TB of outbound data per month. What assumptions do you state, and what do you sanity-check at the end?
Sample Answer
Direct answer
Break the estimate into three buckets, compute, storage, and network egress, state a small number of explicit assumptions for each (traffic shape, cache hit ratio, unit prices), and multiply through. For this workload, 1,000,000 requests/day and 10 TB of outbound data/month, the arithmetic below lands around 1,246 dollars/month using illustrative unit rates, with network egress the dominant line item. The one sanity check worth doing at the end is dividing total outbound data by total requests: it implies each request carries roughly 333 KB on average, which is large for a "simple web app" and should prompt asking whether the two given numbers actually describe the same traffic.
Structured elaboration
Why three buckets, always kept separate
Compute, storage, and network egress scale with different things (request rate, data volume at rest, data volume transferred), so lumping them together hides which one actually drives the bill. For a workload described mainly by a request count and an outbound-data figure, network egress is very often the surprise line item, since it scales with bytes moved, not with request count.
Stated assumptions (illustrative unit rates, not any specific vendor's current list price, so the arithmetic below is fully reproducible from these inputs alone):
- 1 TB = 1,000 GB for this estimate (a decimal convention, kept simple and stated once; real billing sometimes uses the binary definition instead).
- A 5x peak-to-average traffic ratio, a common assumption absent a stated diurnal profile.
- Compute: $0.10 per instance-hour; a minimum of 3 instances regardless of load, for basic redundancy and zero-downtime deploys.
- Storage: a flat $20/month (small, since a "simple web app" is not primarily a database- and storage-heavy workload).
- Network: 60% of requests served from a content delivery network (CDN) cache; origin egress (cache misses only) at $0.09/GB; CDN edge egress (all bytes delivered to users) at $0.06/GB.
- Miscellaneous (load balancer, monitoring, DNS): $50/month.
Worked example
Compute.
avg RPS (requests per second)=86,4001,000,000≈11.6,peak RPS≈11.6×5≈58
Even one modest instance clears 58 req/s comfortably for a typical stateless web app, so the instance count here is driven by redundancy, not raw capacity: 3 instances.
compute=3×$0.10/hr×24×30=$216/month
Network egress, the dominant cost for this workload. Two separate legs, both real: the cache-miss traffic the CDN pulls from the origin (pricier), and the full volume the CDN delivers to end users regardless of hit or miss (cheaper, volume-discounted).
miss traffic=10,000 GB×(1−0.6)=4,000 GB
origin cost=4,000 GB×$0.09/GB=$360
CDN cost (all delivered bytes)=10,000 GB×$0.06/GB=$600
Total.
total≈$216+$20+$360+$600+$50=$1,246/month
Sanity check, the part the question explicitly asks for. Cross-check the two given numbers against each other, not just against the chosen unit prices:
requests/month=1,000,000×30=30,000,000
avg payload=30,000,00010,000 GB×1000 MB/GB≈0.33 MB≈333 KB per request
A typical JSON API response is a few KB, not a third of a megabyte. A 333 KB average suggests this "simple web app" is actually serving images, downloads, or media, not just API calls, or that the two input numbers don't describe the same traffic, for instance if the 10 TB includes a batch export job outside the 1,000,000 daily request count. That is the real value of this sanity check: it isn't re-verifying the arithmetic, it's confronting whether the two numbers handed to you are internally consistent with the story you were told, before handing a stakeholder a dollar figure built on an unstated contradiction.
Trade-offs & pitfalls
- Pricing only one leg of egress (origin-to-CDN or CDN-to-user) and treating the network line item as done.
- Skipping the sanity check and presenting the total as precise when the underlying assumptions (cache hit ratio, peak ratio) were guesses; state which input the total is most sensitive to.
- Sizing compute purely off average load; for small-to-medium workloads, redundancy and deploy safety often set the compute line, not raw throughput math.
- What separates a senior answer: showing the arithmetic and stating which two given numbers were cross-checked at the end, and why, rather than presenting a total as if it fell out of a spreadsheet with no further scrutiny.
What's the difference between a high-level architecture (system context and major components) and a component-level design (interfaces, data flows, sequencing)? What would you actually show stakeholders at each level, and what's one decision that only makes sense at the high level?
Sample Answer
Direct answer
A high-level architecture shows the system's scope: the major building blocks (client, API layer, service tier, datastore, cache, external dependencies), how they relate, and the non-functional constraints (scale, availability) that shaped them. A component-level design zooms into one of those blocks and specifies its interfaces, request/response schemas, data flows, and sequencing. You show the high-level view to stakeholders who need to understand what the system is and what it costs or risks; you show component-level design to the people who have to build, test, or integrate against one specific piece.
Structured elaboration
| Dimension | High-level architecture | Component-level design |
|---|---|---|
| Purpose | Scope, responsibilities, external actors, major blocks, non-functional constraints | Internals of one component: interfaces, data formats, control flow, error paths, sequencing |
| Typical diagrams | System context diagram, high-level component diagram, deployment diagram (regions, load balancers, replicas) | Sequence diagram for a specific flow, API contract (request/response schema), data model / entity-relationship diagram |
| Audience | Product managers, other architects, executives, site reliability engineers (SRE), business stakeholders | Backend/frontend engineers, QA, API consumers, integration partners |
| Question it answers | "What is this system, and what are its risk and cost boundaries?" | "How exactly does this one feature work end to end?" |
| Example decision that only lives here | Monolith vs microservices for the whole platform (changes team structure, operational model, and cost) | The exact endpoint shape, schema, and authentication header format for one API |
The reason both layers matter: the high-level view sets the strategy and the constraints everyone else has to work inside; the component-level view is what actually gets implemented, tested, and integrated. A good design doc keeps an explicit mapping from each high-level block down to its component-level detail, so a reviewer can move between the two without re-deriving context.
Worked example
Say you're designing a subscription billing feature. At the high level you'd draw: client apps, an API gateway, a billing service, a payments component, a database, and a message queue for async notifications, with an arrow showing the billing service calls out to a third-party payment processor. The one decision that belongs only at this level: whether billing lives inside the existing monolith or is split into its own service, because that choice affects deployment, on-call ownership, and the blast radius of an incident, not just this one feature.
At the component level, you'd zoom into just the billing service and produce: a sequence diagram for "create subscription" (client → billing service → payments component → processor → database write → event published), the exact request/response schema for the POST /subscriptions endpoint, and an entity-relationship diagram for the subscription and invoice tables. None of that detail belongs on the high-level diagram; it would bury the one decision (monolith vs separate service) that the high-level view exists to surface.
Trade-offs & pitfalls
- Showing component-level detail (full schemas, every retry path) to an executive or product stakeholder buries the one decision they actually need to weigh in on.
- Skipping the high-level view and jumping straight to component design risks locking in a boundary (a shared database, a synchronous call where an event would do) that is expensive to undo later, because it was never surfaced as a decision.
- A common weak answer just says "high-level is the big picture, low-level is the details" without naming a decision that is exclusive to one level; naming that decision is the signal an interviewer is listening for.
- Keep a living link between the two artifacts (a component-level design should reference which high-level block it belongs to) so the documentation doesn't drift apart as the system evolves.
A proposed optimization would cut your service's tail latency in half, but it would triple infrastructure cost and add real deployment complexity. How do you decide whether it's worth shipping, and what would change your answer?
Sample Answer
Direct answer
Treat it as an investment decision: translate the latency improvement into a dollar figure, usually via conversion or engagement lift, compare it to the extra cost plus the risk the added complexity introduces, and ship it only if the net benefit is positive with a margin that survives your uncertainty about the conversion assumption. What changes the answer is the size of that margin: a break-even case should prompt more evidence (a real experiment) before committing, not a coin flip.
Structured elaboration
The decision framework
- Translate tail latency into revenue using your own historical relationship between latency and conversion, not an assumption invented for this decision alone.
- Compare that revenue gain to the extra infrastructure cost plus the risk-adjusted cost of the added complexity (a higher chance and cost of an incident, a longer time to diagnose an outage).
- Validate with a phased rollout (a small canary first) before committing the full 3x spend, so the confirmed number is what's being paid for, not the projected one.
- Set a rollback trigger up front: if the reliability cost shows up (more incidents, longer mean time to recover) before the revenue gain is confirmed, pull back.
Worked example (illustrative assumptions; would come from your own A/B data in practice)
Assume current infrastructure costs $50,000/month and the proposed change triples it to $150,000/month:
extra cost=150,000−50,000=$100,000/monthAssume 99th-percentile (P99) tail latency drops from 2,000 ms to 1,000 ms, a 1,000 ms reduction, and assume (illustrative, pulled from historical experiments in a real decision) a 0.5% relative conversion lift per 100 ms of P99 reduction:
relative conversion lift=1001,000×0.5%=5%Against baseline monthly revenue of $2,000,000:
revenue gain=2,000,000×0.05=$100,000/month net benefit=100,000−100,000=$0That is a break-even case at these assumptions, exactly the situation that should prompt a real experiment (canary the change to a fraction of traffic, measure the actual conversion delta) rather than a decision made purely on the spreadsheet. If the elasticity assumption were even slightly optimistic, this ships negative.
What would change the answer
- A larger baseline revenue (the same 5% lift is worth more on a bigger base) tips it positive without changing anything else.
- A confirmed, measured elasticity from a canary experiment replaces the illustrative 0.5% per 100 ms figure with a real one.
- A materially lower or higher risk-adjusted reliability cost (the 3x infrastructure is also more than 3x more complex to operate) shifts the true cost side of the equation.
- A non-revenue reason, such as a contractual service-level agreement (SLA) or a strategic customer who explicitly asked for this, can justify shipping even at a break-even or slightly negative revenue case.
Trade-offs & pitfalls
- Pitfall: treating the latency-to-revenue elasticity as a known constant instead of an assumption to validate; shipping a 3x cost change on an invented number is the actual failure mode this question is testing for.
- Pitfall: ignoring the complexity side of the cost. Three times the infrastructure is usually more than three times the operational surface area (more failure modes, longer incident diagnosis), and that risk has a cost even when nothing has broken yet.
- A break-even or narrowly-positive case is a signal to run a smaller, reversible experiment, not to commit fully in either direction.
- Don't ignore alternatives: a targeted optimization for only the highest-value request paths, or a hybrid where only certain traffic gets the expensive treatment, sometimes captures most of the benefit at a fraction of the cost.
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.