Skip to content
SD-47 · System design

Design a Wire Transfer API

Asked at Senior level45 minutes
Our answers stay hidden until you reveal them.

Design and implement the API a bank or fintech exposes to send money by wire: a client asks to move an amount from one of its accounts to a beneficiary at another bank, gets back a transfer id at once, and later learns whether the money arrived, was returned or was rejected. The API also shows balances, entries and the state of each transfer, and lets a client cancel a transfer before it leaves.

The platform takes 5 million transfers a day, with payroll batches that spike to 400 a second, and must grow to 5,000 a second. The request rate is not the hard part. The hard parts are that money must move exactly once even though clients retry, servers crash and the payment network is slow (about 2 s a message) and sometimes silent; that every cent must be explainable by a double-entry ledger; that an account can never send more than it has; and that sanctions and fraud checks must run before anything leaves.

Good questions to ask first

Decide what you would assume for each before you look at ours.

  1. 1Which rails?
  2. 2How many transfers?
  3. 3Does the client wait for settlement?
  4. 4Can a transfer be cancelled?
  5. 5Currencies?
  6. 6Who are the clients?
  7. 7What checks are required?
  8. 8How long do we keep records?

How to spend the 45 minutes

  1. 5minPart 1: Requirements and scope
  2. 5minPart 2: Estimates
  3. 5minPart 3: API and idempotency
  4. 15minPart 4: Architecture, stage by stage
  5. 15minPart 5: Ledger, state machine and failures
Sketch your own design: boxes, arrows and the numbers that matter. Then compare it with ours.Break it in the labVisual walkthrough