Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Online Banking System

Let bank customers see their accounts, deposit and withdraw money, move money between their own accounts and read their history, without money ever being lost, created or counted twice.

Problem statement

For this exercise, assume a retail bank wants one banking system behind its website and mobile app. Each customer has one or more accounts, such as checking and savings, and every account holds US dollars.

A signed-in customer can see their accounts and balances, read each account's transaction history, and move money between two of their own accounts. Deposits and withdrawals also go through this system.

For this exercise, assume they arrive as requests from the bank's other channels, such as ATMs, branch tellers and mobile check deposit, which have already handled the cash or the check. You do not design those channels, card payments, transfers to other banks, loans or fraud checks.

Money must never be created, lost or counted twice. A withdrawal or transfer must not take an account below zero, because this bank allows no overdrafts. A request can reach the system more than once, for example when the app or an ATM retries after a timeout, and it must still change balances only once.

A balance must be correct as soon as a request completes, but a new transaction may take a second or two to appear in the history list.

Design the system, from a client's request to where the data is stored and back.

What to build

  1. A signed-in customer can see each of their accounts with its current balance.
  2. One of the bank's channels can deposit money into an account or withdraw money from it and get back the result and the new balance; a withdrawal larger than the balance is declined.
  3. A signed-in customer can move money between two of their own accounts; both balances change together, or neither changes.
  4. A customer can read an account's transactions, newest first, one page at a time.

At scale

  • For this exercise, assume 10 million customers with about 20 million accounts, and about 10 million deposits, withdrawals and transfers a day.
  • For this exercise, assume reads dominate: at peak, such as payday mornings, about 5,000 balance and history reads per second and about 500 deposits, withdrawals and transfers per second.
  • For this exercise, assume a deposit, withdrawal or transfer should return its final result within 1 second at p95, and a balance or history page within 300 milliseconds at p95.
  • For this exercise, assume an acknowledged money movement must never be lost, the system must keep working when one data center (availability zone) fails, and history is kept for 7 years.