InterviewLegend

Payment Records & Billing

Alex Chen15 min readGuide updated 37 real interview reports
In this lesson
  • Reconcile payments to invoices by memo, then by amount and earliest due date, then within a forgiveness tolerance
  • Validate transaction CSV rows with a real CSV reader and give each row exactly one status code
  • Link merchant records by weighted score, with a hop limit and then full connected components
  • Schedule welcome, reminder and expired emails from subscriptions and a send schedule, then handle renewals
  • Practice two older tasks: a graduated pricing ladder and a chargeback parser

These six tasks hand you money records. The first four are what candidates describe from 2025 and 2026 screens and onsites: invoice reconciliation, transaction CSV validation, linked-merchant matching and an email subscription scheduler. The last two, a shipping-cost pricing ladder and a chargeback parser, come from 2024 and 2025 reports and still make good practice. Two habits carry across all six. Hold money in integer cents, the way Stripe's own API does, and sort output by an explicit key so it matches the expected results exactly. Then read the rules slowly, because each task hides an edge case in them, like two payments claiming one invoice or a reminder that would land before a subscription starts.

The method for running the round, from restating the spec to writing your own tests, is in Practical Coding.

Asked at Stripe

1

Invoice and Payment Reconciliation: Match Both Sides

MediumCommonly asked
Problem
You have a list of invoices and a list of payments. Each invoice is a dict with at least an "id". Each payment is a dict with its own "id" and a reference to the invoice it pays: either an "invoice_id" field, or, when that is missing, a "memo" string that carries the invoice id.

Match each payment to an invoice by that reference. Return three things: the matched (invoice_id, payment_id) pairs, the invoice ids that no payment matched, and the payment ids that matched no invoice. If two payments both point at the same invoice, only the first one matches and the rest are unmatched. Sort each list so the output is deterministic.
Inputinvoices = [{"id": "inv_1"}, {"id": "inv_2"}, {"id": "inv_3"}] payments = [ {"id": "pay_a", "invoice_id": "inv_2"}, {"id": "pay_b", "memo": "inv_1"}, {"id": "pay_c", "invoice_id": "inv_9"}, ]Output{ "matches": [("inv_1", "pay_b"), ("inv_2", "pay_a")], "unmatched_invoices": ["inv_3"], "unmatched_payments": ["pay_c"], }

pay_a references inv_2 directly. pay_b has no invoice_id, so its memo "inv_1" is used and matches inv_1. pay_c references inv_9, which does not exist, so it is unmatched. inv_3 had no payment.

How this uses the pattern

Index, then sweep. Build a dict from invoice id to invoice so a reference is an O(1) lookup. Sweep the payments: resolve each reference (invoice_id, else memo), and if it points at a not-yet-claimed invoice, record the match and mark that invoice claimed. Everything left over is unmatched on its respective side.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Invoice and Payment Reconciliation: Match Both Sides

Loading...
Click "Run" to execute your code
The Stripe angle
Candidates report this one more than any other Stripe screen problem in 2025 and 2026, at phone screens, new-grad team screens and onsites. Payments rarely carry a clean foreign key, so you read the invoice off a memo line. Watch the double-pay case. Two payments naming one invoice must not both match.
Take it further
Reported versions keep going. A later part matches a payment whose memo names nothing by amount, to the open invoice with the earliest due date. Some versions then add a forgiveness value, so an amount a few cents off still counts. Both reuse the same index and claimed set.
2

Transaction CSV Validation: Flag Bad Rows, Then Apply the Rules

MediumSignature problem
Problem
You get a batch of transactions as CSV text: a header row, then one row per transaction with six fields, transaction_id,customer_id,amount,currency,payment_method,timestamp. The amount should be a whole number of cents.

Return one status code per data row, in input order. A row with a missing or empty field gets MISSING_FIELD. Otherwise, an amount that is not a positive whole number no larger than max_amount gets INVALID_AMOUNT. Otherwise, a payment method in blocked_methods (compared case-insensitively) gets BLOCKED_METHOD. Everything else is OK.

