Reported September 2026
Stripehash table

Monthly Latest-Balance Reconciliation

Reported by candidates from Stripe's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Stripe OA. Under 2s to a working solution.
Founder's read

The Stripe OA reported in September 2026 looks like string parsing, but one edge case sinks the naive solution: rows from the wrong month, or a comparison table whose latest row is on a different day than the primary one. It's a hash-map-and-sort problem dressed up as reconciliation. You filter by month, keep the latest row per bank/account in each table, then compare balances. If you blank on the details mid-assessment, StealthCoder runs invisibly as a safety net and hands you the structure. The logic is short. The traps are in the filtering and the sort.

The problem

Each CSV row has canonical fields bank,account,endDate,balance, where endDate is ISO YYYY-MM-DD and balance is a signed integer. Given a target month in YYYY-MM form, find the latest row in that month for every bank/account present in primaryRows.
Compare its balance with the latest same-month row for the same bank/account in comparisonRows. Emit bank,account,endDate,balance,MATCH when balances agree, otherwise end with NOT_MATCH. Return rows sorted by bank, then account.

Function
reconcileMonthlyBalances(primaryRows: String[], comparisonRows: String[], month: String) → String[]

Examples
Example 1
primaryRows = ["HSBC,123,2021-12-31,150","BA,566,2021-12-31,300"]
comparisonRows = ["HSBC,123,2021-12-30,150","BA,566,2021-12-31,250"]
month = "2021-12"
return = ["BA,566,2021-12-31,300,NOT_MATCH","HSBC,123,2021-12-31,150,MATCH"]
HSBC balances agree; BA balances differ. Output is sorted.
Example 2
primaryRows = ["A,1,2022-01-01,10","A,1,2022-01-31,20"]
comparisonRows = ["A,1,2022-01-15,20"]
month = "2022-01"
return = ["A,1,2022-01-31,20,MATCH"]
Only each table's latest row in January participates.
Example 3
primaryRows = ["A,1,2020-05-31,-5"]
comparisonRows = []
month = "2020-05"
return = ["A,1,2020-05-31,-5,NOT_MATCH"]
A missing comparison account does not match.

Constraints
Each input contains at most 10^5 rows.
Fields contain no commas; dates and month are valid canonical ISO strings.
At most one row exists per bank/account/endDate within one input.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Build one map per input, keyed by bank plus account. Skip any row whose endDate doesn't start with the target month. For the rest, keep the row with the lexicographically larger endDate, since ISO dates compare correctly as strings. That's the greedy part: one pass, no sorting of raw rows. Then iterate the primary map only. Look up the same key in the comparison map. Emit MATCH only if the key exists and balances are equal, otherwise NOT_MATCH. Pitfalls: comparing balances as strings (parse them, negatives exist), using the comparison table's latest date in the output instead of the primary's, and sorting by the joined string instead of by bank then account. Account may be numeric-looking, but the spec says sort as given, so confirm whether to compare as strings. Use a composite key with a safe separator. That's O(n log n) overall. If the sort comparator or month filter trips you live, StealthCoder is the hedge.

Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.

If this hits your live OA

You can drill Monthly Latest-Balance Reconciliation cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Stripe's OA.

Stripe reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Monthly Latest-Balance Reconciliation FAQ

What's the trick in the Stripe Monthly Latest-Balance Reconciliation problem?+

Filter by month first, then keep only the latest row per bank/account in each table using a hash map. ISO dates compare correctly as plain strings, so no date parsing is needed. Then compare primary against comparison and sort the output.

How hard is this one really?+

Easy to medium on algorithm, medium on care. There's no clever data structure. The difficulty is handling the edge cases: rows outside the month, missing comparison accounts, negative balances, and the exact output format with MATCH or NOT_MATCH.

Which rows get emitted in the output?+

Only bank/account pairs present in primaryRows with at least one row in the target month. Accounts that exist only in comparisonRows are ignored. The endDate and balance in the output come from the primary table's latest row.

What happens if the comparison table has no row for that account?+

It's NOT_MATCH. Example 3 shows this with an empty comparisonRows. Don't default the missing balance to zero, or an account with a zero balance would falsely match.

How do I prepare for this in 48 hours?+

Practice grouping rows by composite key and keeping the max per group, then multi-key sorting. Write a quick parser for CSV strings and test with negative balances and empty inputs. Reconciliation-style questions at Stripe tend to reward careful edge-case handling over fancy algorithms.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Stripe.

OA at Stripe?
Invisible during screen share
Get it