Minimum Daily Payout Limit to Clear All Transfers by a Deadline

Last updated: November 29, 2026

Quick Overview

Transfers become available on given days and must be paid out in arrival order without splitting. Find the smallest daily payout limit that lets every transfer be paid by day `D - 1`, or return -1 if impossible.

Stripe
Coding & Algorithms
Software Engineer
Stripe
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


Transfers become available on given days and must be paid out in arrival order without splitting. Find the smallest daily payout limit that lets every transfer be paid by day `D - 1`, or return -1 if impossible.

Stripe Treasury and payout products pay funds through bank rails with daily limits, and risk teams set those limits for new accounts. Choosing the smallest limit that still meets a settlement deadline is a classic binary search on the answer with a greedy feasibility check, and the interviewer checks both pieces and the bounds.

What the Interviewer Expects
  • Recognize monotonicity: if a limit works, any larger limit works
  • Write a greedy feasibility check that pays as much as fits each day in FIFO order
  • Choose tight search bounds: largest single transfer up to the total
  • Handle transfers that arrive on or after the deadline up front
  • Argue why paying greedily each day is optimal
Key Topics to Cover
binary search on answer
greedy
simulation
payouts
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • What if transfers may be split across days?
  • What if each day has its own limit multiplier, such as zero on bank holidays?
  • How would you return the actual day-by-day payout plan?
  • How does the answer change if order does not need to be preserved?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Inputs: amounts[i] in cents and arrivals[i] (the day transfer i becomes payable), both in FIFO order with non-decreasing arrivals, and a deadline D meaning days 0..D-1 are usable. A transfer...

High-Level Design

feasible(limit) walks days 0 to D-1 with a pointer into the queue; each day it pays queued transfers that have arrived and still fit in the remaining limit, stopping at the first one that does not (...


Submit Your Answer
Markdown supported

Related Questions