What is Idempotency?
An operation is idempotent if performing it multiple times has the same effect as performing it once. Idempotency is what makes retries safe: a repeated request must not double-charge, double-create, or otherwise compound its effect.
Free to start · 7-day trial on paid plans
In depth.
Networks are unreliable, so clients retry. If a payment request times out, the client does not know whether it succeeded, so it retries, and without idempotency that retry could charge the customer twice. Idempotency is the property that makes that retry safe. In HTTP, GET, PUT, and DELETE are defined as idempotent, while POST generally is not, which is why creating resources needs extra care.
The standard mechanism is an idempotency key: the client sends a unique key with the request, the server records the result against that key, and any repeat with the same key returns the stored result instead of doing the work again. Payment APIs (Stripe, PayPal) and any system that moves money or creates records rely on this.
Testing idempotency is a high-value QA skill: send the same request twice (and concurrently) and assert the effect happened exactly once, the second call returns the same result, no duplicate row, no second charge. It is closely tied to retries, exactly-once semantics, and reconciliation, and it comes up constantly in SDET and fintech interviews.
Why interviewers ask about this.
Idempotency is one of the highest-signal topics for SDET, backend, and fintech QA interviews. Being able to define it and describe how you would test an idempotent endpoint under retries and concurrency demonstrates real distributed-systems testing maturity.
Example scenario.
A payment endpoint accepts an idempotency key. The test sends the same charge request twice with the same key, including two requests firing concurrently, and asserts exactly one charge is created and both responses are identical. A bug surfaces: under concurrency, two rows are created because the key check is not atomic.
Interview tip.
Define idempotency (same effect no matter how many times you apply it), connect it to safe retries and idempotency keys, and describe a concrete test: duplicate and concurrent requests asserting the effect happened exactly once.
Frequently asked questions.
What is an idempotency key?
A unique value a client sends with a request so the server can recognise a retry. The server stores the result against the key and returns that stored result for any repeat, ensuring the operation happens only once even if the request is sent multiple times.
How do you test that an API is idempotent?
Send the same request multiple times (and concurrently) with the same idempotency key and assert the effect occurred exactly once, no duplicate record, no second charge, and identical responses. Concurrency often reveals non-atomic key checks.
Related Terms
Explore related glossary terms to deepen your understanding.
Related Resources
Dive deeper with these related interview prep pages.
Free QA career tools, no account needed
Instant and private, everything runs in your browser. Try them before you sign up.
QA Resume Checker
Instant 0-100 score on automation keywords, impact, and ATS formatting.
QA Cover Letter Generator
A tailored 3-paragraph QA cover letter from your resume and a job post.
QA Application Tracker
Drag-and-drop kanban to track every QA application from Applied to Offer.
QA Take-Home Test Generator
A realistic take-home assignment with a scenario, tasks, and a rubric.
QA LinkedIn Headline Generator
A recruiter-searchable headline, About section, and skills list.
QA STAR Story Builder
Structure a QA behavioral answer with the STAR method and instant checks.
QA Bug Report Generator
Build a clean, reproducible bug report for Markdown, Jira, or plain text.
Boundary Value Analysis Generator
Generate boundary value and equivalence partitioning test cases from a range.
QA Metrics Calculator
Calculate DRE, defect leakage, defect density, and pass rate with interpretation.
QA Test Plan Generator
Build a structured test plan (scope, approach, criteria, risks) in Markdown.
Ready to Ace Your QA Interview?
Practice explaining idempotency and other key concepts with our AI interviewer.
Join 1,200+ QA engineers already practicing with AssertHired.
Start your free QA interview