SevyDevy

Design an ATM

PremiumLow-level designMedium

  • State pattern
  • Chain of responsibility
  • Idempotency

Quick answer

This low-level design interview question asks you to design an ATM. Aim for a design that is modelled as clear classes, interfaces and relationships that can handle new requirements without a rewrite. Interviewers want to see how you name responsibilities, keep classes small and reason about change.

The problem

ATM low level design: build the object model for an automated teller machine that verifies a PIN, shows the balance, dispenses cash and takes deposits. The hard part is money safety: never hand out cash the bank has not approved, and never leave an account debited for cash the ATM did not dispense.

A customer inserts a card, enters a PIN, and chooses to check balance, withdraw cash, deposit cash or change the PIN. The ATM talks to the customer's bank over a network link, keeps a limited stock of notes and prints receipts. The bank link or the dispenser can fail in the middle of a transaction.

What must an ATM do?

  • Withdraw: Take an amount, check the ATM can make the amount with its notes, check the daily limit (20,000) and get the bank's approval, dispense, then confirm to the bank.
  • Session: Insert card, enter PIN (3 attempts, then the card is retained), pick a transaction, repeat or eject the card. A session times out after 30 seconds of inactivity.
6 more requirementsUnlock to see all

How well must it do it?

  • Safe money: Cash must never be dispensed without bank approval, and an account must never stay debited for cash that was not dispensed. Every bank call must be retry-safe.
  • Secure: The PIN never lives in memory longer than needed and is never logged.
2 more requirementsUnlock to see all

What scale should you design for?

Use these numbers in your estimates.

The scale numbers unlock with this questionUnlock

Key concepts

  • State pattern
  • Chain of responsibility
  • Idempotency
  • Cash dispensing
  • Transactions
  • PIN verification

How you’ll practise

6 short steps · save and come back any time
  1. Requirements
  2. Core objects
  3. Class relationships
  4. Key flows
  5. Extensibility
  6. Wrap-up

Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.

What do interviewers look for?

In any low-level design round.

  • Lists the use cases before writing classes
  • Gives each class one clear responsibility
  • Uses interfaces where behaviour is likely to change
  • Applies a design pattern only when it solves a real problem
  • Handles edge cases and invalid states explicitly
  • Walks through one use case end to end with the model

Questions people ask about this interview question

Which design type is this question?
It is a low-level design question. You design an ATM and explain your choices the way you would in an interview.
Is this question asked at entry level?
It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
What should I cover first?
Start with the use cases and the core entities, then the responsibilities of each one. Agree on scope with the interviewer before you design anything.
Can I practise it for free?
It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.

Related questions

Updated · Written by the SevyDevy team

Premium questionSign up free, then unlock it