Design the Microsoft Store and Xbox Wallet Balance Ledger
Last updated: November 29, 2026
Quick Overview
Design the ledger behind a Microsoft account balance that is credited by gift cards and refunds and debited by game and app purchases on Xbox and Windows, so balances are always correct and every change is auditable.
Microsoft
November 29, 20260
0
0 solved
Design the ledger behind a Microsoft account balance that is credited by gift cards and refunds and debited by game and app purchases on Xbox and Windows, so balances are always correct and every change is auditable.
Commerce teams at Microsoft ask ledger questions to see if candidates use double-entry accounting, idempotency and append-only records instead of a mutable balance column. The interviewer also checks currency handling and reconciliation with payment providers.
What the Interviewer Expects
- Uses an append-only double-entry ledger as the source of truth
- Derives balances from entries with a cached running balance
- Makes purchases idempotent with client request ids
- Prevents overdraft under concurrent purchases
- Keeps currency per wallet and never mixes currencies
- Runs reconciliation jobs against external systems
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
- Two consoles buy different games at the same instant with just enough balance for one. What happens?
- How do you handle a refund for a purchase made with part balance and part credit card?
- How do you prove to auditors the balance equals the sum of history?
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
Users redeem gift cards (credit), buy games, add-ons, subscriptions (debit), get refunds and chargebacks. A wallet has one currency tied to the account's market. Requirements: no lost or duplicated mo...
High-Level Design
Wallet service exposes authorize, capture, void, credit. It writes to a ledger database (strongly consistent, partitioned by wallet id). Tables: accounts (wallet, gift card liability...