FastPrepAccount Balance Manager Part 3 - Platform Coverage
Problems/Account Balance Manager Part 3 - Platform Coverage

Account Balance Manager Part 3 - Platform Coverage

Stripe logoStripe● MediumFULLTIMEINTERNONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: This practice version matches the reported core task at about 65%. The internship author links a report in which a platform covers another account’s shortfall. Part 3a also requests max_reserve, rejected rows, and nonzero balances. The runner returns total coverage; the fuller outputs are worked as a follow-up. No repayment, sufficient funding, reserve interpretation, numeric bounds, and platform-own transaction behavior are practice choices. Part 3b’s rules were not disclosed.

Practice sequence

  1. Part 1: Calculate Totals
  2. Part 2: Reject Overdrafts
  3. Part 3: Platform Coverage (you are here)

Transaction format

The original rows look like account_name,timestamp,currency,amount. They come in time order and all use one currency. A positive amount adds money. A negative amount takes money out.

Rules

Your function gets the transactions in order as account_id,amount strings. The timestamp and currency are already removed, so do not sort the rows or convert currencies. Every account starts with a balance of 0. One account name is the platform account.

  • If a transaction leaves the balance at zero or above, apply it as usual.
  • If a non-platform account would go negative, the platform pays exactly the shortfall, so that account ends at 0.
  • The platform account's own transactions are never covered. You can assume the platform always has enough money.

Return the total amount the platform paid to cover shortfalls, as one integer.

Interview follow-up: Report Part 3a state

The follow-up asks you to also return max_reserve, the rejected transactions, and the final nonzero balances. Assume no repayment and that the platform always has enough money. The reserve is the total money committed to coverage so far. It never goes down, so its maximum equals the total coverage your function returns.

Keep the final balance of every account and report the nonzero ones. The rejection list is empty under these rules. User shortfalls are always covered, and the platform's own changes are applied as they are. Your function still returns only the one integer. These extra outputs are only for the follow-up.

account_name,timestamp,currency,amount
acct_123,1,usd,1000
acct_321,3,usd,400
acct_321,4,usd,-500

With platform acct_123, the shortfall is 100. Your function returns 100. The fuller outputs are max_reserve = 100, rejected_transaction = [], and acct_123:900. The covered account ends at zero, so it is left out.

Complete report exercise

As an extra exercise, write fullCoverageReport. It takes a String[] transactions parameter and a String platformAccount parameter. Each input row has exactly four comma-separated fields: account_name,timestamp,currency,amount. There is no header, all rows use one currency, and they come in time order. The account and number limits above still apply. Return a String[][] with exactly three rows:

  • Row 0 holds one string: max_reserve written in decimal.
  • Row 1 holds the rejected original rows.
  • Row 2 holds the final nonzero account:balance strings, sorted by account name in ASCII order.

The practice workspace only tests processWithCoverage, which takes the two-field rows and returns an integer.

For this follow-up, assume no repayments and that the platform always has enough money when coverage is needed. The reserve is the total amount committed to coverage. It never goes down, so its maximum equals the total coverage. The platform's own changes are applied directly, without coverage. Under these rules every transaction is accepted, so row 1 is empty.

The example returns [["100"],[],["acct_123:900"]]. The platform started with 1000 and paid the recipient’s 100 shortfall, leaving 900. The recipient ends at zero, so it is left out.

A second example uses platform p and rows ["p,1,usd,100", "u,2,usd,-10", "u,3,usd,4", "u,4,usd,-7", "v,5,usd,3"]. The platform covers 10 and then 3. The deposit of 4 belongs to u and does not pay back the earlier coverage. It only shrinks the next shortfall from 7 to 3. Return [["13"],[],["p:87","v:3"]]. The tested function, processWithCoverage, returns 13. The rules of Part 3b were never shared, so this problem does not cover them.

Function

processWithCoverage(transactions: String[], platformAccount: String) → int

Examples

Example 1

