Design a feature flag system for safe deployment of financial services
Last updated: August 6, 2025
Quick Overview
Design a feature flag system tailored for financial services where incorrect flag evaluation could result in wrong interest rates, unauthorized transactions, or regulatory violations.
Affirm
August 6, 20257
6
4,049 solved
Design a feature flag system tailored for financial services where incorrect flag evaluation could result in wrong interest rates, unauthorized transactions, or regulatory violations.
Affirm deploys frequently to its Python services and needs a way to safely roll out changes to financial logic. This question tests your understanding of feature flags in a high-stakes environment where bugs have monetary consequences.
What the Interviewer Expects
- Design a flag evaluation system with sub-millisecond latency
- Support percentage rollouts, user targeting, and kill switches
- Discuss audit logging for flag changes that affect financial logic
- Handle the failure mode: what happens when the flag service is unreachable?
- Design flag lifecycle management (creation, testing, rollout, cleanup)
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 ensure a consumer always sees the same interest rate throughout their session even if a flag changes mid-session?
- How do you prevent a flag misconfiguration from offering 0% APR to all consumers?
- How would you test flag interactions where two flags affect the same code path?
- What governance process would you put around flags that control financial terms?
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
- Feature Flag Evaluation: Flags must evaluate in sub-millisecond latency to ensure prompt decisions on interest rates and transactions.
- Percentage Rollouts: Ab...
Capacity Estimation
Assuming Affirm has approximately 50 million users and the feature flagging system needs to evaluate flags on each transaction:
- Daily Transactions: If each user performs an average of 2 transact...