Design a Double-Entry Ledger for Google Wallet Stored Balances
Last updated: November 29, 2026
Quick Overview
Design the ledger service that records every movement of money for Google Wallet stored balances and peer transfers using double-entry accounting, so balances are always correct, auditable, and never go negative.
0
0
0 solved
Design the ledger service that records every movement of money for Google Wallet stored balances and peer transfers using double-entry accounting, so balances are always correct, auditable, and never go negative.
A hard Google onsite question for payments teams. The interviewer checks double-entry modeling, strong consistency for balance checks, idempotency across retries, immutable history with corrections, and reconciliation with external banks.
What the Interviewer Expects
- Model accounts and balanced journal entries that sum to zero
- Use strongly consistent transactions to prevent overdrafts
- Make every posting idempotent with a request key
- Keep entries immutable and correct with reversing entries
- Handle hot accounts such as a large merchant or system float
- Reconcile internal ledger with bank statements
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
- How do you handle a merchant account receiving thousands of credits per second?
- How do you expose a balance that is fast to read but exactly correct for spending?
- How do you support multiple currencies?
- How would you prove to auditors that no money was created or destroyed?
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
- Operations: top up from a bank card, pay a merchant, send to a friend, refund, payout to bank.
- Invariants: every journal entry sums to zero; user balances cannot go negative; history is immutable....
High-Level Design
- Ledger Service on Spanner (external consistency, multi-region).
- Tables:
accounts(account_id, type, currency, balance, version), `journal_entries(entry_id, idempotency_key, created_at, metada...