Scenarios
Longer problems, like those in senior system design interviews. A strong answer estimates with numbers first, names the mechanism, then recommends a fix and says what it costs.
1Two benchmark runs disagree: a vendor's engine looks 40% faster on Monday, and 5% faster on Wednesday on another instance. What do you do?Show the answer
Treat it as a design problem
Not a verdict. Pin and record versions, kernel, instance type and settings.
Control the environment
Check for burstable instances that run on CPU credits: interleave A and B runs, and add a baseline workload that detects when credits run out. State whether each run started cold or warm.
Measure the noise
Run an A/A test to get the noise floor, and write the decision rule beforehand (for example, ship only if p99 during peak sales improves by at least 15% at equal cost).
Decide
From the confidence interval, not a single number.
Trade-off
Time: five short interleaved runs cost more than one long run, but give an interval you can use.
Read moreVersion and config pinningEnvironment isolationThe noise floorInterleaved run order
2A load test with 200 virtual users shows p99 = 40 ms, yet production collapses on launch day. Diagnose and redesign the test.Show the answer
Diagnose
The test was closed-loop. With 200 users, rate = users ÷ response time, so when response time rose from 40 ms to 400 ms, the rate fell from 5,000 to 500 requests per second, and the test never reached the knee.
Redesign
- Open-loop or partly open arrivals (independent of responses, with users abandoning after a timeout).
- Exponentially distributed think time.
- Latency measured from the intended send time.
- Detection of steady state.
- A sweep of the arrival rate up and back down, to find the knee and the rate at which the system recovers.
Expect
Metastable overload, where recovering needs a rate far below the one that caused the failure.
Read moreOpen-loop vs. closed-loopCoordinated omissionBacklog vs. arrival rate
3Design the latency metrics pipeline for a 500-node service whose target is p99 under 50 ms.Show the answer
Record
HDR histograms on each node: logarithmic buckets, with a ceiling above the largest timeout (for example 60 s).
Aggregate
Ship the histograms, merge them centrally, and compute percentiles last. Never store pre-aggregated means or per-node p99s. Count goodput at the client, against the original request.
Estimate
A histogram with 3 significant digits from 1 µs to 60 s is a few tens of KB, so 500 nodes per minute is a few MB: cheap.
Trade-off
Sketches have bounded error; keep raw samples for experiments, where storing every value is affordable.
Read morePercentiles do not composeHDR histogramsGoodput vs. throughput
4A dashboard shows the ticketing service healthy, with CPU at 35% and throughput at its maximum, while customers cannot buy tickets. What is wrong, and what do you measure?Show the answer
Diagnose
Probably a retry storm: server throughput counts duplicates while goodput collapses.
Measure
Completions at the client against the original request; the ratio of retries; and wall-clock minus CPU time (35% CPU suggests waiting, not computing). Then use off-CPU analysis to find the lock, queue or disk wait.
Change the unit
Mitigations belong elsewhere, but the measurement fix is to count "a customer got a ticket", not "the server completed a request".
Read moreGoodput vs. throughputWall-clock vs. CPU vs. off-CPU time
5A teammate presents a 6% improvement from 3 runs each, and proposes dropping the slowest run of the baseline. How do you respond?Show the answer
Check the noise
Run an A/A test first: if identical configurations differ by about 8%, then 6% is inside the noise. Variance between runs, not within a run, governs the comparison.
Outliers
The rule for dropping outliers must be declared before the runs, and outliers are often real behaviour (garbage collection, compaction). Report with and without them.
Re-run
Interleaved and paired, with a fixed number of runs, and report the difference with a confidence interval.
Cost
Four times the runs only halves the interval, so decide with the stopping rule whether the answer is worth that.
Read moreThe noise floorOutlier policy declared in advanceRun counts and the two variancesThe stopping rule
6You swept 50 configurations, and the best shows a 14% improvement. What do you tell your manager?Show the answer
Expect regression to the mean
With noise of about 5 points, the best of 50 draws sits about 2.2 standard deviations high: roughly 11 points from luck alone.
Confirm
Run a fresh, held-out confirmation of the winner and report that number (here, something like 4%). Plan capacity with the confirmed number.
Trade-off
One extra run costs little next to a wrong capacity plan.
Read moreRegression to the mean
7A vendor says its engine is 3 times faster on TPC-DS. How do you evaluate the claim?Show the answer
Ask
For the configuration dump; who tuned each system; which of the 99 queries were reported; cache state and run order; hardware and cost.
Compare
Which mechanisms TPC-DS stresses, against those your workload stresses.
Test
Build your own benchmark from a trace of your workload, and compare at equal cost. A result without disclosure is not evidence.
Read moreWhat each standard stressesBenchmarketing patternsWorkload realism
8A service is slow, CPU is at 35%, and the flamegraph is flat. How do you proceed?Show the answer
Split the time
Compute wall-clock minus CPU time. If most of it is waiting, take an off-CPU profile, and apply the USE method to every resource, including pools and locks.
If both profiles are flat
The latency is outside the process (network, a downstream service, the client), which is itself a finding.
Compare
Take a differential profile against a version known to be good.
Read moreFlamegraphs: on-CPU and off-CPUThe USE methodDifferential profiling
9A teammate's benchmark does not reproduce in another region. What do you check?Show the answer
Check
Versions and defaults, random seeds, kernel and CPU generation, instance type, cold or warm state, data scale, and whether the result was measured below a scale boundary.
Fix
A pinned configuration dump and a one-command script.
Report
The scope the result holds in, and the next experiment.
Read morePinned versions, fixed seeds, containersScale honestyOne-command reruns
10Design the evidence needed to replace a storage engine before a peak sales event.Show the answer
Sequence
- Predict first, and register the decision rule.
- Run offline with open-loop load.
- Shadow production traffic, then a 1% canary with separate pools.
- A node-kill test, with a hypothesis and a condition for aborting.
- A cost curve from 1 to 30 times today's scale.
Deliver
One page: the mechanism that explains the result, a second prediction it makes, the limits, and the next experiment.
Trade-off
Realism costs exposure to production risk.
Read morePredict before you measureExperimenting in productionChaos testing: the methodMechanistic explanation
11Your staging load tests always pass, and production still fails. Why, and what changes?Show the answer
Why
Staging leaves out the real distribution of keys, retries, noisy neighbours and volume, so it is the optimistic case.
Change
Move closer to production with shadow traffic and canaries, watching for interference between the groups, and add fault-injection tests for rare paths, because a recovery path nobody has tested should be assumed broken.
Read moreWorkload realismExperimenting in productionChaos testing: the method