WORKED CASE

The client never saw the response, so it sent the payment again

Read the situation, decide what you would do first, then check what a good answer has to contain.

SYNTHETIC / TRAINING ONLY

THE SITUATION

Bank Alfa's payment API times out on the client side. The client retries. The second request succeeds and returns a payment identifier.

A day later the beneficiary at Nordbank has been paid twice, and the first request's response is in the logs — it succeeded, and the client never received it.

YOUR TASK

You are the engineer on the payment service. Say where the duplicate should have been stopped, and why stopping it in exactly one place would not have been enough.

Then take the case one step further: the retry arrives while the first request is still in flight, not after it has finished. Say what your design does then, and whether the answer you gave a moment ago still holds.

Answer it yourself

Kept in this browser, and saved to your account when you are signed in. Nothing is marked by us and nothing here reaches a credential.

Try it yourself first. The full write-up is below either way, but reading it before you write is the part that does not teach.

WHAT A GOOD ANSWER CONTAINS

A strong answer refuses the single-cause framing. A retry after a timeout is correct client behaviour; the design has to make it safe rather than discourage it.

It names layers and says what each one can and cannot promise. The transport can say a method is safe to repeat. A key supplied by the client can make the service recognise a repeat. A uniqueness constraint at the point of record is what makes the guarantee survive a service that was restarted mid-write. A scheme-level duplicate flag tells the next participant that a message may be a repeat, which is a different problem again.

The strongest answers say what happens when the retry arrives while the first request is still in flight. A key alone does not settle that case. It is also the case that shows whether somebody has built this or read about it.

THE ROLES THIS EXERCISES