Moderate Idempotency Question 105 of 226

Why is PUT idempotent by contract while POST is not?

Java Specialist · Speak this in 60–90 seconds · Faridabad & Delhi NCR

PICTURE THIS: HOW TO EXPLAIN IT

IdeaIdempotency
HowWhat happens inside
Why they askShows real use

Simple meaning

PUT of the same body to the same URL should leave the resource in the same state no matter how many times you retry.

1

WHY — Idempotency instead of guessing?

Why interviewers care about Idempotency:

They are checking judgment

on Idempotency.

A good answer names

the situation, the default choice, and one exception - that reads as experience.

Stay structured

Name the idea, why it exists, then one short example.

Close cleanly

End with when you use it and one common pitfall.

2

STEPS — What happens step by step?

Before you speak the answer, walk the interviewer through these steps:

  1. 1
    PUT of the same

    body to the same URL should leave the resource in the same state no matter how many times you retry.

  2. 2
    POST create is allowed

    to insert a new row on every call, so a timeout plus retry can double-charge.

  3. 3
    Product APIs therefore put

    an Idempotency-Key on POST /payments.

  4. 4
    Give an example

    One tiny concrete case you can say aloud.

  5. 5
    Common mistake

    What juniors usually get wrong.

  6. 6
    Close

    When you pick this over the alternative.

3

EXAMPLE — See it in action

Here's a short line you can speak, broken into clear beats:

Say this line
“POST create is allowed to insert a new row on every call, so a timeout plus retr”
Break into beats
POSTcreateisallowedtoinsert
Speaking order
2987408337471632900

Note: Adapt this scaffold to your own project — keep it under 60–90 seconds.

Key takeaway

PUT of the same body to the same URL should leave the resource in the same state no matter how many times you retry. POST create is allowed to insert a new row on every call, so a timeout plus retry can double-charge.

Chat with us