Design (LLD) Paytm/Phone Wallet System - Machine Coding

Table of contents

Asked in Phonepe interview.
Design and implement a Paytm/PhonePe Wallet System that supports multiple concurrent users performing transactions at the same time. Your system should:
✅ Features Required
User & Wallet Management
Each user has a unique wallet with balance.
Support wallet creation and balance inquiry.
Concurrent Transactions
Add money to wallet (via UPI, Card, NetBanking).
Send money from one wallet to another.
Handle concurrent deposits and transfers without race conditions.
Transaction Lifecycle
Each transaction can be
PENDING → SUCCESS / FAILED / REVERSED
.Ensure atomic debit/credit (no money disappears or duplicates even under concurrency).
Transaction Reliability
Idempotency (retries should not cause double debit).
Refund logic (if debit succeeds but credit fails, rollback debit).
Transaction History
Maintain mini-statement per user.
Show in descending order of time (latest first).
Solution approaches
Will be added by 09 Sept 2025
Subscribe to my newsletter
Read articles from Subhahu Jain directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
