Phase 1: Requirements & Use Cases
Interviewer: "Design an ATM machine."
Candidate: "Let me restate what I think we're building before touching any classes. An ATM is a self-service terminal that allows a bank customer to insert their card, verify their identity via PIN, and perform financial transactions — withdrawals, deposits, balance inquiries, and transfers — without a human teller. Does that align with your expectations?"
Interviewer: "Yes. Who are the actors?"
Candidate: "I see three actors:
- Customer — the primary user; inserts card, enters PIN, performs transactions
- Bank (external system) — validates credentials, authorizes transactions, updates account balances; I'll model this as an interface since we don't own it
- ATM Technician — refills cash, services hardware; relevant to operational concerns but out of scope for the core class design
For use cases, I want to cover:
- Insert card — read card data, initiate session
- Authenticate PIN — validate against bank, lock card after N failed attempts
- Withdraw cash — verify balance, dispense notes, update account
- Check balance — retrieve and display account balance
- Deposit cash/check — accept envelope or notes, credit account
- Transfer funds — move amount between two accounts
- Eject card — end session cleanly, return card"
Interviewer: "What about multi-currency support and international cards?"
Candidate: "I'd scope that out of V1. Multi-currency requires exchange rate lookups, foreign bank network routing (Visa/Mastercard interchange), and denomination management per currency — each is a system in its own right. The core OOD challenge here is the state machine, transaction hierarchy, and hardware…
In the full tutorial
- Phase 2: Object Modeling
- Phase 3: Class Design & Relationships
- Phase 4: Design Patterns Application
- Phase 5: Key Implementation
- Phase 6: Extensibility & Trade-offs