Progressive Banking Service Operations
Reported by candidates from Valon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
The edge case that breaks most solutions on this Valon OA, reported in October 2026, is the one-cent fee and the pending slow transfer sitting in limbo. Progressive Banking Service Operations is a design problem dressed up as string parsing. You process up to 10^5 operations in timestamp order, keep balances in integer cents, and return one formatted string per operation. The bugs hide in failed operations that must not mutate anything, accounts that spring into existence on first reference, and statements that must log the right record. If you're taking this OA soon, know the shape before you start. StealthCoder is the safety net if you blank mid-assessment.
The problem
Process banking operations in strictly increasing timestamp order. Money values are integer cents. An account is created with zero available balance on first reference. DEPOSIT t account amount credits the amount. WITHDRAW t account amount debits available funds or fails without mutation. TRANSFER t from to amount performs an instant internal transfer or fails without mutation. EXTERNAL_OUT t account amount debits amount + 1 cents, including the one-cent fee, or fails. EXTERNAL_IN t account amount credits amount - 1 cents after the one-cent fee; the amount is at least one. SLOW_INIT t transferId from to amount reserves funds by removing them from the source available balance. It fails for a duplicate ID or insufficient funds. SLOW_COMPLETE t transferId credits the reserved funds to the destination and removes the pending transfer, or returns NOT_FOUND. BALANCE t account returns the available balance. STATEMENT t account returns all mutation records for that account, joined with commas. Each record is timestamp:type:amount:status:resultingBalance. Mutations return OK|balance or FAILED|balance. Instant transfers return OK|fromBalance|toBalance or FAILED|fromBalance|toBalance. Slow completion returns OK|destinationBalance or NOT_FOUND. Return one result per operation. Function processBankingOperations(operations: String[][]) → String[] Examples Example 1 operations = [["DEPOSIT","1","a","100"],["WITHDRAW","2","a","30"],["TRANSFER","3","a","b","50"],["BALANCE","4","a"],["BALANCE","5","b"]] return = ["OK|100","OK|70","OK|20|50","20","50"] The deposit and withdrawal leave 70 cents, then the instant transfer moves 50 cents to b. Example 2 operations = [["DEPOSIT","1","a","10"],["SLOW_INIT","2","x","a","b","8"],["BALANCE","3","a"],["SLOW_COMPLETE","4","x"],["STATEMENT","5","b"]] return = ["OK|10","OK|2","2","OK|8","4:SLOW_IN:8:SUCCESS:8"] Initiation removes the reserved funds from a. Completion credits b and records the incoming slow transfer. Constraints 1 <= operations.length <= 10^5. Timestamps are non-negative signed 64-bit integers and strictly increase. Amounts are positive and balances, amounts, and intermediate sums fit in signed 64-bit integers. Account and transfer IDs are non-empty and do not contain :, |, or commas.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The pattern is a hash-map state machine. Keep a map of account to balance and a map of account to a list of statement records. Keep a second map of transferId to pending (from, to, amount). Every operation is an O(1) lookup plus an append. The trap is order of checks. Create accounts on first reference even when the operation fails, then check funds, then mutate. EXTERNAL_OUT needs amount + 1 available. EXTERNAL_IN credits amount - 1. SLOW_INIT must reject duplicate IDs, and completion must delete the pending entry so a second completion returns NOT_FOUND. Example 2 shows the destination statement gets a SLOW_IN record at completion time, with the completion timestamp. Don't forget the source's record at initiation. Use long for everything. If you freeze on the output formats, StealthCoder can fill in the scaffolding live, but the logic above is what you need to hold.
If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.
You can drill Progressive Banking Service Operations 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 passed his OA cold and still thinks the filter is broken.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Valon's OA.
Valon reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Progressive Banking Service Operations FAQ
How hard is Progressive Banking Service Operations really?+
The algorithm is easy, it's all hash map lookups. The difficulty is volume. You have ten operation types, each with its own return format, and one wrong pipe or missing record fails hidden tests. Expect it to be a careful implementation problem, not a clever one.
What's the trick to the slow transfer?+
Treat SLOW_INIT as a debit that parks money in a pending map keyed by transferId. SLOW_COMPLETE looks up the ID, credits the destination, deletes the entry, and logs the incoming record. A missing or already-completed ID returns NOT_FOUND. Never touch balances on a failed init.
Do failed operations still create accounts?+
The statement says an account is created with zero balance on first reference. Create it before checking funds, so a failed WITHDRAW on a new account returns FAILED|0. For transfers, create both accounts. Test this case yourself before submitting.
What should the statement record look like?+
Each record is timestamp:type:amount:status:resultingBalance, joined with commas. Example 2 shows 4:SLOW_IN:8:SUCCESS:8 for the destination. Store records as strings or small structs at mutation time, with the balance captured right after the change, not recomputed later.
How do I prepare in 48 hours?+
Write a dispatcher with a switch on the operation name, then implement each case against two maps. Run both examples by hand. Add tests for insufficient funds, duplicate slow IDs, double completion, and the one-cent fee boundary. Use 64-bit integers throughout.