11
A service must give the same result when clients retry the same request. How would you implement that?
Tap to write answer
0 words | 0 charsPress Enter ↵ to reveal
Your Attempt
0 wordsRefined Model Answer
ReferenceI would use an idempotency key and associate it with the operation result or current state. When the same key arrives again, the service would return the earlier result instead of doing the work twice. The reason I choose this is that retries are expected in distributed systems, and correctness should not depend on perfect network delivery. I would also think about expiration for stored keys and how to handle cases where the first request is still running. This pattern is especially important for checkout, payments, and other state-changing actions.