Skip to the guide

Design a digital wallet

AdvancedCase study11 pages

The interviewer asks you to design the classes behind a wallet app, where people hold a balance and pay each other. Picture a school trip. A teacher keeps each pupil's pocket money in an envelope with the pupil's name on it, and a slip inside lists every amount in and out. When Ana pays Ben, the teacher takes both envelopes, always in alphabetical order, moves the money and writes a line on each slip. Each request comes on a numbered note, and if the same note arrives again, the teacher gives the same answer and moves nothing.

It is also asked as "design Venmo". The closest other case study is the ATM, where the money sits at a bank. Interviewers like the wallet because a transfer changes two objects at once, and a phone that retries must never pay twice. Moving money safely owns the system design, and this page is the class-level part.

Below is a full 45-minute round on the LLD framework. At each Guess before you read on, stop and answer first. The full runnable project is a download in Java, JavaScript and Python.

Run the full project

This design as a project you can run, with its tests and a demo. You only need Java 21, Node 24 or Python 3.13. The README says how to run it.

Step 1 · Clarify the requirements and cut the scope

Minutes 0–5 · How this step works

Interviewer: Design a digital wallet.

You: What can a user do with it?

Interviewer: Hold a balance, top it up from a bank, pay another user and read a statement.

You: One currency, and are there limits?

Interviewer: One currency. At most $10,000 a transfer, and a balance can never go negative.

You: A phone on a bad network will retry. What should a repeat do?

Interviewer: One tap must move money once.

You: How big is it, and do requests arrive at the same time?

Interviewer: About a million wallets, with many threads in one process.