← Stripe Interview Insights

Stripe·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026Remote

Summary

Stripe coding screen for a software engineer role. One problem, but it had a twist that made me rethink my whole approach halfway through.

Questions Asked (1)

Q1

You're given a transaction-fees problem. Extend it so that once a specific merchant's cumulative transaction volume with a specific payment provider crosses 10,000, all future transactions between that merchant and provider become fee-free. The waiver tracks per (merchant, provider) pair, not globally, and applies only after the threshold is crossed.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I started building the per-provider global accumulator before I even finished reading the spec, which cost me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints and edge cases, then propose a solution that maintains a running total per (merchant, provider) pair and a boolean flag indicating whether the threshold has been crossed. Discuss how to handle the threshold crossing transaction itself and ensure the waiver applies only to subsequent transactions.

Pro tip: Mention that the threshold crossing transaction should still incur a fee, and that you would use a hash map keyed by a composite of merchant and provider IDs for O(1) lookups. Also, consider concurrency and persistence if the system is distributed.

1. Clarify requirements and edge cases

Ask whether the threshold-crossing transaction itself is fee-free, how to handle refunds or reversals, and whether the cumulative volume resets. Confirm that the waiver is per (merchant, provider) pair and only applies after crossing 10,000.

2. Design data structures

Use a hash map with a composite key (merchant_id, provider_id) mapping to an object containing the cumulative volume and a boolean flag indicating if the threshold has been crossed. This allows O(1) updates and lookups.

3. Define the fee calculation logic

For each transaction, retrieve the state for the (merchant, provider) pair. If the flag is true, fee is 0. Otherwise, compute the fee normally, then update the cumulative volume. If the new volume exceeds 10,000, set the flag to true for future transactions.

4. Handle concurrency and persistence

If the system is distributed, use atomic operations or locks to prevent race conditions when updating the cumulative volume. Persist the state in a database or durable store to survive restarts.

5. Test and validate

Write unit tests for scenarios: below threshold, exactly at threshold, crossing threshold, and multiple pairs. Also test concurrent transactions to ensure correctness.

Key Points to Mention

  • Composite key (merchant_id, provider_id) for per-pair tracking
  • Threshold-crossing transaction should still incur a fee
  • Use of a boolean flag to avoid recomputing cumulative volume
  • Time complexity: O(1) per transaction with hash map
  • Space complexity: O(number of unique merchant-provider pairs)
  • Concurrency control (e.g., locks or atomic operations) in distributed systems
  • Persistence of cumulative volume and flag across sessions

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