FastPrepMerchant Payout Reserve Calculator
Problems/Merchant Payout Reserve Calculator

Merchant Payout Reserve Calculator

Stripe logoStripe● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Stripe phone screen for a full-time software engineer role. The task was to work out how much of a merchant's payout to hold back as a reserve. Part 1 takes one percentage of a merchant's volume and caps it. Part 2 splits the volume by source, gives each source its own rate and cap with a default for the rest, caps each source and then adds them up.

The report does not say how money and rates are stored or how to round. Here, amounts are whole cents, rates are in hundredths of a percent (500 means 5%), and each source's reserve is rounded down to a whole cent before its cap. The report's merchant profile also has a timestamp that does not change the answer, so we left it out. Both parts use one function: Part 1 is one source with only the default policy.

Our version is about 90% the same as the reported question.

Return the total reserve to hold back from a merchant's payout, given the money each source brought in and a reserve policy for each source.

All money is in whole cents. The merchant's processing volume is split by source: volumes[i] cents came from source sources[i].

Policy j is for source policySources[j]. It holds back reserveRates[j] hundredths of a percent of that source's volume, so 500 means 5%, and it holds back at most maxReserves[j] cents. A source with no policy of its own uses the policy named "default".

Each source's reserve is volume * rate / 10000, rounded down to a whole cent. If that is more than the policy's maximum, use the maximum instead. Return the sum over all sources.

Part 1 of the question is the case with one source and only the "default" policy. Part 2 is the general case.

Function

calculatePayoutReserve(sources: String[], volumes: long[], policySources: String[], reserveRates: int[], maxReserves: long[]) → long

Examples

Example 1

sources = ["sales"]volumes = [1500000]policySources = ["default"]reserveRates = [500]maxReserves = [150000]return = 75000

This is Part 1: one source and one policy. 5% of 1500000 cents ($15,000) is 75000 cents ($750), which is under the 150000 cent ($1,500) cap.

Example 2

sources = ["sales"]volumes = [3500000]policySources = ["default"]reserveRates = [500]maxReserves = [150000]return = 150000

5% of 3500000 cents ($35,000) would be 175000 cents ($1,750), so the reserve is capped at 150000 cents ($1,500).

Example 3

sources = ["subscriptions","charity"]volumes = [1000000,200000]policySources = ["subscriptions","advertising","charity","default"]reserveRates = [300,600,0,500]maxReserves = [75000,120000,0,100000]return = 30000

Subscriptions hold back 3% of 1000000 cents, which is 30000 cents ($300), under their 75000 cent cap. Charity has a 0% rate, so it adds 0. The total is 30000.

Example 4

sources = ["sales","advertising","subscriptions"]volumes = [1234567,2500000,1000000]policySources = ["subscriptions","advertising","charity","default"]reserveRates = [300,600,0,500]maxReserves = [75000,120000,0,100000]return = 211728

sales has no policy of its own, so it uses default: 5% of 1234567 is 61728.35, rounded down to 61728. Advertising would hold back 150000 but is capped at 120000, and subscriptions add 30000. The total is 61728 + 120000 + 30000 = 211728.

Constraints

  • 1 <= sources.length <= 100
  • volumes.length == sources.length
  • 0 <= volumes[i] <= 10^11
  • 1 <= policySources.length <= 100
  • reserveRates.length == maxReserves.length == policySources.length
  • 0 <= reserveRates[j] <= 10000
  • 0 <= maxReserves[j] <= 10^11
  • Every name in sources and policySources has 1 to 20 characters, each a lowercase letter, a digit or _.
  • The names in sources are all different.
  • The names in policySources are all different, and one of them is "default".

More Stripe Phone Screen questions

  • Split Tender Part 4 - RefundsOA · PHONE SCREEN · Seen Nov 2026
  • Parse Boolean Rule ExpressionsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Linked Merchants Within Two HopsPHONE SCREEN · Seen Nov 2026
  • Merchant Matching, Parts 1–2: Shared Fields and Weighted ThresholdsPHONE SCREEN · Seen Nov 2026
  • Business Account KYC Verification — Parts 1–5PHONE SCREEN · Seen Nov 2026
  • Financial Account LedgerOA · PHONE SCREEN · Seen Nov 2026
  • Invoice / Payment ReconciliationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Merchant Payout Scheduler, Part 2: Per-Merchant SchedulesPHONE SCREEN · Seen Nov 2026
  • Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesPHONE SCREEN · Seen Nov 2026
  • Render a Task Tree from CSV RowsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Employee Count Median, Mean and ModeClay · PHONE SCREEN
  • Average Grades per StudentHartford Financial Services · PHONE SCREENHartford Financial Services interview questions
  • Find the Missing Number from 1 to 100NVIDIA · PHONE SCREENNVIDIA interview questions
  • Max Points on a LineUber · PHONE SCREENUber interview questions
  • Count Product-Divisible PairsMotive · PHONE SCREENMotive interview questions
  • Pair Up an Array So Every Pair Sum Divides by kAdobe · PHONE SCREENAdobe interview questions
  • Count Valid Square PairsAuxoAI · OA
  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Distinct Products After Removing One ElementHSBC · OAHSBC interview questions
  • Majority ElementMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
All Stripe interview questionsSee Stripe hiring insights
Saved
class Solution {
    public long calculatePayoutReserve(String[] sources, long[] volumes, String[] policySources, int[] reserveRates, long[] maxReserves) {
        // Write your code here.
    }
}
Checking account…