Coinbase·Software Engineer·Technical Phone Screen
- You're given an in-memory bank system with basic operations already implemented. Extend it to support scheduled transfers: a way to queue a transfer for a future timestamp, and a way to cancel one that hasn't fired yet. Walk through your design.
- What happens if the source account doesn't have enough funds at the time the scheduled transfer actually executes?
- How do you handle calling cancelScheduled on a transfer that has already executed?
- How do you ensure tick is idempotent, meaning calling it multiple times with the same timestamp doesn't re-apply transfers?
“The core part wasn't bad.”