FlashcardsRecall, then flip

Print · Idempotency, retries and webhooks

Back to study

24 cards · 3 sheets · 6 pages.

Print double-sided, flipping on the long edge, at 100% scale with no margins added by the browser. Answer columns are already mirrored, so each answer lands on the back of its own question. Cut along the dashed lines.

Preview

Idempotency, retries and webhooks flashcards — questions (cards 1-8)Print double-sided, flip on long edge, cut along dashed lines
CARD 1 · QUESTION

What does idempotent mean for an API?

CARD 2 · QUESTION

Which HTTP methods are idempotent by definition?

CARD 3 · QUESTION

What is an idempotency key?

CARD 4 · QUESTION

How does a server implement idempotency keys?

CARD 5 · QUESTION

Why store a hash of the request body alongside the key?

CARD 6 · QUESTION

How long should idempotency records be kept?

CARD 7 · QUESTION

What happens when two identical requests race?

CARD 8 · QUESTION

Why is exponential backoff with jitter the standard retry policy?

Idempotency, retries and webhooks flashcards — answers (cards 1-8)Columns mirrored so answers align with question backs
CARD 2 · ANSWER

GET, PUT and DELETE. POST is not, which is why create endpoints need explicit idempotency keys. id: 94db9390-aecb-4970-b05d-acc074459348

CARD 1 · ANSWER

Repeating the same request produces the same result and no extra side effects beyond the first successful call. id: 143cacbe-7300-479b-be28-72d3f55f3501

CARD 4 · ANSWER

Store key, request fingerprint and response; on a repeat, return the stored response instead of re-executing. id: e8c0fb7b-f87b-4f4f-a7b1-9db7eb935b6e

CARD 3 · ANSWER

A client-generated unique value sent with a request so the server can recognise and replay a retried call. id: def2748e-452c-4e9d-8c26-986186ba1147

CARD 6 · ANSWER

Long enough to cover realistic retries — commonly 24 hours — then expired to bound storage growth. id: f9876d5c-ae49-49e4-94a3-f5143ae782bc

CARD 5 · ANSWER

To reject a key reused with different parameters, which signals a client bug rather than a genuine retry. id: 9d1295d2-e071-4616-a919-edbe28217b31

CARD 8 · ANSWER

Backoff stops retries amplifying an outage; jitter stops every client retrying in the same synchronised wave. id: 5a9cd35f-8143-4691-9ad7-b4841bd3f2cc

CARD 7 · ANSWER

The second must block or fail fast; a unique constraint on the key is what actually enforces exactly-one execution. id: b865ea6d-4e98-4f4d-be41-6d591ad86a3a

Idempotency, retries and webhooks flashcards — questions (cards 9-16)Print double-sided, flip on long edge, cut along dashed lines
CARD 9 · QUESTION

Which failures should you not retry?

CARD 10 · QUESTION

What is the thundering herd problem in retries?

CARD 11 · QUESTION

What does a circuit breaker do?

CARD 12 · QUESTION

Why do webhooks use at-least-once delivery?

CARD 13 · QUESTION

How should a webhook consumer handle duplicates?

CARD 14 · QUESTION

How are webhooks authenticated?

CARD 15 · QUESTION

Why must you verify the signature on the raw body?

CARD 16 · QUESTION

How do you prevent webhook replay attacks?

Idempotency, retries and webhooks flashcards — answers (cards 9-16)Columns mirrored so answers align with question backs
CARD 10 · ANSWER

A downstream recovers and every waiting client retries at once, knocking it straight back over. id: 5cf72589-2777-4bc5-921a-6e9a1033f52a

CARD 9 · ANSWER

4xx client errors other than 429 — the request is wrong, so retrying just burns quota and hides the bug. id: daff6172-9fed-4c41-a7c5-0c04fd0f29c3

CARD 12 · ANSWER

The sender cannot know whether a lost response means the receiver processed the event, so it retries and may duplicate. id: f4d741c9-8179-40b3-8339-0a4f12d82561

CARD 11 · ANSWER

After repeated failures it stops calling a dependency for a cooldown, then lets a trial request test recovery. id: 1bd72dd9-b44b-403f-ab4e-c82818743b25

CARD 14 · ANSWER

An HMAC signature over the raw body with a shared secret, verified before parsing and in constant time. id: f476c29d-16f6-4dae-8e33-e59dfaeaad04

CARD 13 · ANSWER

Treat the event ID as an idempotency key and record processed IDs, so replays are recognised and dropped. id: 397f95d2-7394-4345-9955-2fa1330b5506

CARD 16 · ANSWER

Include a timestamp in the signed payload, reject anything outside a short window, and dedupe on event ID. id: c0c42862-c9aa-47f5-b03b-735a0ae43c70

CARD 15 · ANSWER

Parsing and re-serialising changes bytes, so the computed HMAC no longer matches the sender's. id: c2cd13b2-bc7d-4a7d-a0ce-0c7259c1ab21

Idempotency, retries and webhooks flashcards — questions (cards 17-24)Print double-sided, flip on long edge, cut along dashed lines
CARD 17 · QUESTION

Why should a webhook handler return 200 immediately?

CARD 18 · QUESTION

Can webhook events arrive out of order?

CARD 19 · QUESTION

What is the dual-write problem?

CARD 20 · QUESTION

What is the transactional outbox pattern?

CARD 21 · QUESTION

What is a dead letter queue for?

CARD 22 · QUESTION

What is a poison message?

CARD 23 · QUESTION

Why is exactly-once delivery a myth in practice?

CARD 24 · QUESTION

Interview one-liner: how do you make a payment or provisioning flow safe under retries?

Idempotency, retries and webhooks flashcards — answers (cards 17-24)Columns mirrored so answers align with question backs
CARD 18 · ANSWER

Yes. Carry a version or sequence number per resource and ignore an event older than the state you already hold. id: 9a699e97-94e3-45df-afad-1a939ea041bd

CARD 17 · ANSWER

Acknowledge, enqueue, then process asynchronously — slow handlers cause sender timeouts and needless retries. id: a56aa4f6-1839-4be8-9978-96c0612991de

CARD 20 · ANSWER

Write the event to an outbox table in the same transaction, then a relay publishes it after commit. id: 2cd904d4-318d-4de1-87d1-136e0e1ab1c9

CARD 19 · ANSWER

Committing to your database and publishing an event are separate operations; a crash between them loses one. id: fda784b2-2b0e-4243-bfee-5ded27c42995

CARD 22 · ANSWER

One that fails deterministically every time — retrying it forever blocks the queue, so it belongs in the DLQ. id: 43d49e2b-7bc5-4b9f-89f4-0e9023e2d82a

CARD 21 · ANSWER

Parking messages that failed every retry, so the pipeline keeps moving and failures can be inspected later. id: 5a15d923-95c3-403b-9779-0c4f4fcceecc

CARD 24 · ANSWER

Idempotency key at the edge, outbox for events, dedupe by event ID at the consumer, DLQ for what still fails.

CARD 23 · ANSWER

You get at-least-once delivery plus idempotent processing, which yields exactly-once effects. id: 485b2414-c07f-4702-8f2a-f1213e5cec61