Design the Ledger Behind Seller Payouts and Instant Transfers

Last updated: November 29, 2026

Quick Overview

Design the system that records every seller balance movement (card sales, fees, refunds, chargebacks, loan repayments) and pays out balances to bank accounts daily or instantly on request, with books that always balance.

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

0

0

0 solved


Design the system that records every seller balance movement (card sales, fees, refunds, chargebacks, loan repayments) and pays out balances to bank accounts daily or instantly on request, with books that always balance.

Square sellers see their sales arrive in a bank account on a schedule or instantly for a fee, with deductions for refunds, disputes and Square Loans repayments. This round tests double-entry modeling, correctness under concurrency, idempotent money movement and reconciliation with external bank rails.

What the Interviewer Expects
  • Model money with double-entry journal entries in minor units
  • Make balance derivable from immutable entries
  • Prevent overdrawing on concurrent instant transfers
  • Make payout submission idempotent toward the bank rail
  • Reconcile against bank and card network settlement files
  • Handle negative balances from chargebacks
Key Topics to Cover
double-entry accounting
idempotency
concurrency control
reconciliation
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
  • How do you compute a balance quickly for a seller with millions of entries?
  • An instant transfer and a chargeback hit the same balance at once; what happens?
  • How do you handle a payout that the bank returns two days later?
  • How do you shard this, and what must never cross shards?
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

Entry types: sale settled, processing fee, refund, chargeback, chargeback reversal, loan repayment withholding, payout initiated, payout returned. Each seller has accounts such as pending, available, ...

High-Level Design

A Ledger service accepts transactions, each a set of entries whose debits equal credits, keyed by an idempotency key from the caller (for example the payment id plus entry type). Entries are append-on...


Submit Your Answer
Markdown supported

Related Questions