KatInterview

Design a Financial Platform with Transfers and Analytics

System DesignModel answer
HardModel answerSystem Designdistributed-systemsconsistencypayments

Last updated

Architect a core banking platform covering auth, accounts, ATM flows, intra- and inter-bank transfers, and time-windowed transaction analytics.

The Problem

You are tasked with designing the backend infrastructure for a retail banking platform. The platform needs to handle the full lifecycle of customer money movement, from day-to-day account access to cross-bank wire transfers.

Your design must support all of the following capabilities:

  1. Authenticated access — users log in securely, with a second verification step.
  2. Account creation — customers can open new accounts, which involves identity verification.
  3. ATM operations — cash deposits and withdrawals via ATM terminals.
  4. Internal transfers — moving money between accounts held at the same institution.
  5. External transfers — sending and receiving funds through interbank payment networks.
  6. Transaction analytics — querying aggregate statistics (totals, counts, breakdowns) over any user-specified time range.

What to Cover

Walk through each of the following areas. You do not need equal depth on every point, but you should touch all of them and go deep where the interviewer probes.

Architecture and services Identify the major services and how they communicate. Which boundaries are synchronous vs. asynchronous? What are the core data stores?

Data modeling Design the schemas for accounts, balances, transactions, and audit records. Explain how you represent money, why your schema prevents balance corruption, and how you support long-term auditability.

API design and idempotency Sketch the key endpoints. Explain how clients can safely retry any operation without risk of double-charging or duplicate transfers.

Concurrency and double-spend prevention How do you ensure two concurrent withdrawals cannot both succeed when only one has sufficient funds? What happens under high contention on a single account?

Consistency and recovery What consistency level do you target for balance writes? How does the system recover if a transfer fails midway through?

External network integration How do you integrate with ATM networks (which use ISO 8583 messaging) and interbank rails (ACH, wire, real-time payment networks)? How do you handle delayed settlement and returns?

Analytics How do you serve sub-second responses to time-window queries (e.g., "total outflows for account X between Jan 1 and Mar 31") at scale, without placing that query load on the transactional database?

Reliability and operations What are the key SLIs and SLOs? What do your dashboards, alerting rules, and on-call runbooks look like? How do you handle dependency failures gracefully?

Security Cover authentication, authorization, encryption in transit and at rest, and any compliance-driven controls (e.g., PCI-DSS, audit log integrity).

Constraints and Expectations

  • The system serves roughly 20 million customers and 50 million accounts.
  • Peak load is around 10,000 transactions per second; average is closer to 1,200 TPS.
  • ATM authorization must complete end-to-end within 2 seconds; your internal budget is under 300 ms.
  • Analytics queries over up to one year of data should return within 1 second.
  • Transaction records must be retained and auditable for at least 7 years.
  • Money must never be created or destroyed by a system fault — every cent must be accounted for at all times.

There is no single correct answer. The interviewer is evaluating how you reason about trade-offs, handle failure scenarios, and defend your choices under follow-up questions.

Hints

Hint 1

Start by separating the money-critical write path (balance mutation) from everything else. A single Ledger Service that is the only component allowed to write balances gives you one place to enforce all invariants — double-entry balance, idempotency, and audit — rather than spreading that logic across every caller.

Hint 2

Model transfers as state machines persisted to durable storage, not as in-memory orchestration. If the process crashes between the debit and the credit, the system needs to know exactly where it left off and what compensating action to take. Sagas with append-only compensation entries (never deletes or overwrites) are the standard pattern here.

Hint 3

For analytics, the key insight is that your OLTP database is the wrong tool for time-window aggregation at scale. Think about how to move data off the transactional path — a transactional outbox feeding Kafka, stream processing into a columnar store, and pre-aggregated rollup tables — so analytics queries never compete with balance writes.