Skip to the page

Real-time APIs · Scenario

A partner got the same webhook three times

The interviewer asks

A partner complains that our order.delivered webhook reached them three times for the same order, and their system raised three invoices. They want us to 'send it only once'. What do you look at, and what do you tell them?

Then

Follow-ups the interviewer asks next

  1. Can we promise exactly once? Why not?
  2. What do our delivery logs say about the three attempts?
  3. What should the partner's side do?
  4. What can we change to make this rarer?
  5. What must stay the same across retries?
  6. How do you answer the partner without blaming them?
  7. How do you avoid hammering a partner who is down?

The answer

What a strong answer covers

  • Exactly once is impossible over HTTP: when our request times out, we can't know whether they processed it. We deliver at least once, and the docs must say so.
  • The logs: attempts 1 and 2 hit our 10 s timeout, but the partner finished both and returned 200 after about 13 s; attempt 3 succeeded quickly. All three carried the same event id.
  • Their side: answer 2xx fast (store the event, process it in the background) and dedupe by event id under a unique constraint.
  • Our side: the same event id and payload on every retry, exponential backoff with jitter, a documented timeout (10–15 s), a log of every attempt (status, duration), and a dashboard and resend button for partners.
  • Signing: every delivery signed with a timestamp, so receivers can verify it and reject old replays.
  • Partners who are down: per-endpoint backoff, a limit (for example 24 hours of retries), then disable the endpoint and email them; one slow partner must not delay others.
  • Communication: share the timeline, explain at-least-once and the event id, send sample dedupe code, and offer an events API (GET /events?since=) to fetch anything missed.

The red pen

Common traps

Avoid:promising exactly once; a new event id on each retry; very long timeouts that let one slow partner block the queue.

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise 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.

Start your free interview