Design an ATM Transaction Engine Object-Oriented Design Interview
Design an ATM that authenticates a card and PIN, and supports balance inquiry, cash withdrawal with denomination dispensing, and deposits, including session/state handling and hardware abstractions.
1. Problem Statement
Design an ATM: it authenticates a card and PIN, then supports balance inquiry, cash withdrawal with denomination dispensing, and deposits, serving one customer session at a time. Model the card reader, cash dispenser, and bank backend as distinct collaborators.
2. Live Coding Format
Work in the provided coding workspace while explaining your decisions to the live interviewer. Validation may use inline tests, examples, comments, or a verbal walkthrough.
3. Key Focus Areas
- 1Session state machine (idle/card-inserted/authenticated)
- 2CashDispenser denomination algorithm
- 3BankingService boundary/interface design
- 4Transaction modeling (withdraw/deposit/balance inquiry)
- 5Failure-mode handling (card retention, network failure after dispense)
4. What Strong Candidates Should Demonstrate
- ✓Model a session lifecycle explicitly (State pattern) instead of a flag-heavy conditional mess.
- ✓Separate hardware/backend collaborators (dispenser, banking service) from orchestration logic.
- ✓Design a correct denomination-dispensing algorithm and know its limits.
- ✓Reason about failure modes: wrong PIN limits, network drop mid-transaction, insufficient denominations.
Want interactive feedback?
Practice this problem in the live coding workspace while the interviewer probes your clarification, implementation, trade-offs, and validation.
Start Interview