← Stripe Interview Insights

Stripe·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Stripe technical screen, probably for a backend or payments-adjacent engineering role. One coding problem, parsing and fee calculation from a CSV string. Pretty focused on edge case handling which caught me a bit off guard.

Questions Asked (1)

Q1

Given a CSV-formatted string of transactions with fields for transaction ID, amount, currency, and fee percentage, parse the input and compute the total fees collected. Each fee is amount times fee_pct divided by 100, rounded to two decimal places per transaction before summing. Handle malformed lines, extra whitespace, zero-amount rows, and rounding correctly.

Algorithms & Data StructuresAPI & IntegrationsTechnical Trade-offs
Author's notes

I got the happy path working pretty fast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the input format and edge cases, then outline a robust parsing strategy that handles malformed lines and whitespace. Emphasize per-transaction rounding before summation and discuss trade-offs between simplicity and correctness.

Pro tip: Mention that you would use a decimal library or integer cents to avoid floating-point errors, and that you'd log or skip malformed lines with a clear error message. This shows attention to production-quality code and financial accuracy.

1. Clarify requirements and edge cases

Ask about the exact CSV format, expected handling of malformed lines (skip vs. error), and whether currency conversion is needed. Confirm rounding rules and zero-amount behavior.

2. Design parsing strategy

Outline a line-by-line parser that trims whitespace, splits on commas, and validates field count and types. Use a robust CSV parser if available, but be prepared to implement manually.

3. Compute fees with correct rounding

For each valid transaction, calculate fee = amount * fee_pct / 100, round to two decimal places using a reliable method (e.g., Decimal or integer cents), then accumulate the total.

4. Handle errors and edge cases

Decide on error handling: skip malformed lines, log warnings, or throw exceptions. Ensure zero-amount rows contribute zero fee and that extra whitespace is trimmed.

5. Test and validate

Walk through test cases: valid input, malformed lines, whitespace, zero amounts, and rounding edge cases (e.g., 0.005). Verify the total sum matches expected results.

Key Points to Mention

  • Use of Decimal or integer cents to avoid floating-point precision issues
  • Per-transaction rounding before summation, not rounding the total
  • Robust parsing: trim whitespace, validate field count and types
  • Error handling strategy for malformed lines (skip, log, or fail fast)
  • Handling zero-amount transactions correctly (fee = 0)
  • Trade-offs between using a CSV library vs. manual parsing for simplicity and control

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