This question evaluates a candidate's competency in monetary data modeling, concurrency control, idempotency, and maintaining transactional correctness for account balances, including handling currency precision and chronological transaction history.
Design a minimal in-memory or persistent component for a bank account system that supports:
deposit(account_id, amount)
withdraw(account_id, amount)
(reject if insufficient funds)
transactionHistory(account_id)
(list transactions in chronological order)
balance(account_id)
Describe your data model and how you ensure correctness.