📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

Present an RCA to me as you would to engineering leadership, in about ten minutes. Use a real incident you were close to, or this one: a release added automatic retries to the payment provider call, and over an afternoon about 1,200 customers were charged twice. Walk me through the summary, impact, timeline, root cause, contributing factors and the actions, and be ready for me to ask how you know each claim.

Presenting a full RCA under questioning: the structure (summary, impact, timeline, root cause, contributing factors, what went well, actions), backing each claim with evidence, using a worked example of duplicate payment charges caused by retries without idempotency keys.

Senior RealWorldScenario Advanced idempotency payments polly postmortem production rca

🎯 Key points

  • Lead with a three-sentence summary: what happened, impact, current state
  • Impact in numbers: customers, transactions, money, data, duration, from reconciliation
  • Timeline with trigger, impact start, detection, mitigation, recovery in UTC
  • Root cause as a system condition: POST /charges is not idempotent without a key, and retries were added without one
  • Contributing factors in context (retries added to fix real timeouts; tests never simulated timeout-after-success; no business-invariant alert)
  • What went well and lessons learned, so good practices are kept and spread
  • Customer remediation and transparent communication: refunds, apology, support script
  • Answer 'how do you know?' with a query, log or diff, and say 'we don't know yet' when true

⏱ 30-second answer

I structure it so leadership gets the answer in the first minute: a three-sentence summary (what happened, impact, current state), then impact in numbers, a UTC timeline of trigger, impact, detection, mitigation and recovery, the root cause as a system condition, contributing factors, what went well, lessons learned and three to five owned actions, including customer remediation and communication. In the payments example: a release added retries to fix real provider timeouts, but POST /charges creates a new charge on every call unless it carries an idempotency key, which the provider uses to return the first result for a repeat. Ours sent none, so a timeout after the provider had charged the card produced a second charge. Detection took hours because alerts watched errors, not duplicates. Every claim links to evidence. The trade-off: brevity for leadership versus detail for engineers, so I keep the detail in an appendix.

🗣 Full answer (senior)

How I would answer this in an interview

"I'll use the duplicate charge incident, and I'll present it the way I would to leadership: summary first, detail on request.

Summary: on [Tuesday] a release added automatic retries to our payment provider call. When the provider was slow, our client timed out after it had already charged the card, retried, and charged again. About 1,200 customers were charged twice, around [$96,000] in duplicates, over 3 hours 40 minutes. Everyone has been refunded and the retries are disabled. Impact: 1,212 customers, 1,240 duplicate charges, no data exposure, plus [N] support calls. I know those numbers from reconciling the provider's settlement export against our orders table, not from logs. Timeline in UTC: release at 01:05; the provider's latency rose at 02:20 and duplicates started; support raised the first ticket at 04:30; we disabled retries with a feature flag at 05:45; the reconciliation and refunds finished the next day. So detection took over two hours, which is the number that worries me most.

Root cause: we retried a non-idempotent operation without an idempotency key, so the provider couldn't tell a retry from a new payment. Contributing factors: the retry policy was added as a generic resilience improvement and the review didn't ask whether the call was safe to repeat; our tests stubbed the provider and never simulated 'timeout after success'; and our alerts watched error rate, which stayed normal, while nothing watched duplicate charges. What went well: the feature flag let us switch retries off in seconds, and the idempotent order table made reconciliation fast. Actions, each with an owner and date: idempotency keys on every payment call, a contract test for timeout-after-success, an alert on charges per order above one, and a review checklist rule that retries need an idempotency story. The lesson I'd leave leadership with: resilience features can create incidents when they ignore whether an operation is safe to repeat."


The structure

Section Time Content
Summary 1 min What happened, impact, status now
Impact 1 min Customers, transactions, money, data, duration
Timeline 2 min Trigger → impact → detection → mitigation → recovery (UTC)
Root cause 1 min The system condition, in plain words
Contributing factors 2 min Review, tests, detection, response
What went well 30 s Things to keep
Actions 2 min 3–5, owner, date, done-when
Questions rest Evidence on request

Claim → evidence

Claim How I know
1,212 customers, 1,240 duplicates Provider settlement export joined to Orders by idempotency gap
Duplicates started 02:20 Provider latency dashboard + first duplicate timestamp
Retries caused it Dependency telemetry shows two POSTs per order 1–2 s apart, release diff adds retry
Detection at 04:30 First support ticket, no alert fired