Check the rules in that order, so each row gets exactly one code.
Inputcsv_text = """transaction_id,customer_id,amount,currency,payment_method,timestamp tx1,cus_1,1500,usd,card,1700000000 tx2,cus_2,,usd,card,1700000060 tx3,cus_1,250000,usd,card,1700000120 tx4,cus_3,900,eur,prepaid_card,1700000180 tx5,cus_2,-50,usd,card,1700000240""" max_amount = 100000 blocked_methods = ["prepaid_card"]Output["OK", "MISSING_FIELD", "INVALID_AMOUNT", "BLOCKED_METHOD", "INVALID_AMOUNT"]

The first row passes every rule. An empty amount stops tx2 at the first rule. Both tx3 (over the 100000-cent cap) and tx5 (negative) fail the amount rule, and tx4 is well formed but pays with a blocked method.

How this uses the pattern

Parse, then run each row through an ordered list of checks and stop at the first that fails. Read the text with a real CSV reader, strip the fields, test for empties, then the amount, then the payment method. The order of the checks is part of the spec, because it decides which code a row with two problems gets.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Transaction CSV Validation: Flag Bad Rows, Then Apply the Rules

Loading...
Click "Run" to execute your code
The Stripe angle
Candidates describe this CSV validation task from 2026 phone and team screens, as recently as November. Reported versions grow a rung at a time, from empty-field checks to amount and blocked-method rules, a field-similarity rule and error codes. One 2026 candidate spent 25 to 30 minutes of part one on Python's CSV parsing, so know your language's CSV library cold.
Take it further
A reported later part flags a row when one field matches at least half of another field. The exact definition is the first thing to ask about. Write it as its own check, get one worked example from the interviewer, and test the 50% boundary from both sides.

A close cousin showed up in team screens from late 2025 into August 2026: validating business (KYC) records from a CSV. Reported parts check required fields, a length of 5 to 32 characters and banned words, then whether the business name shares words with a second name field once suffixes like LLC and Inc are ignored. It is the same rule ladder with different rungs. Older new-grad assessments, back in 2024, used a simpler card-transaction cleanup: drop the declined rows and sort the rest.

3

Merchant Record Dedup: Weighted Match, Then Link the Clusters

MediumSignature problem
Problem
A payments platform signs up thousands of merchants, and the same real business often lands in your customer table more than once. Think of a typo in the name, a second signup under a work email, a company field left half filled. You are given a list of customer records. Each record has an id, a name, an email, and a company.

Part 1. Score every pair of records for how likely they are the same entity. A shared, non-empty email is worth 3 points, a shared name is worth 2, and a shared company is worth 1. Compare fields case-insensitively after trimming whitespace, and count a field only when both records carry it. Return the pairs that score at or above a threshold, each as (id_a, id_b, score) with id_a < id_b, sorted.

Part 2 (the escalation). Treat every matching pair as an edge and return the connected components: the groups of records that all describe one real entity. A record that matches nothing is its own group of one. Sort the ids inside each group, then sort the groups. The catch is transitivity. If A matches B on email and B matches C on name and company, then all three are one entity even though A and C share nothing directly.
Inputrecords = [c1, c2, c3, c4, c5] (see below) threshold = 3Output[["c1", "c2", "c3"], ["c4", "c5"]]

Records c1 and c2 share the email jane@acme.com, so they link. Records c1 and c3 share a name and a company, so they link too. On their own, c2 and c3 never match, yet both ride into c1's group through those links. Finally, c4 and c5 are a clean duplicate across all three fields.

How this uses the pattern

Score first, then link. The scoring pass is a double loop over the records that adds field weights for each pair, and that is the disguised part: the pairs that clear the threshold are edges in a graph. The second part is connected components over that graph. Union-find each matching pair, or run a DFS or BFS from every unvisited record. Either approach handles transitivity, which is exactly what a naive pairwise grouping drops.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Merchant Record Dedup: Weighted Match, Then Link the Clusters

Loading...
Click "Run" to execute your code
The Stripe angle
Linked-account matching like this is a current Stripe screen task, reported through late 2026 under names like linked merchants and user matching. The scoring pass looks like the whole exercise until the ask widens to every record for one entity. A linked to B linked to C is one cluster even when A and C never scored each other.
Take it further
Some reported versions open with a plainer part, linking two records when any one field matches, and put a hop limit (one or two hops) before the full component. A hop limit is a breadth-first search with a depth cap, shown below. Scale is another twist: bucket records by a cheap key such as email domain and score only within a bucket.

