FastPrepFour-Level Banking System with Scheduled Payments
Problems/Four-Level Banking System with Scheduled Payments

Four-Level Banking System with Scheduled Payments

ZipRecruiter logoZipRecruiter● HardNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter new-grad OA report describes all four levels: accounts and transfers, rankings of outgoing amounts, scheduled payments with cancellation and ties by creation order, and merges with historical balance queries. Our batch input supplies the exact output text and keeps those transitions.

Process strictly increasing timestamped string queries. Before each query, execute due scheduled payments by due time then creation order.

  • CREATE_ACCOUNT,t,id, DEPOSIT,t,id,amount, and TRANSFER,t,source,target,amount.
  • TOP_SPENDERS,t,n ranks active accounts by outgoing total descending then ID ascending, formatted id(total).
  • SCHEDULE_PAYMENT,t,id,amount,delay returns a global payment ID; a due payment debits and counts as outgoing only when funds suffice. CANCEL_PAYMENT,t,id,payment cancels an owned pending payment.
  • MERGE_ACCOUNTS,t,first,second absorbs second into first, carrying balance, outgoing total, pending payments, and history.
  • GET_BALANCE,t,id,timeAt returns the latest balance at or before timeAt, or empty when unavailable.

Return one serialized string per query; invalid numeric operations return empty, and booleans use lowercase.

Function

processBankingQueries(queries: String[][]) → String[]

Examples

Example 1

queries = [["CREATE_ACCOUNT","1","a"],["DEPOSIT","2","a","100"],["SCHEDULE_PAYMENT","3","a","30","5"],["GET_BALANCE","4","a","2"],["DEPOSIT","8","a","1"]]return = ["true","100","payment1","100","71"]

The payment executes at timestamp 8 before the deposit.

Example 2

queries = [["CREATE_ACCOUNT","1","a"],["CREATE_ACCOUNT","2","b"],["DEPOSIT","3","a","50"],["TRANSFER","4","a","b","20"],["TOP_SPENDERS","5","2"]]return = ["true","true","50","30","a(20),b(0)"]

The transfer contributes 20 outgoing for a.

Constraints

  • 1 <= queries.length <= 500
  • Timestamps are unique and strictly increasing.
  • Amounts and delays are positive.

More ZipRecruiter Online Assessment questions

  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024
  • Count Case-Insensitive Key ChangesOA · Seen Sep 2024

Similar questions at other companies

  • In-Memory File SystemAirbnb · OAAirbnb interview questions
  • Power Cell BankOptiver · OAOptiver interview questions
  • Task Management SystemCoinbase · OACoinbase interview questions
  • Task Management SystemAnthropic · OAAnthropic interview questions
  • Progressive Parcel Tracking OperationsKlaviyo · OAKlaviyo interview questions
  • Versioned Recipe SystemThe Trade Desk · OA
  • Recipe Management SystemRamp · OARamp interview questions
  • Document and Layer OperationsFigma · OAFigma interview questions
  • Worker Management with Promotions and Double-Paid TimeInstacart · ONSITE INTERVIEWInstacart interview questions
  • Document Enrichment Stream AggregatorBloomberg LP · PHONE SCREENBloomberg LP interview questions

Interview reports that mention this question

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences

ZipRecruiter interview experiences

  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public String[] processBankingQueries(String[][] queries) {
        // Write your code here.
    }

}
Checking account…