Production example

With the actions in place, a later provider slowdown produced 3,400 retries and zero duplicate charges, because the provider returned the original result for each repeated idempotency key; the new duplicate-charge alert stayed quiet as it should.

🔍 What the interviewer is checking

Checks whether the candidate can communicate a complete, evidence-based RCA to senior stakeholders and defend it under questioning.

Green flags

  • Summary first, then impact in numbers, then detail
  • Root cause expressed as a system condition, with clear contributing factors
  • Links each claim to evidence and admits what is unknown
  • Includes customer remediation and what went well
  • Few, owned, verifiable actions

Red flags

  • A long chronological story with no summary
  • Blames the engineer who made the change
  • Numbers with no source, or bluffing under questioning
  • Only technical fixes, no detection or customer actions

📚 Learn in depth

1. Why summary first

Leaders decide things (refunds, customer communication, investment) and need the answer before the story. Engineers need detail. The pyramid structure serves both:

            summary (what, impact, status)
          impact numbers + key timeline
       root cause + contributing factors
   evidence, queries, graphs (appendix, on request)

2. The failure mechanism in the example

client                      provider
  | POST /charges (t=0)        |
  |--------------------------->| charge card  (success, slow)
  | timeout at 10 s            |
  |   (response lost)          |
  | retry POST /charges        |
  |--------------------------->| charge card again  <-- duplicate
  |<---------------------------| 201

A timeout tells you nothing about whether the server did the work. Retrying is only safe if the operation is idempotent. Payment providers support this with an idempotency key header: the provider stores the first result for that key and returns it for repeats.

3. Why the alerts missed it

Every request ended in success from the client's point of view. Error-rate and latency SLIs were normal. The damage was a business invariant breach (one charge per order), which only a business-level check sees:

customEvents
| where name == "PaymentCaptured"
| summarize charges = dcount(tostring(customDimensions.ProviderChargeId)) by orderId = tostring(customDimensions.OrderId), bin(timestamp, 5m)
| where charges > 1
| summarize ordersWithDuplicates = count() by bin(timestamp, 5m)

4. Handling 'how do you know?'

Every claim should map to an artefact: a query, a diff, a dashboard, a ticket. When you don't know, say so and say when you will: "we believe no other merchants were affected; the reconciliation for the second merchant account finishes tomorrow." Confident guesses destroy credibility faster than honest uncertainty.

5. Customer remediation is an action too

Refunds, apology emails and support scripts are part of the RCA actions with owners and dates. Under Australian Consumer Law customers are entitled to refunds for charges they didn't authorise, and the payment provider may also see chargebacks if refunds lag.

6. Keeping it blameless when the change is recent and visible

Everyone knows who added the retry policy. Present the decision in context: retries were added to fix real timeouts, the review checklist didn't cover idempotency, and the test harness couldn't simulate timeout-after-success. That is accurate and keeps people talking.

Try it yourself

  1. Write a three-sentence summary of your last incident and time yourself reading it aloud.
  2. For each claim in a past RCA, add the query or artefact that proves it; mark the ones you can't support.
  3. Build a stub payment server that succeeds slowly, call it through a Polly retry pipeline with a short timeout, and observe duplicate processing.
  4. Add an Idempotency-Key header and server-side de-duplication to the stub and show the repeat returns the first result.
  5. Write a KQL or SQL check for a business invariant in your system (one charge per order, one email per signup).

💻 Code

The root cause fix: retries are only safe with an idempotency key that stays the same across attempts. The key is derived from the order, not generated per attempt.

namespace Payments;

using System.Net.Http.Json;
using Microsoft.Extensions.Http.Resilience;
using Polly;

public sealed record ChargeRequest(Guid OrderId, long AmountCents, string Currency);
public sealed record ChargeResult(string ChargeId, string Status);

