Design a Double-Entry Ledger for Customer Crypto Balances

Last updated: November 29, 2026

Quick Overview

Design the system of record for customer and company balances across hundreds of assets, supporting trades, deposits, withdrawals, fees and transfers with strict correctness and a full audit trail.

Coinbase
System Design
Software Engineer
Coinbase
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the system of record for customer and company balances across hundreds of assets, supporting trades, deposits, withdrawals, fees and transfers with strict correctness and a full audit trail.

Coinbase holds customer assets and is audited and regulated, so the ledger is the most correctness-critical service it has. The interviewer wants double-entry invariants, idempotency, how balances are derived and read quickly, and how you prove the ledger matches the blockchain and bank accounts.

What the Interviewer Expects
  • Immutable journal entries whose postings sum to zero per asset
  • Idempotency keys on every money movement
  • Account balance materialization with concurrency control
  • Holds or pending states for in-flight withdrawals and orders
  • Reconciliation against on-chain and bank data
Key Topics to Cover
payments and ledgers
double-entry accounting
idempotency
consistency
reconciliation
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you reverse a posting that was wrong?
  • How would you shard the ledger when one hot account (the fee account) gets every trade?
  • How do you produce an as-of balance for a tax or audit date?
  • How do you migrate the schema without downtime on a ledger?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: post transactions such as 'user A buys 0.1 BTC for 6,000 USD with a 30 USD fee'; read balances; list history; place and release holds. Non-functional: never create or destroy value, exactl...

High-Level Design

A ledger service owns a relational database (Postgres or a distributed SQL store). Tables: accounts (owner, asset, type), journal entries (id, idempotency key, type, created at), postings (entry id, a...


Submit Your Answer
Markdown supported

Related Questions