API Design Interview Question

What is idempotency in an API?

Updated 2026-07-10 · Beginner friendly
Quick answer

An operation is idempotent if doing it once or many times gives the same result. In APIs this matters because networks fail and clients retry. If DELETE /users/42 is idempotent, calling it twice still just leaves the user deleted, with no harm done. GET, PUT, and DELETE are idempotent, but POST usually is not.

Why it is useful

Imagine a payment request times out. The client is not sure if it worked, so it retries. If the endpoint is idempotent, the retry will not charge the user twice. This is why safe retries depend on idempotency.

In the interview

Mention idempotency keys for POST. Saying you can make create endpoints safe by having the client send a unique key that the server checks shows practical, senior level thinking.

Want the full API Design guide?

Read every API Design concept with notes, diagrams, and code in one place. Track your progress as you go.

Open the API Design guide All API Design questions