11
How would you make a request safe to retry without creating duplicates?
Tap to write answer
0 words | 0 charsPress Enter ↵ to reveal
Your Attempt
0 wordsRefined Model Answer
ReferenceI would use an idempotency key and store it with the result or current processing state. If the same key appears again, the service can return the previous result instead of repeating the action. The reason I choose this is that retries are normal in distributed systems and the business flow should stay correct even when the network is unreliable. I would also think about key expiration, partial failures, and whether the first request is still in progress when the retry arrives. This is especially important for payments and order submission.