The core part was fine, nothing that should trip you up if you've done any OOP design before.
Start by clarifying requirements and defining core entities (accounts, transactions, ledgers) for a single-currency system. Then extend the model to support multiple currencies by introducing currency-aware accounts and exchange rates, and design an append-only event log to enable replaying transaction history. Discuss trade-offs between consistency, scalability, and auditability, and how you would handle concurrency and idempotency.
Pro tip: Emphasize the importance of an immutable, append-only ledger and idempotent transaction processing to ensure auditability and correctness, especially in a financial system like Coinbase's. Also, proactively discuss how you would handle currency conversion and rounding to avoid floating-point errors.
Ask clarifying questions to understand functional and non-functional requirements: expected scale, consistency needs, supported operations (deposits, withdrawals, transfers), and whether real-time currency conversion is needed.
Define entities like User, Account, Transaction, and Ledger. Sketch basic APIs for creating accounts, depositing, withdrawing, and transferring funds. Ensure the model supports auditing and idempotency.
Introduce Currency as a first-class entity, associate each account with a currency, and design how to handle cross-currency transfers using exchange rates. Discuss where to store rates and how to handle rounding and precision.
Design an append-only event log (or event sourcing) where every state change is recorded as an immutable event. Explain how replaying events from the log can reconstruct account balances and audit history.
Discuss trade-offs: consistency vs. availability, SQL vs. NoSQL, synchronous vs. asynchronous processing. Consider partitioning by user or currency, and how to ensure idempotency and handle failures.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.