KatInterview

Real-Time Payment Authorization Platform with Encrypted User Vault

System DesignModel answer
MediumModel answerSystem Designpaymentslow-latencysecurity

Last updated

Build the issuer backend that decides approve/decline for card transactions in under 200ms, handles settlement flows, and securely isolates sensitive cardholder information.

You work for a financial institution that provides credit cards to consumers. When someone uses their card at a store, the transaction flows through payment networks to your system, which must respond with an authorization decision before a tight network deadline expires. Later, finalized transaction details arrive and must be reconciled against the cardholder's account balance. The platform must also protect customer identity information from exposure.

What you need to handle

  1. Evaluate incoming payment requests using card validity, spending limits, and risk signals to produce approve/decline responses.
  2. Handle authorization adjustments: complete cancellations, partial refunds, and time-limited holds that expire if not finalized.
  3. Reconcile finalized transactions into permanent account records and produce billing statements each month.
  4. Provide customers real-time visibility into pending and completed transactions, plus the ability to temporarily disable their card.
  5. Securely store sensitive customer details: legal name, home address, birth date, government identification numbers, financial information, and card credentials.

Scale and performance constraints

Propose realistic targets and justify them. As a starting point:

  • Customer base: 30 million active accounts
  • Daily transaction volume: 25 million payments on typical days
  • Peak load: approximately 4,000 authorization requests per second during high-traffic periods
  • Response time: the payment network allows roughly 1-2 seconds total round-trip; your platform should consume well under 200 milliseconds
  • Correctness: two simultaneous purchases on one account must never both succeed if together they exceed the credit limit
  • Uptime: target four nines (99.99%) for authorization availability
  • Security: if an attacker steals a database backup, they must not be able to read card numbers or identity documents in plaintext

What to deliver

Part 1: System architecture, data models, and how a transaction moves from initial authorization through final posting to the account.

Part 2: Latency breakdown for authorization. What p99 latency can you commit to, where does the time budget get spent, and how do you maintain performance during traffic spikes and partial infrastructure failures?

Part 3: Strategy for storing and accessing sensitive customer data: encryption techniques, tokenization patterns, key custody, permission boundaries, audit trails, and data deletion.

Identify trade-offs explicitly. Address failure scenarios: fraud detection service becomes slow, primary database fails over, duplicate messages arrive from the network. Suggest which capabilities to implement first.

Hints

Hint 1

Think about the concurrency challenge: how do you prevent two near-simultaneous transactions from both approving when the account only has room for one?

Hint 2

Authorization must be fast, so consider what data needs to be co-located or cached versus what can be computed asynchronously.

Hint 3

For the vault, consider the principle of least privilege: which services genuinely need access to plaintext sensitive data versus which can operate on opaque references?