public sealed class PaymentsClient(HttpClient http)
{
    public async Task<ChargeResult> ChargeAsync(ChargeRequest request, CancellationToken ct)
    {
        using var message = new HttpRequestMessage(HttpMethod.Post, "v1/charges")
        {
            Content = JsonContent.Create(request)
        };
        // Same key for every attempt of this order's charge: the provider returns the
        // original result for a repeat instead of charging again.
        message.Headers.Add("Idempotency-Key", $"order-{request.OrderId:N}");

        using var response = await http.SendAsync(message, ct);
        response.EnsureSuccessStatusCode();
        return (await response.Content.ReadFromJsonAsync<ChargeResult>(ct))!;
    }
}

public static class PaymentsRegistration
{
    public static IServiceCollection AddPaymentsClient(this IServiceCollection services, Uri baseAddress)
    {
        services.AddHttpClient<PaymentsClient>(c => c.BaseAddress = baseAddress)
            .AddResilienceHandler("payments", pipeline =>
            {
                // Retrying a POST is acceptable here ONLY because of the idempotency key above.
                pipeline.AddRetry(new HttpRetryStrategyOptions
                {
                    MaxRetryAttempts = 2,
                    BackoffType = DelayBackoffType.Exponential,
                    UseJitter = true
                });
                pipeline.AddTimeout(TimeSpan.FromSeconds(10)); // per attempt
            });
        return services;
    }
}
-- Reconciliation that produced the impact numbers: orders with more than one settled charge
SELECT s.OrderId, COUNT(*) AS Charges, SUM(s.AmountCents) / 100.0 AS TotalCharged
FROM dbo.ProviderSettlements AS s
WHERE s.SettledAt >= '2026-06-09T01:05:00' AND s.SettledAt < '2026-06-09T06:00:00'
GROUP BY s.OrderId
HAVING COUNT(*) > 1;

⚠ Common mistakes

  • Mistake: Starting with the story instead of the summary. Why it is wrong: Leadership loses the thread and asks for the bottom line anyway. Instead: Open with what happened, impact and current status in three sentences.
  • Mistake: Impact from logs or memory. Why it is wrong: Retries, sampling and estimates make numbers wrong, and money decisions depend on them. Instead: Reconcile against the source of truth and say how you got the number.
  • Mistake: Root cause as a person or a change ("the retry PR"). Why it is wrong: It doesn't explain why the system allowed it. Instead: State the condition: the charge endpoint creates a new charge per call unless given an idempotency key, and retries were added without one.
  • Mistake: Describing the retry change without its rationale. Why it is wrong: "Someone added retries" sounds like blame and hides the real lesson. Instead: Explain it was a reasonable fix for genuine provider timeouts, and that the gap was in the review checklist and test harness, which didn't ask whether the call was safe to repeat.
  • Mistake: Skipping detection as a factor. Why it is wrong: The 2-hour detection gap drove most of the impact. Instead: Treat detection and response as contributing factors with actions.
  • Mistake: Bluffing when asked "how do you know?". Why it is wrong: One unsupported claim undermines the whole RCA. Instead: Point to the evidence, or say what is still unknown and when it will be.
  • Mistake: Forgetting customer remediation and communication. Why it is wrong: The technical fix doesn't refund anyone, and silence about money taken twice erodes trust fast. Instead: Include refunds, a clear apology email, a support script and a timeline for customers as owned actions.
  • Mistake: No "what went well" or lessons learned. Why it is wrong: Good practices that limited impact (the feature flag, the idempotent order table) get lost or removed. Instead: Name them and spread them to other services.
  • Mistake: Twenty actions. Why it is wrong: Leadership can't fund or track them. Instead: Three to five high-leverage actions, details in an appendix.

🏛 Senior insight: trade-offs

Presenting an RCA is a test of judgement as much as analysis: what to leave out, how to state uncertainty, and how to describe a visible human decision without blame. I aim for leadership to leave knowing the impact, that customers are being looked after, the one systemic lesson, and what we need from them (usually time or budget for the platform action).

The technical lesson in this example generalises: resilience patterns (retries, hedging, replays from a queue) are only safe when the operation is idempotent. I make "what makes this safe to repeat?" a standard review question for any retry policy.

Option for retries on writes When it fits Cost When not to
No retry, surface error Non-idempotent call, no key support User may retry manually High-volume transient failures
Retry with idempotency key Provider supports keys (most payment APIs) Key design and storage Provider ignores the header
Status check before retry No key support, query API exists Extra call, race windows High latency budgets
Async with outbox and de-duplication Internal services More moving parts Simple synchronous needs

