Load Testing Senior cheat sheet: interview answers
Every question of this level with its correct answer and explanation, on one page for a quick review before the interview.
1. You build a workload model for a public API. What is the best source of the arrival pattern?
Correct answer: Production access logs: rates per endpoint, peaks and bursts
Logs show the real request mix, daily peaks and how bursty traffic is. A model based on them answers questions about real risk.
2. When is a closed workload model the right choice?
Correct answer: When clients really are a fixed pool, e.g. N workers or a call center
If the real system has a fixed number of clients that wait for responses, a closed model matches it. Public traffic arrives independently, so an open model fits there.
3. How does wrk2 avoid coordinated omission?
Correct answer: It sends at a constant rate and measures from the intended send time
Latency counts from when the request should have been sent by schedule. A stall then shows up as the delay real users would see.
4. A page calls 100 backend services in parallel, each with p99 = 1 s. Roughly what share of page loads see at least one 1 s+ call?
Correct answer: About 63%
1 − 0.99^100 ≈ 0.63. Fan-out turns a rare tail into a common one, which is why tail latency matters so much in large systems.
5. What are hedged requests?
Correct answer: Sending a second copy of a slow request to another replica, using the first reply
After a short delay (e.g. the p95), a duplicate goes to another server. It cuts tail latency at a small cost in extra load, as described in The Tail at Scale.
6. Throughput rises with servers, then falls when more are added. Which model explains this?
Correct answer: The Universal Scalability Law: coherency costs grow with node count
Amdahl only predicts a plateau. With crosstalk between nodes (cache coherence, distributed locks), USL predicts a peak and then decline.
7. How should you size capacity for a service in three availability zones?
Correct answer: So two zones can handle the peak if one zone fails
N+1 thinking: losing a zone moves its traffic to the others. Load tests should check that the remaining capacity holds that load.
8. You plan to replay production traffic against staging. What is the main risk?
Correct answer: Side effects: emails, payments or writes to shared systems
Replays can trigger real notifications or charges and may contain personal data. Filter writes, mock outbound calls, and anonymize the logs.
9. Why mark synthetic load test traffic, e.g. with a header?
Correct answer: To separate it in analytics, billing and alerts
Without a marker, test orders may count as real sales and dashboards mix test and user traffic. A header or test accounts make it traceable.
10. How do you make performance thresholds in CI stable enough to block merges?
Correct answer: Dedicated runners, several runs, and limits based on measured noise
Shared runners are noisy. Pin the environment, repeat runs, and set tolerance from the baseline's variance, or tests will fail randomly and be ignored.
11. How do you decide if a latency change between two builds is real?
Correct answer: Compare distributions from repeated runs with a statistical test
Several runs per build and a test like Mann-Whitney or bootstrapped confidence intervals separate signal from noise. Single runs mislead.
12. Why should a request carry a deadline that downstream services respect?
Correct answer: So services stop work the caller has already abandoned
Without deadline propagation, deep services keep working on requests whose clients timed out. Under load that waste deepens the overload.
13. What is a retry budget?
Correct answer: A cap on retries as a share of requests, e.g. at most 10%
If retries are limited to a fraction of traffic, they help with rare failures but can't multiply load during an outage.
14. In a queue-based system, how do you know the consumers keep up with the load?
Correct answer: Queue depth and consumer lag stay flat at the target rate
Accepting work is cheap. If lag grows steadily, consumers fall behind and the backlog will eventually cause timeouts or data loss.
15. A spike test reaches peak in 30 s, but autoscaling needs 3 minutes. What options do you consider?
Correct answer: Pre-scale for known events, keep headroom, or shed load meanwhile
Changing the test to fit the system hides the risk. Real fixes: scheduled scaling, warm pools, buffers like queues, and graceful degradation.
16. A service gets more DB connections in its pool, and latency gets worse. Why?
Correct answer: The DB is saturated, so more connections add contention and switching
A DB has limited cores and disks. Past a point, extra concurrent queries just wait on locks and CPU. A smaller pool with a queue in the app is often faster.
17. In Kubernetes, CPU is at 60% of the limit, yet p99 latency spikes. What should you check?
Correct answer: CFS throttling: the container uses its quota early in each period
CPU limits are enforced per 100 ms period. Bursty work can use the quota fast and wait the rest, even at a modest average. Check throttling metrics.
18. An I/O-bound service autoscales on CPU. What does a load test likely show?
Correct answer: It doesn't scale out, though latency is high, as CPU stays low
Scaling signals must match the bottleneck. Use request rate, queue length or latency for services that mostly wait on I/O.
19. Results look much better than expected. What do you verify first?
Correct answer: That responses are real successes, not fast errors or cache hits
Errors returned in 5 ms pull latency down. Check status codes, body checks and cache headers before trusting good numbers.
20. Why look at
http_req_duration{expected_response:true}and not justhttp_req_duration?Correct answer: Fast failures would otherwise make latency look better than it is
k6 tags each request with
expected_response. Latency of successful requests is what an SLO means. Errors are tracked by error rate.21. How do you test that graceful degradation works?
Correct answer: Overload the system and check non-critical features turn off first
Degradation is a design decision: drop recommendations, keep checkout. A stress test should confirm which features shed and that core flows stay inside SLOs.
22. Staging is half the size of production. Can you double staging results to predict prod?
Correct answer: No: scaling isn't linear, and bottlenecks may differ
Shared resources like DBs, caches and network don't scale with app servers. Use staging for trends and regressions, and validate capacity on prod-like setups.
23. How do you get correct fleet-wide p99 from server-side histograms?
Correct answer: Sum histogram buckets across instances, then compute the quantile
Percentiles can't be averaged. Bucketed histograms can be summed, e.g.
histogram_quantile(0.99, sum by (le) (rate(...)))in Prometheus.24. Server histograms have buckets 100, 250, 500, 1000 ms. Why may the reported p99 = 900 ms be imprecise?
Correct answer: The value is interpolated inside a wide bucket, not measured
The true p99 lies somewhere between 500 and 1000 ms. Choose bucket edges near your SLO threshold so the answer to "are we under 300 ms?" is exact.
25. Client-side p95 is 900 ms, but app server metrics say 200 ms. Where may the time go?
Correct answer: Before the app: LB queues, connection setup, TLS or the network
Server metrics start when the app gets the request. Waiting in a proxy queue or accept backlog is invisible to it. Compare timings at each hop.
26. How should load test results feed into a release decision?
Correct answer: As evidence against SLOs and error budgets, with stated risks
A good report says: at X RPS with this mix, p99 is Y, errors Z, headroom W, the bottleneck is V. The decision belongs to the owners of the SLO.
27. Why combine load with fault injection (e.g. kill a node mid-test)?
Correct answer: Failures under load reveal cascades that idle tests never show
Failover moves traffic and triggers retries and cold caches. Without load, a node loss may look harmless; at peak it may cascade.
28. What slow resource leaks does a soak test commonly expose?
Correct answer: Connections, file handles, threads, disks filling with logs
Track each resource over hours. A slow climb in open connections or disk use won't show in a 10-minute test but will break production in days.
29. Before a breakpoint test, what must be agreed?
Correct answer: Stop criteria, a kill switch and who watches the system
Pushing to failure can harm shared infrastructure. Define limits like "stop when error rate > 5% or p99 > 3 s", and have someone ready to abort.
30. A multi-tenant SaaS has one huge tenant. What should the load test include?
Correct answer: A skewed tenant mix, so one tenant can't starve others
Noisy neighbours, hot partitions and per-tenant limits only show up with realistic skew. Check other tenants' latency while the big one is busy.
31. A CDN purge happens during peak. What risk should a test reproduce?
Correct answer: A thundering herd of cache misses hitting the origin at once
After a purge, every edge fetches from origin at the same time. Origin capacity, request collapsing and stale-while-revalidate determine whether it survives.
32. Why may results depend on the ramp shape, not only on the peak?
Correct answer: Autoscalers, caches and JIT react to how fast load grows
A slow ramp lets the system scale and warm up. A fast one may overrun it. Pick the ramp that matches the real traffic you worry about.
33. How can Little's law check whether a test result is consistent?
Correct answer: Concurrency should equal throughput times response time
If 200 VUs with no think time give 400 RPS, the mean time must be ~0.5 s. A mismatch points to client delays, dropped iterations or counting errors.
34. Why test critical components in isolation in addition to end-to-end?
Correct answer: Isolated tests find a component's limits and cause faster
Component tests are cheaper, more stable and show the ceiling of one service. End-to-end tests show interactions. Both answer different questions.
35. A service adds batching: throughput doubles, p50 grows. Is it a regression?
Correct answer: It depends: latency is traded for throughput, check the SLO
Batching waits to group work. That can be fine for background jobs and bad for interactive calls. Judge against the requirement.
36. Load testing a serverless API, what limits often appear before your code does?
Correct answer: Concurrency quotas, cold starts and downstream connections
Functions scale fast but within regional quotas, each cold start adds latency, and many instances can exhaust DB connections.
37. Which choice of load tool is the most defensible for a team?
Correct answer: The one that fits their language, protocols, CI and reporting
k6 (JS), Gatling (JVM, JS), Locust (Python) and JMeter (GUI, Java) all work. Maintainability by the team matters more than peak RPS.
38. How can a workload model represent different user journeys realistically?
Correct answer: As weighted paths or a Markov chain of steps from session data
Sessions move between pages with certain probabilities. Modelling this keeps the mix of calls and their order close to reality.
39. Real traffic is burstier than a smooth constant rate. Why does it matter?
Correct answer: Bursts briefly push queues past capacity even at a safe average
A system at 70% average can see short periods above 100%. Test with burstiness, e.g. Poisson arrivals or recorded patterns, not only a flat line.
40. A load test of checkout uses replayed requests with the same idempotency key. What happens?
Correct answer: Most requests become no-ops returning a stored result
Idempotency correctly deduplicates them, so the test measures a cache path. Generate unique keys per logical operation.
41. Why sync clocks on distributed load generators?
Correct answer: To align their time series with each other and with server metrics
Correlating a latency spike with a GC pause or deploy needs common time. NTP on all machines is the basic requirement.
42. Under write load, read replicas fall behind. What should the test verify?
Correct answer: Replication lag and whether the app tolerates stale reads
Lag can break read-after-write flows: a user saves and then doesn't see the change. Measure lag and check user-visible correctness.
43. Latency jumps for orders of one popular product only. What is a likely cause?
Correct answer: Lock contention or a hot partition on that single row or key
All updates to one inventory row serialize. Per-key metrics or DB lock waits reveal it; the fix may be sharding counters or a different design.
44. Why watch logging and tracing overhead during a load test?
Correct answer: At high RPS, logs and traces can use real CPU, I/O and money
Debug logging or 100% trace sampling may itself become a bottleneck or cost spike. Use production sampling settings.
45. Why should load test results be reported per time window as well as for the whole run?
Correct answer: A clean overall p99 can hide minutes that broke the SLO
SLOs are often measured per window. Ten bad minutes in an hour can blow an error budget even if the hour's p99 looks fine.
46. How does a load test differ when used for exploration vs as a gate?
Correct answer: Exploration changes inputs to learn; a gate is fixed and repeatable
Exploration asks "where is the limit, why?". A gate answers "did this build get worse?" and needs stable settings.
47. Why ensure test data at scale is synthetic or anonymized?
Correct answer: Copies of prod data leak personal data to test systems and logs
Privacy rules apply to test environments too. Generate data with realistic distributions instead of copying real users.
48. A downstream stub always answers in 5 ms. What is wrong with that?
Correct answer: Real dependencies have tails, so the stub hides waits and pool use
Slow dependencies hold threads and connections. Give stubs a realistic latency distribution, including occasional slow replies.
49. A rate limiter uses a token bucket with burst 100 and rate 10/s. What should a test check?
Correct answer: That bursts up to 100 pass and sustained load is cut to 10/s
Token buckets allow short bursts. Tests should confirm burst size, refill rate, correct 429 responses with
Retry-After, and per-key isolation.50. Production cache hit ratio is 85%; in the test it is 99%. What follows?
Correct answer: The test is too optimistic: make the data and key spread realistic
Hit ratio drives backend load. A test with 1% misses puts ~15× less load on the DB than production does at the same RPS.
51. Why should a capacity report state the bottleneck, not just the max RPS?
Correct answer: So the team knows what to fix and what limits further growth
"Max 1200 RPS, limited by DB CPU at 85%" is actionable. A bare number hides whether the next step is code, config or hardware.
52. When is load testing in production justified?
Correct answer: When no other env is prod-like, with limits and a kill switch
Some teams test in prod off-peak with marked traffic and automatic aborts. It needs agreement and monitoring; staging is still the default.
53. How do you test a long-running database migration's impact?
Correct answer: Run normal traffic and measure latency while the migration runs
Migrations can lock tables or saturate I/O. The risk is user impact during the migration, so measure exactly that, with prod-sized data.
54. Why cap the cost of cloud load generators before a big test?
Correct answer: Large distributed tests can create big compute and egress bills
Thousands of VUs across regions, plus traffic egress and the system under test scaling out, can cost far more than planned. Budget it.
55. What does it mean that performance is a shared ownership topic?
Correct answer: Teams own the SLOs of their services and their perf tests
Load tests by a separate team after the fact find problems late. Teams that own SLOs add perf checks early and fix their own regressions.
56. Why add network latency or loss emulation in some tests?
Correct answer: Mobile or cross-region clients hold connections longer
Slow clients keep connections and server resources busy longer. Emulating them shows connection limits that fast lab networks hide.
57. Why may adding a cache in front of a service create a new risk?
Correct answer: The system may survive only with a warm cache, failing on misses
If origin can't handle traffic without the cache, a cache failure or flush becomes an outage. Test origin capacity with a cold or bypassed cache.
58. Why model long-lived connections separately in a test (e.g. WebSockets, SSE)?
Correct answer: They hold memory and file descriptors per user, not per request
Capacity is often limited by open connections, not RPS. Test how many you can hold and what happens on mass reconnects after a deploy.
59. After a deploy, all WebSocket clients reconnect at once. What should the test check?
Correct answer: That the reconnect storm is spread by jitter and doesn't overload
Thousands of simultaneous reconnects with auth and state loading can be worse than peak traffic. Clients should use randomized backoff.
60. Why should load tests also check correctness, not only speed?
Correct answer: Race conditions and lost updates often appear only under concurrency
Double bookings, oversold stock or duplicate charges are concurrency bugs. Checks and post-test data audits catch them.
61. Why might you keep a test at peak load for 30-60 minutes rather than 5?
Correct answer: Slow effects like GC growth, pool exhaustion or throttling
Some problems need time to build up. A longer steady state also gives more samples for stable high percentiles.
62. How do you present results to non-technical stakeholders?
Correct answer: As capacity vs expected demand, risks and next actions
Business owners need: can we handle Black Friday, with what margin, what could break and what it costs to fix. Keep details in an appendix.
63. What is the danger of a load test that always passes?
Correct answer: It may test too little load or the wrong things to catch anything
Check that the test can fail: inject a known slowdown and see if thresholds catch it. A gate that never fails gives false confidence.
64. Why must think time and pacing be taken from data, not guessed?
Correct answer: They decide how many sessions exist for the same RPS
Session count affects memory, connections and cache behaviour. Real values come from analytics: time on page, steps per session.
65. You need to emulate 1 million users who each poll every 60 s. What RPS is that?
Correct answer: About 16,700 RPS
1,000,000 / 60 ≈ 16,667 requests per second, plus bursts if the polling isn't spread evenly.
66. Which metric best shows that the system sheds load correctly in a stress test?
Correct answer: Fast rejections keep accepted requests' latency within SLO
The goal is goodput: requests served on time. Rejecting the excess fast protects the requests that are accepted.
67. What is goodput?
Correct answer: Throughput of requests that succeed within their deadline
A server that returns 10,000 RPS but half of them too late for the client has a goodput of 5,000. It's the metric users care about.
68. Why can queueing inside the load generator corrupt results?
Correct answer: Delays in the tool look like server latency
If the tool's own event loop or threads are busy, it sends late and measures late. Watch generator CPU and use enough machines.
69. A service is fine at 1,000 RPS from one client, but fails at 1,000 RPS from 10,000 clients. Why?
Correct answer: Connections, TLS sessions and per-client state scale with clients
Connection count, handshakes and session memory depend on clients, not just on requests. Model the number of clients realistically.
70. Why is the end of a load test (ramp-down) worth watching?
Correct answer: It shows whether the system recovers and releases resources
Resources that stay high after load drops point to leaks or stuck work. Recovery time is a key resilience metric.
71. Why should a performance budget be part of the definition of done for risky changes?
Correct answer: Regressions are cheapest to fix in the change that caused them
Finding a slowdown weeks later means bisecting many changes. A check in the pipeline ties the regression to its cause.
72. Why do JVM services often need a longer warm-up in tests than Go services?
Correct answer: The JIT compiles hot code paths only after they run for a while
Early requests run interpreted or less optimized code. Measure after warm-up, or test cold start separately if it matters for scaling.
73. The DB is at 40% CPU but has high I/O wait under load. What is the likely bottleneck?
Correct answer: Disk I/O: queries wait for reads or writes, not for CPU
High iowait means the disk can't keep up: missing indexes, a too-small buffer cache or slow storage. USE metrics for the disk confirm it.
74. Why add a test that ramps to peak and stays there while a deploy happens?
Correct answer: Rolling deploys under load reveal drops, errors and cold starts
Connections are drained, new pods start cold, and caches empty. Deploys at peak are a real event that load tests can check safely.
75. Why prefer measuring at the edge (user side) for a release gate on latency?
Correct answer: It includes every hop users actually wait for
Server metrics miss proxy queues and network. Use client-side or edge measurements for user-facing SLOs, and server metrics to find causes.
76. What is the main value of a capacity model built from load tests?
Correct answer: Predicting when demand will exceed capacity and what to add
Measured cost per request and limits per resource let you forecast growth and plan scaling ahead of time. Revalidate it with new tests regularly.