Design Idempotent Peer Payments for WhatsApp Pay on UPI
Last updated: November 29, 2026
Quick Overview
Design the backend for sending money between users in WhatsApp chats in India, where transfers settle through the UPI network via partner banks and responses can be slow, duplicated, or missing.
Meta
November 29, 20260
0
0 solved
Design the backend for sending money between users in WhatsApp chats in India, where transfers settle through the UPI network via partner banks and responses can be slow, duplicated, or missing.
WhatsApp Pay runs on UPI through partner banks, so Meta is an orchestrator rather than the bank. Interviewers check idempotency end to end, a strict state machine, timeout handling with status checks, and keeping the chat experience consistent with the real money state.
What the Interviewer Expects
- Model the payment state machine explicitly
- Use client-generated idempotency keys and bank transaction IDs
- Handle timeouts with status inquiries instead of retries
- Keep chat messages in sync with payment state
- Reconcile with partner bank reports
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- The user taps Pay twice on a slow network: what happens?
- The bank returns success after your timeout: how does the UI recover?
- How do you handle a refund if the receiver's bank fails?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: user selects a chat contact, enters amount and UPI PIN, sees pending then success or failure; receiver sees credit message; history view.
Non-functional: never double-charge; fina...
High-Level Design
- Client creates a
payment_id(UUID) before submission and sends it with every retry. - Payment service stores the payment with state
INITIATED, calls the partner bank adapter to start...