FastPrepProgressive Banking Service Operations
Problems/Progressive Banking Service Operations

Progressive Banking Service Operations

Valon logoValon● HardFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report gives the cash, history, internal-transfer, external-transfer, fee, and slow-transfer features, one step at a time. The finite operation encoding, creating an account the first time it is mentioned, a one-cent fee, an explicit step for finishing a slow transfer, and fixed result strings are our choices.

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.

More Valon interview questions

  • Out-of-Order Loan LedgerPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • LFU CacheAmazon · ONSITE INTERVIEW
  • LFU CacheSnowflake · OA · ONSITE INTERVIEWSnowflake interview questions
  • 15-Minute Chat Session TrackerOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • LRU Cache with TTLAutodesk · ONSITE INTERVIEWAutodesk interview questions
  • Recover a Function-Call LRU Cache with a Write-Ahead LogAnthropic · ONSITE INTERVIEWAnthropic interview questions
  • Nested Transaction Key-Value Store with Value CountsLyft · ONSITE INTERVIEWLyft interview questions
  • Randomized Collection with Duplicate ValuesOkta · ONSITE INTERVIEWOkta interview questions
  • Blocking Connection Pool Operation TraceGoogle · ONSITE INTERVIEWGoogle interview questions
  • Worker Management with Promotions and Double-Paid TimeInstacart · ONSITE INTERVIEWInstacart interview questions
  • LFU CacheSalesforce · ONSITE INTERVIEWSalesforce interview questions
See Valon hiring insights
Saved
class Solution {
    public String[] processBankingOperations(String[][] operations) {
        // Write your code here.
    }
}
Checking account…