Reported July 2026
Virtu Financialsimulation

Banking Transaction Exceptions

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

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

The Virtu Financial OA reported in July 2026 hands you a bank account that starts at 1500.0, and the whole job is bookkeeping. No clever algorithm here. It's a simulation: walk the operations list, track a balance, keep a history list, and format strings exactly right. The risk isn't difficulty, it's the details. A missing ".0" or a wrong error row fails hidden tests. If you blank on the formatting rules under the clock, StealthCoder is the invisible safety net that reads the problem and gives you a working solution.

The problem

Implement the behavior of a bank account that starts with a balance of 1500.0. Process the rows of operations from left to right while maintaining the current balance and a history of successful transactions.
Transaction records
Each successful deposit or withdrawal creates a transaction record containing its type, amount, and resulting balance. Its string representation is:
Type: {transaction_type}, Amount: {amount}, Balance: {balance}
Amounts are positive whole numbers. Balances are displayed with a trailing.0.
Operations
Each row has one of these forms:
["deposit", amount]: Add amount to the balance and append a deposit record. Return ["Transaction successful!", "Updated account balance: {balance}"].
["withdraw", amount]: If the balance is sufficient, subtract amount, append a withdrawal record, and return the same two success messages. Otherwise return ["InsufficientFundsError"], leave the balance unchanged, and do not modify history.
["view_transaction_history"]: Return every successful transaction record in chronological order. Return an empty row when there is no history.
Return one string row for every operation, in the same order.

Function
simulateBankingTransactions(operations: String[][]) → String[][]

Examples
Example 1
operations = [["deposit","200"],["withdraw","500"],["view_transaction_history"]]
return = [["Transaction successful!","Updated account balance: 1700.0"],["Transaction successful!","Updated account balance: 1200.0"],["Type: deposit, Amount: 200, Balance: 1700.0","Type: withdraw, Amount: 500, Balance: 1200.0"]]
The deposit raises the balance from 1500.0 to 1700.0. The withdrawal then lowers it to 1200.0. The final operation returns both successful transaction records in order.
Example 2
operations = [["withdraw","1600"],["view_transaction_history"]]
return = [["InsufficientFundsError"],[]]
The account has only 1500.0, so the withdrawal fails without changing the balance or history. Viewing history therefore returns an empty row.
Example 3
operations = [["view_transaction_history"],["deposit","50"],["view_transaction_history"],["withdraw","1550"],["view_transaction_history"]]
return = [[],["Transaction successful!","Updated account balance: 1550.0"],["Type: deposit, Amount: 50, Balance: 1550.0"],["Transaction successful!","Updated account balance: 0.0"],["Type: deposit, Amount: 50, Balance: 1550.0","Type: withdraw, Amount: 1550, Balance: 0.0"]]
The first history view is empty. After the deposit, history contains one record. Withdrawing exactly the full balance succeeds, leaves 0.0, and adds the second record.

Constraints
1 <= operations.length <= 2000
Each operation is exactly one of deposit, withdraw, or view_transaction_history.
Deposit and withdrawal rows contain a base-10 positive integer amount string in the range 1 through 10^9.
The running balance always fits in a signed 64-bit integer.
A history view does not change the account state.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The pattern is plain simulation. Keep two variables: a balance starting at 1500 and a list of record strings. For deposit, add, append "Type: deposit, Amount: X, Balance: Y.0", and return the two success messages. For withdraw, check balance >= amount first. Equal amounts succeed, and Example 3 proves it by landing on 0.0. On failure return ["InsufficientFundsError"] and touch nothing. For history, return a copy of the list, which is an empty row when nothing succeeded. The pitfalls are all formatting. Amounts print as integers, balances get a trailing ".0", and the type string for withdrawals is "withdraw", not "withdrawal". Parse amounts as 64-bit ints since they reach 10^9 and sums can grow. Don't append failed withdrawals to history. If you freeze on the exact strings during the live assessment, StealthCoder is the hedge that gives you the output format fast.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Banking Transaction Exceptions 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 StealthCoder

Related leaked OAs

⏵ The honest play

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

Virtu Financial 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.

Banking Transaction Exceptions FAQ

How hard is the Banking Transaction Exceptions question really?+

Easy on algorithms, annoying on details. It's a linear pass over up to 2000 operations with a balance and a list. Most failures come from string formatting and the edge case where a withdrawal equals the full balance, not from logic.

What's the trick to this Virtu Financial problem?+

There's no trick beyond precision. Check balance >= amount before withdrawing, only record successful transactions, and format balances with a trailing ".0". Return a new row for every single operation, including history views and failures.

Does a failed withdrawal change the history?+

No. An insufficient funds withdrawal returns ["InsufficientFundsError"], leaves the balance alone, and adds nothing to history. Example 2 shows this: the later history view returns an empty row because nothing succeeded.

What data types should I use for the balance?+

Store the balance as a 64-bit integer and append ".0" when printing. Amounts go up to 10^9 and the running balance fits in signed 64-bit, so a 32-bit int could overflow. Avoid floating point formatting, which can print unwanted decimals or scientific notation.

How do I prepare for this in 48 hours?+

Write the solution once from scratch and run all three examples by hand. Focus on exact output strings, the empty history row, and the exact-balance withdrawal. Simulation problems like this reward careful reading more than extra algorithm practice.

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

OA at Virtu Financial?
Invisible during screen share
Get it