Design a virtual card provisioning and transaction system
Last updated: August 6, 2025
Quick Overview
Design the system behind Affirm Card, which provisions virtual debit cards that let consumers split any purchase into installments. Cover card issuance, real-time transaction authorization, and installment plan creation.
Affirm
August 6, 20259
7
2,060 solved
Design the system behind Affirm Card, which provisions virtual debit cards that let consumers split any purchase into installments. Cover card issuance, real-time transaction authorization, and installment plan creation.
The Affirm Card is a strategic product that extends BNPL beyond e-commerce to in-store purchases. This question tests your ability to design systems that interact with card network protocols (Visa/Mastercard) while maintaining Affirm's installment logic.
What the Interviewer Expects
- Design card provisioning with tokenization and secure storage
- Explain the real-time authorization flow when a consumer taps to pay
- Handle the bridge between card network authorization and BNPL plan creation
- Discuss PCI DSS compliance and data security requirements
- Design for sub-100ms authorization response times
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 an authorization request when the credit decisioning service is temporarily unavailable?
- How do you handle authorization reversals and partial captures?
- What happens when a consumer exceeds their spending limit mid-transaction?
- How would you support adding the Affirm Card to Apple Pay and Google Pay?
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
- Virtual Card Issuance: Users can apply for a virtual card through the Affirm app, which generates an ISO 8583 compliant virtual card.
- **Real-time Transaction Auth...
Capacity Estimation
Assuming Affirm serves 10 million users, with an average of 1 transaction per user per week:
- Total Transactions per Week: 10 million transactions
- Transactions per Second (TPS): 10 million ...