Revisiting a Wrong Diagnosis: Debugging a Hard Production Fault
BehavioralModel answerLast updated
Describe a production problem where your first diagnosis proved wrong, how evidence redirected you, the true root cause, and the safeguards you added to stop it returning.
The Question
Think of a time you investigated a complicated technical problem and your first explanation turned out to be wrong or only partly right. Talk the interviewer through:
- How you went about diagnosing it.
- How you learned your original theory was flawed.
- What the real root cause was.
- What you did so the problem would not come back.
What a Good Answer Covers
Use the STAR format (Situation, Task, Action, Result), but spend most of your time on the investigation itself.
- Starting theory. Describe the symptoms and your first explanation. Say why it was a sensible place to begin.
- The turning point. Identify the concrete observation that undermined that theory (a log line, a metric, a trace, a failed experiment). "It didn't work" is not enough.
- Method. Explain how you narrowed the problem down: correlating logs, adding instrumentation, bisecting deployments, reproducing the fault in a controlled environment, and so on.
- Cause versus symptom. Separate what users or dashboards showed (for example, "requests timed out") from the underlying mechanism (for example, "a resource leaked on an error path").
- Prevention. Describe the lasting changes: tests, monitoring and alerts, design changes, or automated safeguards.
Aim for about three to four minutes of speaking time. Expect several follow-up questions that probe your technical details.
Hints
Hint 1
Choose an incident where your first theory was reasonable, not careless. That shows good judgment, and the correction then reads as rigor rather than a mistake.
Hint 2
Name the specific evidence that contradicted your theory, such as scope (one host versus the whole fleet), a metric that stayed flat, or trace timing that showed where time was actually spent.
Hint 3
Explain the full causal chain from trigger to symptom, and be ready to go deeper on any tool or artifact you mention.
Hint 4
End with prevention at several levels: the code fix, a regression test, monitoring that would catch the issue earlier, and a check for the same bug class elsewhere. Quantify the before and after.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
What the interviewer is looking for
This is a "go deep" question, with elements of ownership and high standards. Interviewers listen for four things:
- Hypothesis discipline. You treated your first idea as something to test, not as a conclusion.
- Evidence-driven pivots. A specific observation changed your mind, rather than a failed fix.
- Personal technical depth. You can explain the mechanism at the level of threads, connections, queries, or bytes, and you can survive two to four probing follow-ups.
- Durable prevention. You changed the system so that the whole class of bug cannot return silently.
Weak answers say "we" throughout, stay at the dashboard level, and end with "and then it was fixed." Strong answers sound like a postmortem written by the person who solved it.
Structure and timing
| Part | Time | Content |
|---|---|---|
| Situation | ~20s | System, scale, symptom, business impact with numbers |
| Task | ~10s | Your specific responsibility |
| Action | ~2 to 2.5 min | First hypothesis, the evidence that broke it, isolation method, root cause |
| Result | ~30s | Metrics after the fix, prevention, wider changes |
Inside the Action section, use this pattern: "I believed X because of Y. Then I saw Z, which X cannot explain. So I tested W." It makes your reasoning visible.
Model answer (outline)
Situation. I was on a team that owned an order-processing service handling roughly 4,000 requests per second. A few times a week, some hosts began timing out on calls to a downstream payment service. Error rates on those hosts reached 30 to 40 percent for about 20 minutes, until health checks recycled them, and each episode meant failed orders.
Task. I was on call when it escalated to a Sev-2, and I took ownership of finding the root cause.
First hypothesis. Client-side latency to the payment service spiked in every episode, and that team had recently deployed. A slow dependency was the obvious theory, so I asked them to check their side and considered raising our timeout. This was reasonable because it matched the dashboard and the timeline.
The pivot. Two facts did not fit:
- The payment service's server-side p99 latency was flat during our incidents.
- Only a few of our 60 hosts were affected at a time. A slow dependency hurts all callers, not three hosts.
Distributed traces of failing requests showed the time was spent inside our own process, before the request was sent, waiting to lease a connection from the HTTP client pool. This was pool starvation, not a slow dependency.
Isolation.
- I added a per-host metric for leased versus available connections. On affected hosts, leased connections climbed steadily over hours and never fell. That shape signals a leak, not load.
- Correlating the step increases with logs showed each step coincided with a 503 from the payment service. Those happened briefly during their deployments, which is why the timing looked random to us.
- In staging, I injected 503s at a fixed rate. Leased connections rose by exactly one per 503.
- That led me to our retry wrapper: on non-2xx responses it threw before closing the response body, so the connection never returned to the pool. Once enough errors accumulated, the pool was exhausted and every later call waited out the lease timeout, which surfaced as "payment latency."
Cause versus symptom. The symptom was timeouts on payment calls. The root cause was a connection leak on an error path, triggered by routine deploy-time errors from a dependency. Automatic host recycling had masked it for months.
Fix and prevention.
- Made response handling close the body on every path (try-with-resources).
- Added a test that injects 5xx responses and asserts the pool returns to baseline.
- Set a lease timeout that logs the stack trace of the acquirer, so a future leak identifies its own source.
- Added an alarm on pool utilization above 80 percent sustained for 5 minutes, which warns hours before customers are affected.
- Found the same wrapper pattern in four other services, fixed them, and added a static-analysis rule for unclosed responses.
- Added downstream-error injection to pre-production resilience tests.
Result. No recurrences in the following six months, and host replacements from failed health checks dropped by roughly 90 percent. I also corrected the earlier belief that the payment team was unreliable, and recorded that in the postmortem.
Why this works
- The first theory was defensible, which shows judgment.
- The pivot rests on two concrete pieces of evidence.
- The investigation used varied techniques: tracing, new instrumentation, log correlation, controlled reproduction.
- The causal chain is complete, not just the final bug.
- Prevention covers code, tests, observability, and the same bug class elsewhere.
Common mistakes
- Saying "we" throughout. Use "I" for your actions and credit others accurately.
- Ending with a config tweak. "We raised the timeout" is masking, and interviewers will say so.
- No falsifying evidence. "It didn't work, so we looked elsewhere" sounds like trial and error.
- Details you cannot explain. If you mention a heap dump, expect "what did you look for?"
- No business impact. Quantify both the pain and the improvement.
- Blaming another team and never correcting it. This is a red flag.
- Too much setup. Two minutes on architecture leaves no time for the investigation.
Likely follow-ups
What instrumentation would have helped sooner? Pool utilization metrics and trace spans around connection acquisition would have shown starvation on day one, skipping the downstream-latency detour. Those are now part of our service template.
How did you communicate uncertainty during the incident? I labeled updates explicitly: "Leading hypothesis, confidence medium. Evidence for. Evidence against. Next check." When the evidence flipped, I posted a correction and told the affected team directly. I used a fixed update cadence and kept mitigation (recycling hosts) separate from the investigation of the cause.
What would you do differently? Add resource-level metrics for every pooled resource when a service is first built, rather than relying on request-level latency alone.
Pick your own real incident, keep the numbers honest, and make sure you can explain every technical detail you mention.