The same union-find shape ran as a July 2026 online assessment, in the timed 60-minute HackerRank format: one long problem whose parts open one after another, graded by hidden tests. Customers who share a device id form a fraud ring. A later part links on device or card and asks for the largest ring, and the last part averages the ring's risk scores with zero-risk members left out.

4

Email Subscription Scheduler: Welcome, Reminder, Expired

MediumCommonly asked
Problem
Each user record has a name, a plan, a begin day and a duration in days, so the subscription ends on day begin + duration. A send schedule lists the emails and when each one fires: "start", "end", or a negative number of days counted back from the end.

Return every email as (day, message, name, plan), sorted by day. Emails on the same day keep the order of the users, then the order of the schedule. Skip any reminder that would land before the subscription begins.
Inputusers = [ {"name": "A", "plan": "Basic", "begin": 0, "duration": 30}, {"name": "B", "plan": "Pro", "begin": 1, "duration": 15}, ] schedule = [["start", "Welcome"], [-15, "Upcoming expiration"], ["end", "Expired"]]Output[ (0, "Welcome", "A", "Basic"), (1, "Welcome", "B", "Pro"), (1, "Upcoming expiration", "B", "Pro"), (15, "Upcoming expiration", "A", "Basic"), (16, "Expired", "B", "Pro"), (30, "Expired", "A", "Basic"), ]

A ends on day 30, so its reminder fires on day 15. B ends on day 16, so its reminder lands on day 1, the same day as its welcome. On day 1 the welcome comes first because it comes first in the schedule.

How this uses the pattern

Expand, then sort. For each user, turn every schedule entry into a concrete day: the begin day, the end day, or the end plus a negative offset. Drop the ones before the begin day, collect the rest as tuples, and sort by day with a stable sort so same-day emails keep their order.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Email Subscription Scheduler: Welcome, Reminder, Expired

Loading...
Click "Run" to execute your code
The Stripe angle
Candidates report this email scheduler from onsite programming rounds in late 2025 and early 2026, and from an Oct-Nov 2025 phone screen. Under the subscription wording sits day arithmetic and a careful sort. Keep the rule for when an email fires in one function, because every follow-up leans on it.
Take it further
Reported follow-ups add plan changes and renewals. A plan change sends its own email, and later emails carry the new plan. A renewal pushes the end date out, which moves the reminder and the expired email with it. Both feed changed inputs into the same scheduler.

Older problems, still good practice

The pricing ladder was a 2025 screen task, and the chargeback parser came from a 2024 new-grad online assessment. Neither has a recent report, but both drill the same parsing and money habits, so work them after the four above.

5

Shipping-Cost Pricing Ladder: Flat, Per-Unit, Then Tiered

MediumFrequently asked
Problem
A shipping rate card charges an order through a ladder of pricing tiers, and this task hands you that ladder as a string. Stripe Billing prices tiered usage the same way. Tiers are separated by ;, and each tier reads UP_TO:FLAT:PER_UNIT, three fields split by colons. UP_TO is the cumulative unit ceiling for the tier, or * for the final unbounded tier. FLAT is a one-time fee in cents that applies when any unit falls in the tier, and PER_UNIT is the per-unit price in cents for units inside it.

Part 1. Start with a single rate: one flat base fee plus a per-unit charge. Given a flat fee together with a per-unit price and a quantity, return the cost in cents, which is flat + per_unit * quantity, and 0 when the quantity is 0.

Part 2 (the escalation). Price the full graduated ladder. Walk the tiers in order, charging the units that fall inside each bracket that bracket's per-unit rate. A bracket's flat fee is added only when at least one unit lands in it. Return the total cost in cents for a given quantity. Model the parsed ladder as a list of (up_to, flat, per_unit) tiers, with up_to the ceiling or None for the unbounded tier.
Inputladder = "*:500:120" (one flat 500, 120 per unit) quantity = 4Output980

A single tier: a 500-cent base fee plus 120 cents per unit. For 4 units, 500 + 120 * 4 = 980 cents.

