InterviewBuddy
All interview questions

How would you make a create-payment API safe to retry?

Advanced

Answer

Use a caller-scoped idempotency key, bind it to the request payload, and persist a result that repeated requests can retrieve.

Explanation

Handle concurrent attempts atomically and coordinate with the payment provider's idempotency mechanism.

Example

The same key and payload return the original payment instead of creating another.