A client sends a POST request to create a payment, the response never arrives because of a timeout, and the client retries the request. How do you make sure the money isn't charged twice?
~4 min by voice
How to approach it
This checks whether the candidate understands how to make a non-idempotent operation safe to retry: an idempotency key, atomically recording the key in the database, handling races and in-flight requests, and idempotency along the whole chain to the payment provider.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.