A digital wallet service allows users to store money digitally, make payments, and transfer funds to others. Examples include Paytm, Google Pay, Apple Pay, and PayPal. Users can load money into their wallet through bank accounts or cards, then use it for peer-to-peer transfers, bill payments, or purchases at merchants.
At its core, a digital wallet must manage user balances securely, support fast and reliable transactions, and integrate with external financial institutions for top-ups and withdrawals. It also needs to ensure fraud prevention, regulatory compliance, and seamless cross-device access for millions of users.
This system design interview problem is interesting because it involves secure transaction processing, ledger management, concurrency control, fraud detection, and integration with banking systems.
In this chapter, we will walk through the high-level design of a digital wallet service.
Let’s begin by clarifying the requirements.
Before moving into the design, it’s important to establish scope. Here’s an example candidate–interviewer discussion:
Candidate: Should the system support both peer-to-peer transfers and merchant payments?
Interviewer: Yes, both use cases should be supported.
Candidate: How should users load money into the wallet?
Interviewer: They should be able to top up via bank transfers, debit/credit cards, or UPI.
Candidate: Do we need to support withdrawals from the wallet back to a bank account?
Interviewer: Yes, withdrawals should be supported.
Candidate: Should the wallet maintain transaction history for users?
Interviewer: Yes, users should be able to see past transactions.
Candidate: Do we need to support refunds?
Interviewer: Yes, refunds should be supported for failed or canceled transactions.
Candidate: What about transaction limits?
Interviewer: Yes, limits should be enforced per transaction and per day, as per regulatory requirements.
Candidate: Should the system include fraud detection?
Interviewer: Yes, fraud detection and monitoring are essential.
Candidate: What kind of scale should we assume?
Interviewer: Assume hundreds of millions of users and millions of concurrent transactions.
After gathering the details, we can summarize the key system requirements.