Opend
← All company guides

Free interview prep

Get ready for
Stripe.

Reliable APIs · payments · retries

Stripe · Opend practice case · Updated

Can two checkout retries create one payment?

Order A17 costs $48. A slow checkout causes a browser retry at the same moment a worker retries a timed-out API call. Neither caller knows whether the first request succeeded. Describe what your service records before it talks to Stripe.

Short answerGive a logical payment attempt one durable identity. Replay that attempt with its original key and parameters, and reconcile its payment state when the outcome is ambiguous.

Two callers converge on payment attempt A17-1
  • Browser and worker

    Both request payment for order A17, attempt 1.

  • One durable attempt

    A unique order-and-attempt record owns the key, amount, currency and status.

  • One downstream identity

    Every replay reads that row. The provider response or a reconciled event resolves it.

Separate a retry from a second purchase

Start with the business invariant. Two tabs can send different HTTP request IDs for the same checkout. Have the service assign the attempt identity and compare the requested amount and currency with the saved record. Concurrent inserts race on a unique constraint. The loser loads the winning row and returns its status. A customer deliberately starting a second payment after a declined attempt follows a separate business transition.

Explain the limit of the provider key

For Stripe API v1, an idempotent replay can return the original error response, including a 500 after execution began. Generating a fresh key to clear that error risks another operation. Retrieve the known payment object when possible and keep unresolved attempts available for reconciliation. Keep the order-to-payment mapping beyond the provider’s key retention window so a late client retry cannot silently become a fresh purchase.

Stripe API v1 idempotency semantics ↗

Fulfil the order once

Webhook delivery introduces a second duplication boundary. Store the event durably, acknowledge it and process it asynchronously. Make fulfilment conditional on the order’s current state and payment identity. Separate events may describe the same business outcome, so checking the event ID alone is insufficient. Test a successful payment followed by a late notification for an earlier state. The receipt should remain issued exactly once.

Stripe webhook delivery and event ordering ↗
Three requests that look similar in a log
InputAttempt recordDecision
A17 · $48 · timeoutA17-1 existsRecover original result
A17 · $84 · same keyAmount differsReject the conflict
A18 · $48 · new orderNew instructionCreate its own attempt
Try the follow-upWhat if the payment succeeded and the process crashed before sending the receipt?

Recover the payment identity, then transition the order to paid and create a uniquely keyed fulfilment task in one database transaction. The task needs its own delivery semantics. Charging safely does not by itself make sending an email or issuing a ticket idempotent.

Interview rounds & focus areas

Prepare for engineering conversations about APIs and reliable money movement. This is a practice plan, not a confirmed Stripe interview sequence; ask your recruiter for the loop for your role.

  1. PREP FOCUS 01

    Coding & problem solving

    Practice a small, testable solution. Explain data structures, complexity and edge cases aloud.

  2. PREP FOCUS 02

    LLD / HLD

    Model a payment state machine. Explain idempotency, reconciliation and what happens when a client times out.

  3. PREP FOCUS 03

    Practical systems & work discussion

    Walk through one project you shipped: the constraint, your decision, a failure, and the result you can substantiate.

More practice questions

Try each Opend practice question before opening its hints.

How would you make a payment request safe to retry?Backend / system design · Open solution hints
  1. Define the invariant: one business operation must not create two charges.
  2. Scope an idempotency key to the caller and operation; atomically store its request fingerprint and result.
  3. Test simultaneous retries, reused keys with different bodies, and a timeout after the external charge succeeds.
How would you process duplicate, out-of-order webhooks?Practical systems · Open solution hints
  1. Authenticate the event before accepting it, then acknowledge after durable storage.
  2. Deduplicate event IDs and separate transport retries from business-state transitions.
  3. Reconcile against authoritative state; do not assume arrival order is event order.
What should I explain about a project I shipped?Work discussion · Open solution hints
  1. Choose one real constraint and explain the tradeoff you owned.
  2. Show the failure case you tested and one measured result. Be explicit about what you did versus the team.

Live open roles at Stripe

Employer sources checked within seven days. This catalogue covers India and worldwide remote engineering openings; confirm location and availability on the employer’s site.

View live roles & check your fit →

Get a free personal fit check →