FastPrepAccount Scheduler - Availability and Acquire
Problems/Account Scheduler - Availability and Acquire

Account Scheduler - Availability and Acquire

Stripe logoStripe● MediumFULLTIMENEW GRADONSITE INTERVIEW

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: July 26, 2026 — 🌺 I re-audited the original author-written source and rebuilt this practice version from the available interview report. It is about a 75% match to the available source. The AccountScheduler class, account list, locked-until map, availability check, acquire follow-up, automatic account selection, and LRU tie-breaking come directly from the author-written report. The report includes an availability example but does not show the exact runnable function signature, command serialization, output strings, all acquire preconditions, constraints, or edge cases, so FastPrep supplied those adapter details consistently and labels them as practice scaffolding.

You manage a set of accounts that can be locked until a given time. Process a sequence of time-stamped queries and report availability.

Setup: accountIds is an int[] of account ids. lockedUntil is a String[] where each entry is "accountId,timestamp" giving the time each account is initially locked until (an account not listed is unlocked, i.e. locked until 0).

An account is available at time t when its lock time is <= t (i.e. t >= lockedUntil). Queries arrive in order, with no concurrency:

  • IS_AVAILABLE <accountId> <t>: output true if the account is available at time t, else false.
  • ACQUIRE <accountId> <duration> <t>: lock the account for duration time units starting at the query time t, i.e. set its lock time to t + duration. Output OK.

Return a String[] with one output line per query, in order.

(Follow-up discussed in the source but not part of this contract: an ACQUIRE with no account id that auto-picks the least-recently-used available account; this draft covers the deterministic explicit-id availability and acquire behavior.)

Function

processScheduler(accountIds: int[], lockedUntil: String[], queries: String[]) → String[]

Examples

Example 1

accountIds = [1, 2, 3, 4]lockedUntil = ["1,10", "2,5", "3,0", "4,20"]queries = ["IS_AVAILABLE 1 8", "IS_AVAILABLE 2 8", "IS_AVAILABLE 3 1", "IS_AVAILABLE 4 21"]return = ["false", "true", "true", "true"]

Account 1 is locked until 10, so at t=8 it is not available -> false. Account 2 locked until 5, at t=8 available -> true. Account 3 locked until 0, at t=1 available -> true. Account 4 locked until 20, at t=21 available -> true.

Example 2

accountIds = [1, 2, 3, 4]lockedUntil = ["1,10", "2,5", "3,0", "4,20"]queries = ["IS_AVAILABLE 3 1", "ACQUIRE 3 5 1", "IS_AVAILABLE 3 4", "IS_AVAILABLE 3 6"]return = ["true", "OK", "false", "true"]

At t=1 account 3 (locked until 0) is available -> true. ACQUIRE 3 for duration 5 at t=1 locks it until 1+5=6 -> OK. At t=4, 4 < 6 so it is not available -> false. At t=6, 6 >= 6 so it is available again -> true.

Constraints

  • lockedUntil entries are "accountId,timestamp"; unlisted accounts are locked until 0.
  • An account is available at t iff t >= lockedUntil.
  • ACQUIRE accountId duration t sets the lock time to t + duration and outputs OK.
  • Queries are processed in order with no concurrency; output one line per query.

More Stripe Onsite Interview questions

  • Render a Task Tree from CSV RowsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Invoice / Payment ReconciliationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Parse Boolean Rule ExpressionsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Transaction Rule Expression EvaluatorONSITE INTERVIEW · Seen Oct 2026
  • Evaluate Ordered Action RulesPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • WebSocket Load Balancer — Parts 1–5OA · ONSITE INTERVIEW · Seen Sep 2026
  • Rule-Driven Transaction Fraud DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026
  • Account Balance Manager Part 3 - Platform CoverageONSITE INTERVIEW · Seen May 2026
  • Account Balance Manager Part 2 - Reject OverdraftsONSITE INTERVIEW · Seen May 2026
  • Account Balance Manager Part 1 - Calculate TotalsONSITE INTERVIEW · Seen May 2026

Similar questions at other companies

  • In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
  • In-Memory Vault File SystemHarvey · ONSITE INTERVIEWHarvey interview questions
  • In-Memory Directory and File OperationsSquarepoint Capital · ONSITE INTERVIEWSquarepoint Capital interview questions
  • In-Memory Spreadsheet ValuesRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
  • Feature Flag Evaluation EngineCresta · ONSITE INTERVIEWCresta interview questions
  • Card Transaction StreamCapital One · ONSITE INTERVIEWCapital One interview questions
  • Return Every Matching DecryptionDuolingo · PHONE SCREENDuolingo interview questions
  • Parcel Event TrackingAirbnb · OAAirbnb interview questions
  • Reference-Counted Deduplicating File SystemCitadel · PHONE SCREENCitadel interview questions
  • Machine Message RouterOpenAI · PHONE SCREENOpenAI interview questions

Interview reports that mention this question

  • Stripe New Grad Interview Question Bank: 47 Problems

Stripe interview experiences

  • Stripe SWE Onsite over Two Days: 1 Experience
  • Stripe New Grad SWE Phone Screen and Onsite: 2 Experiences
  • Stripe AI Coding Interview, Experienced SWE: 6 Experiences
  • Stripe SWE Intern Payout Scheduler Phone Screen: 1 Experience
  • Stripe New Grad SWE Onsite and HM Round: 1 Experience
All Stripe interview questionsSee Stripe hiring insights
Saved
class Solution {
    public String[] processScheduler(int[] accountIds, String[] lockedUntil, String[] queries) {
      // write your code here
    }
}
Checking account…