FastPrepPayment Partner Routing
Problems/Payment Partner Routing

Payment Partner Routing

Stripe logoStripe● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an AI-assisted Stripe online assessment for a full-time software engineer role. The report sketches partner banks listed per country and then per currency, plus a yes/no map of which banks are up, where a bank missing from that map counts as up. It asks for two parts: first spread the payments evenly by taking turns, then split them by percentage, with a 70/30 split of US dollar payments as its example.

The report gives no function, output or tie rule. We chose the input and output format (one percentages row per route, empty for taking turns), one fixed availability snapshot, "" when no bank can take a payment, turns in list order over the banks that are up, separate turns and counts per route, the rule that sends each payment to the bank furthest below its target with the earlier bank winning a tie, how a down bank's percent is shared out, the limits, and every example except the first, which uses the report's own banks and availability.

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

Send each payment to one of the partner banks for its country and currency, skipping banks that are down, and return the bank each payment goes to.

Each partners[i] = [country, currency, bank_1, ..., bank_k] is a route: the banks, in order, that can take payments in that currency in that country. The same bank can be on several routes.

Each availability[i] = [bank, status] says whether a bank is up ("yes") or down ("no"). A bank that is not in availability is up. Availability stays the same while the payments are sent.

Each payments[j] = [country, currency]. Handle the payments in order, and for each one return the name of the bank it is sent to. Return "" for a payment if no route has its country and currency, or if every bank on that route is down. Only the banks that are up on a route take part in the rules below.

Part 1, round-robin. If percentages[i] is empty, route i's banks take turns so they carry the same load: its first payment goes to its first bank that is up, its next payment to the next bank that is up, and after the last one it starts again from the first.

Part 2, percentages. Otherwise percentages[i][b] is the percent of route i's payments meant for its bank b (counting banks from 0). If some banks are down, their percent is shared out among the banks that are up, in proportion to those banks' percentages. For a new payment on the route, let t be the number of payments the route has already sent, c the number a bank has already received from it, p that bank's percent, and W the sum of the percentages of the route's banks that are up. The bank's target after this payment is (t + 1) * p / W payments. Send the payment to the bank furthest below its target, the one with the largest (t + 1) * p / W - c; if two banks tie, choose the one earlier on the route.

Every route keeps its own turns and counts, even when it shares a bank with another route. A payment that gets "" is not counted.

Function

routePayments(partners: List<List<String>>, availability: List<List<String>>, percentages: int[][], payments: List<List<String>>) → List<String>

Examples

Example 1

partners = [["US","USD","chase","bank_of_america"],["US","EUR","wells","bank_of_america"],["UK","USD","symphony","tello"],["UK","EUR","bank2","bank9"]]availability = [["chase","no"],["bank_of_america","yes"]]percentages = [[],[],[],[]]payments = [["US","USD"],["US","EUR"],["UK","USD"],["US","EUR"],["UK","USD"],["US","USD"],["UK","USD"]]return = ["bank_of_america","wells","symphony","bank_of_america","tello","bank_of_america","symphony"]

chase is down, so every US dollar payment goes to bank_of_america. US euro payments take turns between wells and bank_of_america, and UK dollar payments take turns between symphony and tello. Each currency in each country keeps its own turn order.

Example 2

partners = [["US","USD","chase","bank_of_america"]]availability = []percentages = [[70,30]]payments = [["US","USD"],["US","USD"],["US","USD"],["US","USD"],["US","USD"],["US","USD"],["US","USD"],["US","USD"],["US","USD"],["US","USD"]]return = ["chase","bank_of_america","chase","chase","chase","bank_of_america","chase","chase","bank_of_america","chase"]

After each payment, the bank furthest below its share gets the next one. Over the 10 payments, chase gets 7 and bank_of_america gets 3, which is exactly 70% and 30%.

Example 3

partners = [["US","USD","chase","bank_of_america","wells"],["UK","USD","symphony"]]availability = [["chase","no"],["tello","yes"]]percentages = [[50,30,20],[]]payments = [["US","USD"],["US","USD"],["CA","USD"],["US","USD"],["US","USD"],["UK","USD"]]return = ["bank_of_america","wells","","bank_of_america","wells","symphony"]

chase is down, so its 50% is shared out in proportion: bank_of_america now aims for 30 / 50 of the load and wells for 20 / 50. Their four payments alternate, starting with bank_of_america, which has the larger share. No route covers US dollar payments in CA, so that payment gets "".

Constraints

  • 1 <= partners.length <= 50
  • 3 <= partners[i].length <= 12, so every route has 1 to 10 banks.
  • partners[i][0] and payments[j][0] are country codes of 2 uppercase letters; partners[i][1] and payments[j][1] are currency codes of 3 uppercase letters.
  • No two routes have the same country and currency, and no bank appears twice on one route.
  • percentages.length == partners.length
  • percentages[i] is empty, or has exactly one number per bank of route i; each number is from 1 to 100, and they add up to 100.
  • 0 <= availability.length <= 200
  • availability[i] = [bank, status], where status is "yes" or "no". No bank is listed twice. It may list banks that no route uses.
  • 1 <= payments.length <= 1000
  • payments[j].length == 2
  • Bank names have 1 to 20 characters, each a lowercase letter, a digit or _.

More Stripe Online Assessment questions

  • Split Tender Part 4 - RefundsOA · PHONE SCREEN · Seen Nov 2026
  • Split Tender Part 3 - SurchargesOA · Seen Nov 2026
  • Split Tender Part 2 - Expiration DatesOA · Seen Nov 2026
  • Split Tender Part 1 - Basic Split TenderingOA · Seen Nov 2026
  • Asynchronous Event ProcessingOA · Seen Nov 2026
  • Subscription and Usage-Based Billing CalculatorOA · Seen Nov 2026
  • Financial Account LedgerOA · PHONE SCREEN · Seen Nov 2026
  • Maximum Game Score with Fixed Forward JumpsOA · Seen Nov 2026
  • Reliable LLM Call with Independent Retry BudgetsOA · Seen Nov 2026
  • Request Routing SystemOA · Seen Nov 2026

Similar questions at other companies

  • Bank Accounts with Balance HistoryMeta · OAMeta interview questions
  • Stacked Item and Category DiscountsPalantir · OAPalantir interview questions
  • Process Banking OperationsVercel · OA
  • First Completed Mingo LineEpic · OAEpic interview questions
  • Count House Segments After Sequential DestructionByteDance · OAByteDance interview questions
  • HTTP Request RedirectionAmazon · OA
  • Hungarian Lottery Winner CountsAlpaca · OA
  • Cheating CodemakerJane Street · OAJane Street interview questions
  • Aggregate Paginated Project Run RecordsReplit · OA
  • Maximum Satisfied CustomersAtlassian · OAAtlassian interview questions

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
  • Stripe New Grad SWE Phone Screen and Onsite: 2 Experiences
All Stripe interview questionsSee Stripe hiring insights
Saved
class Solution {
    public List<String> routePayments(List<List<String>> partners, List<List<String>> availability, int[][] percentages, List<List<String>> payments) {
        // Write your code here.
    }
}
Checking account…