Design ATM withdrawal system
Problem Statement
Design and implement an ATM withdrawal system that enables users to:
The design should focus primarily on the withdrawal operation, not on other ATM features like deposits or fund transfers.
✅ Functional Requirements
Card Authentication
Withdrawal Request
Cash Dispensation
Transaction Receipt
Error Handling
⚙️ Non-Functional Requirements
Aspect with Description
Security
Mask PIN, validate card securely, prevent duplicate transactions.
Extensibility
Support additional operations later (deposit, transfer).
Maintainability
Each component (card reader, cash dispenser, bank service) should be modular.
Scalability
Should work with multiple bank integrations.
🧩 Key Components / Classes
Component with Responsibility
ATM
Entry point coordinating operations between components.
CardReader
Reads and validates the user’s card.
BankServer / AccountService
Validates PIN, checks balance, debits account.
CashDispenser
Handles physical cash distribution logic.
Transaction
Represents a withdrawal transaction with status.
ReceiptPrinter
Prints or displays transaction receipts.
UserSession
Tracks user state during ATM operations.
💡 Design Considerations
🧠 Discussion Points (for Interviews)
🧾 Final Interview Prompt
Design a low-level system for ATM withdrawal.
The system should handle authentication, balance verification, cash dispensing, and transaction completion.
Your design must include appropriate classes, relationships, and interactions between hardware components (CardReader, CashDispenser) and software components (BankServer, Transaction).
Discuss possible design patterns, error handling, and extensibility.