How this uses the pattern

Parse first, price second. Split the spec into UP_TO:FLAT:PER_UNIT tiers kept in order, with the final "*" tier unbounded. The first part reads one tier and charges flat plus per-unit times quantity. The second part walks the tiers, charging the units that fall inside each bracket at that bracket's rate and adding a bracket's flat fee only when a unit lands in it. Track a running lower boundary so every unit is billed exactly once.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Shipping-Cost Pricing Ladder: Flat, Per-Unit, Then Tiered

Loading...
Click "Run" to execute your code
The Stripe angle
A shipping-cost ladder was reported in 2025 screens, including a data engineering loop: a flat rate per product, then decreasing tiers, then tiers with a fixed fee added. Stripe Billing's graduated tiers_mode works the same way. Keep every amount in integer cents and an honest running lower boundary, or a total lands a few cents off.
Take it further
A natural next step is Stripe Billing's volume mode, where the whole quantity bills at the single tier it lands in rather than filling brackets one by one. Another twist picks a per-country base rate before the ladder runs. Each reuses the parsed ladder and only swaps the pricing walk.
6

Chargeback Parser: Aggregate and Flag

MediumCommonly asked
Problem
A card network sends you chargeback records as one dense string. Records are separated by semicolons, and each record is MERCHANT|CASE_ID|AMOUNT|OPENED_DAY|RESPONDED_DAY. AMOUNT is an integer number of cents the cardholder disputed. OPENED_DAY is the day the dispute opened, and RESPONDED_DAY is the day the merchant submitted evidence, or "-" if the merchant never responded.

Part 1. Total the disputed amount per merchant, returned as (merchant, total_cents) pairs sorted by merchant.

Part 2. A merchant has deadline_days to respond before the dispute auto-resolves against them. Flag every case whose response landed too late, meaning RESPONDED_DAY - OPENED_DAY is strictly greater than deadline_days. A record that never responded ("-") always counts as past the deadline. Return the flagged case ids sorted, alongside the per-merchant totals.
Inputrecords = "acme|cb_1|1500|10|12; acme|cb_2|800|10|25; globex|cb_3|2000|5|-; acme|cb_4|450|20|21" deadline_days = 7Output{ "disputed_by_merchant": [("acme", 2750), ("globex", 2000)], "past_deadline": ["cb_2", "cb_3"], }

Merchant acme disputed 1500 + 800 + 450 = 2750, and globex 2000. Record cb_2 responded on day 25 against an open of day 10, so 15 days, past the 7-day deadline. Record cb_3 never responded, so it is flagged. Records cb_1 (2 days) and cb_4 (1 day) are within the window.

How this uses the pattern

Parse, aggregate, flag. Split the string on semicolons, then split each record on the pipe into five fields and turn the cents and days into ints. Sum the amounts into a per-merchant dict. For the deadline, treat a "-" response as always late, otherwise compare responded minus opened against the deadline. Sort both outputs so the result is deterministic.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Chargeback Parser: Aggregate and Flag

Loading...
Click "Run" to execute your code
The Stripe angle
A 2024 new-grad online assessment asked candidates to parse chargeback records out of a dense string. That version went parse, then filter invalid records, then drop disputes the cardholder withdrew. The deadline rule here is a practice extension. The trap is the missing response: read a "-" as late before any int() call touches it.
Take it further
To match the 2024 version, add its two later steps. Filter out invalid records first, such as a wrong field count or a negative amount, then drop any dispute marked withdrawn. Keep parsing separate from the totals and both guards drop in without touching the math.

Key Takeaways

  • ✓Reconciliation is an index plus a claimed set: memo first, then amount by earliest due date, then a forgiveness tolerance.
  • ✓Validate CSV rows with a real CSV reader and check the rules in a fixed order, so every row gets exactly one code.
  • ✓Linked merchants is a graph problem: pairs over the threshold are edges, and a hop limit is a depth-capped breadth-first search.
  • ✓The email scheduler is day arithmetic plus a stable sort. Renewals lengthen the input; plan changes relabel the output.
Stripe interview guide

Know what Stripe asks before you walk in.

16 coding · 6 system design · 31 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Practical CodingHad your Stripe interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.