Design an ATM. A customer inserts a card, enters a PIN, then checks a balance, withdraws or deposits cash. The machine talks to the bank and holds a limited stock of notes.
It must
- The customer inserts a card and enters a PIN; three wrong PINs keep the card.
- Supported actions: balance enquiry, withdraw, deposit.
- A withdrawal must be possible with the notes the machine holds (for example 2000, 500, 100).
- A daily limit applies per card.
- If the bank call fails, the customer must not lose money or get cash they were not debited for.
Keep in mind
- Never dispense cash before the bank has debited the account.
- The PIN is never stored or logged in plain form.
- One customer at a time. The bank itself is a separate system.