KatInterview

Building a Fault-Tolerant Money Transfer Service

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsfault-toleranceidempotency

Last updated

Design a backend service that processes monetary transfers reliably despite retries, crashes, network failures, and ambiguous external responses.

Building a Fault-Tolerant Money Transfer Service

You need to architect a backend service that processes customer money transfers with absolute correctness guarantees. The system must handle incoming transfer requests, execute them through external processing systems, and provide status visibility—all while ensuring that network failures, process crashes, retry storms, and ambiguous third-party responses never result in lost funds, duplicate charges, or unreconciled states.

Structure your design by addressing: core requirements, API contracts, storage schema, failure scenarios, and operational tooling. Avoid assuming specific throughput numbers; instead explain what capacity considerations would influence your architectural decisions.

Requirements & Constraints

  • Each transfer must have a stable identifier and progress through well-defined states
  • Both end-user clients and internal processing components will retry operations
  • External payment processors may accept work but fail to return a response, creating outcome uncertainty
  • All monetary amounts must use precise decimal representation with explicit currency codes
  • Users must be able to retrieve transfer status after the initiating request completes

Questions Worth Exploring

  • Are transfers contained within your system's ledger, or do they exit to external bank networks?
  • What cancellation semantics and user-visible state transitions should exist?
  • What latency and consistency expectations govern status queries?
  • Where does authoritative settlement occur, and how are chargebacks or corrections processed?
  • What regulatory, audit trail, data retention, and geographic compliance requirements apply?

Hints

Hint 1

Separate the durable recording of user intent from the potentially-failing execution of external effects

Hint 2

Design explicit retry semantics for every component boundary, including how to handle the case where you cannot determine if an external call succeeded

Hint 3

Build reconciliation into your standard workflow rather than treating it as a break-glass emergency procedure