transactions = ["platform,1000", "account_A,100", "account_A,-150", "account_B,50", "account_B,-100", "account_A,-30"]platformAccount = "platform"return = 130

platform +1000 -> 1000. account_A +100 -> 100. account_A -150 -> would be -50, platform pays 50, account_A becomes 0 (covered total 50). account_B +50 -> 50. account_B -100 -> would be -50, platform pays 50, account_B becomes 0 (covered total 100). account_A -30 -> would be -30, platform pays 30, account_A becomes 0 (covered total 130). Total covered = 130.

Example 2

transactions = ["platform,500", "account_A,20", "account_A,-20"]platformAccount = "platform"return = 0

account_A +20 -> 20, then -20 -> exactly 0, which does not go negative, so no coverage is needed. The platform pays nothing.

Example 3

transactions = ["acct_123,1000","acct_321,400","acct_321,-500"]platformAccount = "acct_123"return = 100

The recipient has 400, which cannot cover its 500 withdrawal. The platform pays the missing 100 and ends at 900. The recipient ends at 0. Total coverage is 100. In the follow-up, with no repayments, max_reserve is 100 and no rows are rejected.

Constraints

  • Each transaction is "account_id,amount" with an integer amount.
  • When a non-platform account would go negative, the platform covers the shortfall so that account ends at exactly 0, and the platform account is debited by that shortfall.
  • The platform account is treated as a normal account for its own transactions and is never itself covered.
  • Assume the platform always has enough money.
  • Return the total amount paid by the platform as an integer.
  • You can assume that parsed amounts, all intermediate additions, balances, and negated shortfalls fit in a signed 64-bit integer. Account identifiers are nonempty ASCII strings without commas or colons.
  • The total coverage is not negative and fits in a signed 32-bit integer.

More Stripe Onsite Interview questions

  • Parse Boolean Rule ExpressionsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Invoice / Payment ReconciliationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Render a Task Tree from CSV RowsPHONE 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 2 - Reject OverdraftsONSITE INTERVIEW · Seen May 2026
  • Account Balance Manager Part 1 - Calculate TotalsONSITE INTERVIEW · Seen May 2026
  • Merge and Filter Prioritized ConfigurationsONSITE INTERVIEW · Seen Apr 2026

Similar questions at other companies

  • Route Pattern MatcherGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Query Log MatchDatadog · PHONE SCREEN · ONSITE INTERVIEWDatadog interview questions
  • File System Shell CommandsHarvey · ONSITE INTERVIEWHarvey interview questions
  • Feature Flags with Rules, Dependencies and ExposurePerplexity AI · ONSITE INTERVIEWPerplexity AI interview questions
  • Generate Word Guess FeedbackAtlassian · ONSITE INTERVIEWAtlassian interview questions
  • Stable Unique Column RenamesMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Most Frequent Call Path in Interleaved LogsRoblox · ONSITE INTERVIEWRoblox interview questions
  • Dictionary Records to an Editable XML TreeSnap Inc. · ONSITE INTERVIEWSnap Inc. interview questions
  • Choose the Next Hidden-Word GuessFlexport · ONSITE INTERVIEWFlexport interview questions
  • In-Memory Directory and File OperationsSquarepoint Capital · ONSITE INTERVIEWSquarepoint Capital interview questions

Interview reports that mention this question

  • Stripe SWE Internship Account Balance and Bikemap Onsite

Stripe interview experiences

  • Stripe New Grad SWE OA and Phone Screen: 2 Experiences
  • Stripe Experienced SWE OA and Onsite Questions: 3 Experiences
  • Stripe SWE Intern Linked Merchants Team Screen: 1 Experience
  • Stripe OA: What It Tests (2026)
  • Stripe SWE Onsite over Two Days: 1 Experience
All Stripe interview questionsSee Stripe hiring insights
Saved
class Solution {
    public int processWithCoverage(String[] transactions, String platformAccount) {
      // write your code here
    }
}
Checking account…