# Razorpay interview prep

## How do you recover a payout when the bank’s response is missing?

Original Opend practice case · Updated 2026-11-30

[Cite this case](https://opend.in/prep/razorpay#payout-recovery)

Imagine a vendor dashboard paying invoice V-42 for ₹12,500. The vendor clicks once. Your worker sends the request, waits five seconds and loses the connection. Support sees an unpaid invoice. What would let them retry safely?

**Short answer** — Persist one payout instruction and its idempotency key before dispatch. A timeout leaves that instruction unresolved. Recover its outcome before approving another transfer.

### Follow invoice V-42 across a lost response

- **Record the instruction** — V-42 → payout P7. Store the amount, beneficiary and key K7 together.

- **Lose the response** — The bank may have received P7. Record the timeout and keep K7.

- **Resolve P7** — Retry the same request with K7 or reconcile its provider record. Attach the outcome to V-42.

### Decide what makes two payouts the same

Use a business identifier for one approved payment. Two instalments of the same amount to the same vendor can both be legitimate. A unique constraint on the approved instruction lets two workers converge on one record. Commit the provider key and request fields together. If the beneficiary changes, stop for a new approval. Razorpay documents the key and same-request requirement for retries.

[Razorpay payout idempotency](https://razorpay.com/docs/api/x/payout-idempotency/)

### Keep the accounting trail through a reversal

Treat provider status and your accounting entries as separate records. In this design, a confirmed payout posts the settlement entry once. A subsequent reversal produces a linked compensating entry. Overwriting the first entry would make yesterday’s statement impossible to explain. Deduplicate incoming notifications, and reconcile outstanding instructions against provider records when notifications are delayed.

[RazorpayX payout webhook events](https://axisbank-docs.razorpay.com/razorpayx/webhooks/payloads/)

### Test the moment money could move twice

Put the fault immediately after provider acceptance. Kill the worker before its local write, start two replacement workers and replay the same notification. Assert that each worker uses K7, that only one settlement entry exists, and that the unresolved amount remains visible to operations until confirmed. Track the age and amount of unresolved payouts. An HTTP success rate alone cannot tell finance what remains outstanding.

### What the operator can conclude

| Observation | Known outcome | Next action |
| --- | --- | --- |
| Request timed out | Delivery unknown | Recover P7 with K7 |
| Processing | Provider has P7 | Monitor the same payout |
| Reversed | Funds returned | Record reversal and review the invoice |

### Support wants a “pay again” button after 30 seconds. What would you ship?

Offer “Check payout status” for an unresolved instruction. A clock cannot prove that funds stayed put. Allow a new payment only through an explicit decision after reconciliation, with the earlier instruction and its final outcome visible to the approver.

Use payment and payout problems to practice backend reasoning. The round categories below are a preparation plan; the actual Razorpay process depends on the role and team.

## Coding & problem solving

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

## LLD / HLD

Separate a payment ledger from mutable workflow state. Design safe retries and an auditable reconciliation path.

## Practical systems & work discussion

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

## Practice questions

These are Opend practice prompts, not verified interview questions.

### How would you prevent a payout from executing twice?

- Define an operation ID and persist it before requesting the payout.
- Use an atomic uniqueness constraint and the provider's supported idempotency mechanism.
- Model pending, succeeded and failed outcomes. Reconcile ambiguous timeouts before starting a new operation.

### How would you investigate a ledger mismatch?

- Compare immutable entries against external settlement records for a bounded interval.
- Trace operation IDs and currency/rounding rules. Record compensating entries instead of rewriting history.
- Make the reconciliation job resumable and alert on unmatched amounts.

### How should I discuss an incident in an interview?

- Explain user impact, your diagnostic evidence and the safe recovery step.
- Distinguish the immediate fix from a change that prevents recurrence. Avoid invented impact numbers.

[Live roles](https://opend.in/jobs?company=Razorpay)

## Sources

- [Razorpay: payout idempotency](https://razorpay.com/docs/api/x/payout-idempotency/)
