LLD Hub
Problems·Abstraction: User – Account – Transaction
OOPL1 · Easy

Abstraction: User – Account – Transaction

Problem

Design a banking model where User holds multiple Accounts (Savings, Current, Fixed Deposit). Use an abstract Account class or interface to define a common contract, while each account type has its own behavior for deposits, withdrawals, and interest.

Requirements

  • Abstract Account with: deposit(), withdraw(), getBalance(), getAccountType()
  • SavingsAccount: 4% annual interest, max ₹50,000/day withdrawal
  • CurrentAccount: no interest, overdraft up to ₹10,000 allowed
  • FixedDepositAccount: no withdrawals before maturity date
  • User can hold multiple accounts
  • Transaction records each operation with timestamp and amount

Constraints

  • Account is abstract — you cannot instantiate it directly
  • Each Account type enforces its own rules in withdraw()
✓ Saved