Concurrency & payments · Design under changing requirements
Captured, then authorised again
Updates to one order arrive late, twice and out of order. How do you design the write so the row still ends up right?
Thursday 10:05 · order-serviceIllustrative scenario, not a real incident
Finance: 58 orders show Authorised after their money was taken, and 9 show twice the amount
The order service keeps one row per order, with a status and a captured_amount. The checkout tells it by API call when a card is authorised. The payment service tells it when the money is captured.
Since Tuesday the capture notice travels as an event on a queue, where before it was a direct call. The provider's own report is right for every one of these orders: one authorisation, one capture.
What the dashboards and logs show
- Rows going backwards
- 58 orders: captured at the provider, AUTHORISED in the table
- Doubled amounts
- 9 orders with captured_amount at twice the order total
- Provider report
- one authorisation and one capture per order, all as expected
- Errors
- none: every update returned success
Clarify · optional · scored under "Hypothesis before change"
Ask the interviewer
0 of 3 asked
Each question reveals a fact. What you ask before you act is part of your score.
First move · scored under "Mitigate before root cause"
Finance is about to run payouts from these rows. What do you do first?
Your rubric score, the model answer, the follow-up questions and the related lessons appear once you have answered the last step.