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

Subhahu JainSubhahu Jain
1 min read

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

  1. User & Wallet Management

    • Each user has a unique wallet with balance.

    • Support wallet creation and balance inquiry.

  2. 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.

  3. Transaction Lifecycle

    • Each transaction can be PENDING → SUCCESS / FAILED / REVERSED.

    • Ensure atomic debit/credit (no money disappears or duplicates even under concurrency).

  4. Transaction Reliability

    • Idempotency (retries should not cause double debit).

    • Refund logic (if debit succeeds but credit fails, rollback debit).

  5. Transaction History

    • Maintain mini-statement per user.

    • Show in descending order of time (latest first).

Solution approaches

Will be added by 09 Sept 2025

0
Subscribe to my newsletter

Read articles from Subhahu Jain directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Subhahu Jain
Subhahu Jain