Skip to content

Interview question · Tool Calling & Tool Contracts

Make a refund tool safe to call twice.

Everyone says 'idempotency key'. The interview is in the details: where the key comes from, how it is stored with the refund, what a repeat returns, and what happens when the payment processor is the one that timed out.

mediumEssentialNewUpdated Nov 2026

Everyone says 'idempotency key'. The interview is in the details: where the key comes from, how it is stored with the refund, what a repeat returns, and what happens when the payment processor is the one that timed out.

Make your first attempt

Before you read on, answer it yourself

  1. 01 State the assumptions your answer depends on.
  2. 02 Explain the mechanism and choose a control.
  3. 03 Say what fact, if it changed, would flip your answer.

Then open the worked answer: the approach, how a panel scores it, and the follow-ups. Check where your reasoning diverged.

6 answers per topic instead of 5, plus saved progress and bookmarks · costs nothingor unlock all 237 remaining answers · $25

All 19 topics with every worked answer, all lessons and courses, the full practice bank, and anything new that appears during your access.

6 months · One payment · No auto-renewal

What if · follow-ups that change one fact

The answer works through 4 follow-ups like an interviewer would

Your refund tool now derives keys from intent and the service stores them with each refund.

  1. What if the service checks for the key, then inserts the refund, in two separate statements?
  2. What if the payment processor call times out?
  3. What if keys expire after 24 hours and the run resumes after three days?
  4. What is the one-sentence design?

Each rung has a nudge, a model answer, the principle that carries over and the weak answer to avoid. Premium opens every answer and ladder.

UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.