Financial Account Ledger
Reported by candidates from Stripe's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Stripe's Financial Account Ledger showed up in reports from September 2026, and it's a simulation problem dressed up as fintech. You get a command stream of INIT, FUND and BALANCE lines, and you have to compute settlement days per funding method. Nothing here needs fancy algorithms. The pain is the pile of rules: cutoff hours, weekends, business-day math, and per-account ACH limits by day and by week. One missed edge case and your output string is wrong. If you blank mid-assessment, StealthCoder runs invisibly on your desktop as a safety net while you work through it.
The problem
Process a chronological command stream for financial accounts. Implement processLedger and return every balance-query result as one comma-separated string in query order. Commands use these forms: INIT account_id starting_balance FUND timestamp account_id method amount BALANCE timestamp account_id A timestamp is either a whole-number day such as 8, or a day and hour such as 8,16. A day-only timestamp means hour 0. Day 1 is Monday; days 6 and 7 of each seven-day cycle are Saturday and Sunday. Commands INIT creates an account with an immediately settled starting balance. If an account is initialized more than once, only its first INIT has an effect. FUND adds a positive amount through WIRE, ACH, or STABLECOIN. Ignore funding for an unknown account. A fund contributes to balance only after it settles. BALANCE appends the account's starting balance plus every earlier accepted fund whose settlement day is at most the query day. Append FAILURE for an unknown account. Effective submission and settlement days For WIRE and ACH, first determine an effective submission day: A business-day request before its cutoff uses that day. A business-day request at or after its cutoff uses the next business day. A weekend request uses the following Monday, regardless of its hour. WIRE has cutoff hour 17 and settles on its effective submission day. ACH has cutoff hour 20 and settles one business day after its effective submission day. STABLECOIN has no cutoff and settles on its request day, including weekends. Settlement is by calendar day, not by hour. A fund that settles on day d is available to any later BALANCE command on day d, regardless of the query hour. It never affects a command that occurs earlier in the input stream. ACH limits Track accepted ACH principal separately for each account and bucket it by the effective submission day: At most 5,000,000 minor units may be accepted for one effective business day. At most 10,000,000 minor units may be accepted in one seven-day week: days 1-7 are week 1, days 8-14 are week 2, and so on. If an ACH request would exceed either limit, reject the entire request. A rejected request never settles and consumes neither limit. WIRE and STABLECOIN are unlimited. Output Join all BALANCE results with commas. Return the empty string when there is no BALANCE command. Function processLedger(commands: String[]) → String Examples Example 1 commands = ["INIT acct_1 10000","FUND 1 acct_1 WIRE 5000","FUND 1 acct_1 ACH 3000","BALANCE 1 acct_1","BALANCE 2 acct_1"] return = "15000,18000" The Monday wire settles on day 1. The Monday ACH settles one business day later, on day 2. Example 2 commands = ["INIT acct_1 0","FUND 5 acct_1 WIRE 5000","BALANCE 5 acct_1","FUND 6 acct_1 STABLECOIN 1000","BALANCE 6 acct_1","FUND 6 acct_1 ACH 2000","BALANCE 8 acct_1","BALANCE 9 acct_1"] return = "5000,6000,6000,8000" The Friday wire settles that day. Stablecoin settles on Saturday. Saturday's ACH request uses Monday, day 8, as its effective submission day and settles Tuesday, day 9. Example 3 commands = ["INIT acct_1 0","FUND 1,16 acct_1 WIRE 5000","FUND 1,17 acct_1 WIRE 3000","BALANCE 1,18 acct_1","BALANCE 2,0 acct_1"] return = "5000,8000" The 16:00 wire is before the hour-17 cutoff and settles on day 1. The 17:00 wire is at the cutoff, so it settles on day 2. Example 4 commands = ["INIT acct_1 0","FUND 1,10 acct_1 ACH 5000000","FUND 1,11 acct_1 ACH 1000","FUND 2,11 acct_1 ACH 4000000","BALANCE 2,12 acct_1","BALANCE 3,0 acct_1","FUND 3,10 acct_1 ACH 2000000","BALANCE 4,0 acct_1"] return = "5000000,9000000,9000000" The second day-1 ACH is rejected by the daily limit. The day-2 request is accepted, bringing the week total to 9,000,000. The day-3 request is rejected because it would exceed the 10,000,000 weekly limit. Constraints 1 <= commands.length <= 1000. Commands are well-formed and use only the documented command types and funding methods. Account IDs are non-empty and contain no spaces. All INIT commands precede every timestamped command. Starting balances are nonnegative and funding amounts are positive. Every amount, balance, limit total, and intermediate value fits in a signed 64-bit integer. Parts using whole-day timestamps may contain multiple commands on one day; input order is their processing order. Explicit day,hour timestamps use hours from 0 through 23, are strictly chronological, and never repeat. The implementation must accept both whole-day and day,hour timestamps.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The input is capped at 1000 commands, so you don't need cleverness. A per-command pass with a hash map per account is plenty. The trick is isolating one helper that turns (method, day, hour) into an effective submission day and a settlement day. Weekend check: day mod 7 is 6 or 0. Next business day: skip Saturday and Sunday, so Friday goes to Monday. ACH settles one business day after the effective day, so Friday ACH lands the following Tuesday if it rolled over. Pitfalls: counting a rejected ACH against limits, bucketing the weekly limit by the request day instead of the effective day, and forgetting that day-only means hour 0. Also ignore duplicate INITs and FUNDs for unknown accounts. Store accepted funds as (settleDay, amount) and sum on each BALANCE. StealthCoder is your hedge in the live OA if the date math tangles.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Financial Account Ledger 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. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Stripe's OA.
Stripe reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Financial Account Ledger FAQ
How hard is the Stripe Financial Account Ledger really?+
Medium on difficulty, high on annoyance. No advanced data structure is needed. The risk is the number of rules interacting: cutoffs, weekends, business days, and two ACH limits. Write the date helper first, test it on the four examples, then build the rest around it.
What's the trick to the settlement day logic?+
Compute the effective submission day first, then the settlement day. WIRE and ACH both roll to the next business day at or after their cutoff, and weekends always roll to Monday. ACH then adds one more business day. STABLECOIN skips all of this and settles on the request day.
How do the ACH limits work?+
Per account, bucket accepted principal by effective submission day and by week, where week is (day-1)/7. Check both the daily 5,000,000 and weekly 10,000,000 caps before accepting. If either would be exceeded, reject the whole request and don't add to either bucket.
Is brute force fine with this input size?+
Yes. With at most 1000 commands, summing every accepted fund on each BALANCE is cheap. Don't waste time on prefix sums or sorted structures. Spend that effort on correctness of the day and hour parsing instead.
How do I prepare in 48 hours?+
Practice parsing the comma timestamp, then hand-trace the four examples through your code. Write tests for Friday ACH, Saturday ACH, a request at exactly the cutoff hour, and a rejected ACH followed by a smaller accepted one. Those cover most failure cases.