Coinbase·Software Engineer·Technical Phone Screen
- Design and implement a banking ledger for n accounts with deposit, withdraw, and transfer operations. Each should return a boolean indicating success or failure, with false for invalid IDs or insufficient funds.
- Write unit tests covering edge cases for this ledger: invalid account IDs, zero or negative amounts, and integer overflow scenarios.
- Extend the ledger to support atomic batches of operations, where the entire batch rolls back if any single operation fails.
- Analyze the time and space complexity of your implementation and walk through common pitfalls like integer overflow.
“The core implementation wasn't bad.”