Production incidents · Scenario
API p99 latency jumps after a deploy
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voiceThe interviewer asks
We deployed the orders service at 4 pm. Since then, p99 latency on the order details API went from about 300 milliseconds to 4 seconds. p50 has barely moved, and the error rate is still low. What do you do?
Then
Follow-ups the interviewer asks next
- What do you check in the first five minutes?
- Users can still place orders. Do you roll back now, or investigate first?
- Walk me through what you check next, in order, and what each result tells you.
- You rolled back, but p99 came down only halfway. Why?
- Tomorrow's sale brings three times the traffic, and the business wants this feature live for it. What do you do?
- What is the proper fix?
- What would have caught this before it reached every user?
- Who do you tell, and what do you say?
- Have you chased a p99 problem in production? What was the cause?
The answer
What a strong answer covers
- Clarifies first: which endpoints, p50 vs p99 (only the tail moved, so a subset of requests is slow, or requests queue behind a shared resource), whether the start matches the deploy minute, and whether traffic changed.
- Stops the damage early: rolls back, or turns the new code path off with a flag. A slow tail at high traffic soon fills thread and connection pools and turns into errors, so waiting is risky.
- Diagnoses in order: latency per endpoint and per instance (one bad pod or all of them), traces of slow requests (which span grew), the database's slow-query view (
pg_stat_statements, the MySQL slow log) and the plan (EXPLAIN ANALYZE), then the runtime: GC pauses, pool wait time, CPU throttling. - Cause here: the release added a "recent orders" block for business accounts (about 3% of requests). It runs a query on
ordersthat no index supports, so it scans the table, and the ORM then loads each order's items one query at a time (N+1). - Twist: a rollback reverts code, not data or jobs. The release also started a backfill for a new column. It is still updating millions of rows, using disk IO and causing replica lag, so it must be paused too.
- Fix: a composite index built without blocking writes (
CREATE INDEX CONCURRENTLYin Postgres), one query with a join or a batchedINinstead of N+1, aLIMIT, and a backfill that runs in small throttled batches off-peak. - Sale tomorrow: ships the fixed version behind a flag, load-tests it with production-like data today, and keeps the flag off if the numbers aren't clean.
- Prevents it: a canary that compares p99 with the old version at the same time, load tests with realistic data (a few huge customers), a plan check for new queries in review, and a p99 alert per endpoint (or SLO burn alerts).
- Communicates: an incident channel, and a short status for the business ("orders work; one page is slow for business accounts; fix expected by …"), then a postmortem.
The red pen
Common traps
Avoid:watching only the average; "add more pods" when the database is the bottleneck; assuming a rollback undoes migrations and background jobs.
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voicePractise questions like this out loud
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.