← Stripe Interview Insights

Stripe·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Apr 2026

Summary

Stripe system design round for a software engineer role. The core problem was building a transaction fee calculator from scratch, which sounds straightforward until you actually have to model the rule schedule in a way that's both flexible and not a complete mess to maintain.

Questions Asked (1)

Q1

Design a transaction fee calculator that accepts a transaction (amount, type, currency, and other attributes you define) and a configurable fee rule schedule supporting flat fees, percentage fees, tiered fees, capped or minimum fees, and per-type or per-currency overrides. How do you model the rule schedule, handle rule precedence, and keep it extensible to new fee types?

System DesignData ModelingTechnical Trade-offs
Author's notes

I started with the data model and that turned out to be the right call.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and defining the transaction and fee rule models, then design a rule engine that resolves precedence and applies fee types. Emphasize extensibility through composition and configuration, and discuss trade-offs between flexibility and performance.

Pro tip: Show how you would test the rule engine with edge cases like overlapping rules and currency rounding, and mention how you'd version the rule schedule to avoid breaking changes.

1. Clarify Requirements and Scope

Ask about supported transaction types, currencies, fee types, and expected scale. Confirm whether rules are static or dynamic, and if real-time calculation is needed.

2. Define Data Models

Model Transaction with amount, type, currency, and attributes. Model FeeRule with conditions (type, currency, amount range), fee components (flat, percentage, tiered), and constraints (min, max).

3. Design Rule Precedence and Resolution

Define a precedence order: specific overrides (per-type, per-currency) over general rules, and more specific conditions over less specific. Use a scoring system or ordered list to resolve conflicts.

4. Implement Fee Calculation Engine

Apply resolved rules to compute fees, handling tiered calculations, caps, and minimums. Ensure correct rounding and currency handling.

5. Ensure Extensibility and Maintainability

Use strategy pattern for fee types, configuration-driven rules, and versioning. Allow new fee types by adding new strategies without modifying core logic.

Key Points to Mention

  • Rule precedence: specific overrides general, with clear conflict resolution
  • Tiered fee calculation: progressive or flat-rate tiers, and how to handle boundaries
  • Caps and minimums: application order (e.g., apply cap after percentage, then minimum)
  • Extensibility: strategy pattern, plugin architecture, or DSL for new fee types
  • Performance: caching resolved rules, indexing for fast lookup
  • Testing: unit tests for rule resolution, edge cases like zero amount, multiple currencies

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.