🔗 Follow-ups the interviewer may ask

  1. When: Candidate presents the timeline Why: Checks how they built the timeline and handled data quality.
    How to answer

    The timeline comes first because every later step (root cause, contributing factors, actions) has to be argued from evidence, and memories after a stressful night are wrong in predictable ways. I build it from deployment and config history, the Azure Activity Log, alert history, KQL queries over Application Insights / Log Analytics for the per-minute failure rate, and the incident chat channel. Each entry has a UTC timestamp, the source, what happened and a link to the evidence. I mark the key moments, trigger, impact start, detection, mitigation, recovery, which give time to detect, mitigate and recover. I watch for clock skew and log ingestion delay, which can put a cause after its effect, and I record what responders knew at the time to avoid hindsight bias. The trade-off: a thorough timeline takes hours, so I build a skeleton within a day while data is still retained and refine it before the review.

  2. When: Candidate quotes impact numbers Why: Checks how they measured blast radius and separated estimates from facts.
    How to answer

    Blast radius is the impact across several dimensions: the time window, who was affected (users, customers, tenants, regions), what failed (requests, orders, payments), money, and data, both corrupted and exposed. I give a quick estimate with a range within the hour from telemetry, then exact numbers later. The impact window comes from SLI telemetry, and distinct affected users from request telemetry keyed on an authenticated user or customer id, using KQL in Application Insights. Failed requests aren't the whole story, so I reconcile the database for duplicates, missing or wrong records. If personal data may have been exposed, the clock starts on a Notifiable Data Breaches assessment under the Privacy Act 1988 (30 days at most). The trade-off: speed versus precision, so I always state assumptions and confidence.

  3. When: Candidate uses their own incident Why: Checks how they handled the incident itself, from alert to mitigation and communication.
    How to answer

    Pick a real incident where you played a clear role, and tell it in STAR order in about two minutes. Situation: the system, scale and impact in numbers (users, minutes, error rate). Task: your role — responder, incident commander, or the person who found the cause. Action: how it was detected, how you triaged and set severity, how you mitigated first (rollback, flag, failover), how you investigated with named tools (Application Insights and KQL, distributed traces, dotnet-counters, Query Store), and how you communicated. Result: time to mitigate, what the contributing factors were and which system changes came out of the postmortem, with a number that shows it worked.

    The trade-off interviewers listen for: you restored service before chasing the root cause, and you fixed the system rather than blaming a person.

🛠 Real-world problems: how you handle them

Retries without idempotency keys double-charge 1,212 customers
Situation
An e-commerce checkout at [company] on Azure, processing [N] payments an hour through an external payment provider. A release added a generic retry and timeout policy to all outbound HttpClients to reduce transient failures.
Signals
No error or latency alerts; first support ticket two hours in from a customer charged twice; social media complaints; the provider's dashboard showed settlements above order count.
Investigation
Application Insights dependency telemetry showed two POSTs to the provider 1–2 s apart for affected orders; the release diff added the retry handler; the provider's latency status showed a slowdown from 02:20 UTC; the settlement export reconciled against the `Orders` table gave exact counts.
Resolution
Immediate: disabled retries for the payments client via a feature flag and refunded all duplicates through the provider API. Long term: idempotency keys derived from order id on every charge, contract test simulating timeout-after-success, duplicate-charge alert on a business invariant, customer apology email.
Prevention
Review checklist: every retry policy on a write needs an idempotency story; resilience defaults in the shared HttpClient template exclude non-idempotent methods unless opted in; business invariant alerts for payments; game day with a slow provider stub.

How to tell it (STAR)

**S:** At [company] a release added automatic retries to our outbound HTTP calls, including the payment provider, and over an afternoon [about 1,200] customers were charged twice. **T:** I [led the RCA] and presented it to engineering leadership and the head of customer service. **A:** I reconciled the provider's settlement export against our orders for exact impact, built a UTC timeline that showed a two-hour detection gap, and framed the root cause as retrying a non-idempotent call without an idempotency key. We added idempotency keys, a timeout-after-success contract test, a duplicate-charge alert and a review rule for retries on writes. **R:** Every customer was refunded within [24 hours], and a later provider slowdown caused [3,400] retries with zero duplicate charges.

↩ Usually asked after

More in RCA

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me