Design an Outgoing Pix Transfer Service With Fraud Screening

Last updated: November 29, 2026

Quick Overview

Design the backend that takes a customer's Pix transfer request from the app, checks balance and fraud risk, submits it to the Central Bank's instant payment rail, and guarantees the customer is debited exactly once whether the rail confirms, rejects or times out.

Nubank
System Design
Software Engineer
Nubank
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the backend that takes a customer's Pix transfer request from the app, checks balance and fraud risk, submits it to the Central Bank's instant payment rail, and guarantees the customer is debited exactly once whether the rail confirms, rejects or times out.

Pix runs 24/7 with settlement in seconds, and Nubank is one of the largest participants on the rail, so this is a core design topic for backend engineers there. The interviewer checks money correctness under partial failure (holds, idempotency, reconciliation), latency budgets for inline fraud checks, and how the design survives peak days like paydays and Black Friday.

What the Interviewer Expects
  • Models the transfer as a state machine with a balance hold before submission
  • Uses idempotency keys end to end, including the end-to-end id sent to the rail
  • Keeps the fraud check inside a strict latency budget with a safe fallback
  • Handles rail timeouts with status queries and reconciliation, never blind retries
  • Partitions by customer for scale and keeps a double-entry ledger
  • Covers observability and limits (nighttime limits, per-transfer caps)
Key Topics to Cover
payment state machines
idempotency
ledger holds
reconciliation
inline fraud scoring
sharding
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • The rail times out and the status query also fails. What does the customer see, and when is the hold released?
  • How would you shard so one viral merchant receiving millions of Pix does not hot-spot?
  • How do you add a new country's instant rail (for example SPEI in Mexico) without forking the service?
  • How would you replay a day of transfers to prove the ledger matches the Central Bank settlement report?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: resolve a Pix key to a destination account (the directory lookup), validate limits, score fraud, debit, submit to the rail, report the final status, support refunds (devolucao). Non-functi...

High-Level Design

App -> API gateway -> Transfer service (owns the state machine) -> Ledger service (double-entry, holds) -> Risk service (features + model, synchronous) -> Rail gateway (signs and sends...


Submit Your Answer
Markdown supported

Related Questions