Design a Buy Now Pay Later installment engine

Last updated: August 6, 2025

Quick Overview

Design a system that splits purchases into installment plans, schedules recurring payments, handles failed payments with retry logic, and manages merchant settlement flows.

Affirm
System Design
Software Engineer
Affirm
August 6, 2025
Software Engineer
System Design Round
System Design
Hard

9

6

4,305 solved


Design a system that splits purchases into installment plans, schedules recurring payments, handles failed payments with retry logic, and manages merchant settlement flows.

This is a core Affirm system design question asked during the onsite. Interviewers want to see that you understand the full lifecycle of a BNPL transaction, from purchase to final installment collection, including edge cases like early payoff and late payments.

What the Interviewer Expects
  • Define clear functional requirements: installment creation, payment scheduling, retry logic, early payoff
  • Design a state machine for installment lifecycle (active, past due, paid off, defaulted)
  • Discuss idempotency for payment processing to prevent double-charging consumers
  • Address merchant settlement timing and reconciliation
  • Consider regulatory requirements like Truth in Lending disclosures
Key Topics to Cover
Payment state machines
Idempotency in financial systems
Eventual consistency vs strong consistency
Retry logic with exponential backoff
Regulatory compliance in lending
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 would you handle a consumer who wants to change their payment method mid-plan?
  • What happens if the merchant issues a partial refund after three installments have been collected?
  • How would you support multiple currencies and cross-border transactions?
  • How do you ensure the system remains consistent during a database failover?
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 Requirements:
    1. Installment Creation: Users can create installment plans for purchases, specifying the total amount, payment schedule, and interest rates.
    2. **Payment Schedu...
Capacity Estimation

To estimate capacity, assume Affirm handles approximately 10 million transactions per month (around 333,000 transactions per day). If each transaction generates an average of 5 installments:

  • Total ...

Submit Your Answer
Markdown supported

Related Questions