← Questions

Design a merchant lending system

0
StripeSystem design

A system design interview question asked at Stripe. It tests payments, underwriting and ledger.

Design a system that offers business loans to merchants of a payments platform based on their payment history, then collects repayment automatically by keeping a fixed share of each day's sales until the loan and its fee are paid off.

Requirements

  • Functional: decide which merchants are eligible and for how much, from their processing history; present offers; accept an offer and disburse the funds; withhold a percentage of each payout until the balance is paid; show merchants their balance and history; handle refunds, disputes, missed periods and early repayment.
  • Non-functional: money is never lost, double counted or double withheld; every repayment ties to the payments it came from; eligibility models are explainable and auditable; the system complies with lending rules in each country.

Clarifying questions

  • Is the fee fixed at the start, or does it grow with time like interest?
  • Is there a minimum repayment if sales drop?
  • What happens if a merchant moves volume off the platform or stops processing?
  • How often are offers recomputed, and how many merchants are eligible?
  • Who funds the loans: the platform's balance sheet or a partner bank?

What a strong answer covers

  • A data model: offers, loans, the repayment schedule, withholdings tied to each payout, and a ledger with double-entry postings for disbursement, repayment and write-off.
  • Underwriting as a batch pipeline over payment history (volume, growth, refund and dispute rates) producing offers, with model versions recorded for audits.
  • Repayment in the payout flow: computing the withholding exactly once per payout, idempotently, without delaying payouts.
  • Edge cases: refunds after withholding, disputes, negative balances, early payoff, a merchant with several loans.
  • Monitoring of repayment progress and risk signals (sales dropping), collections, and reconciliation between the loan ledger and the payments ledger.

Follow-ups

  • A bug withheld twice from some payouts for a day. How do you detect and correct it?
  • Add a second, refinanced loan that pays off the first.
  • Support a country where the lender of record must be a partner bank.
  • Merchants want to see predicted payoff dates.

Where it's asked

What it tests

payments · underwriting · ledger

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing