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
August 6, 20259
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
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- 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 ProblemsSample Answer
Requirements
- Functional Requirements:
- Installment Creation: Users can create installment plans for purchases, specifying the total amount, payment schedule, and interest rates.
- **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 ...