Find the Smallest Daily Volume Cap to Work a Block Order
Last updated: November 29, 2026
Quick Overview
A block order is split into child slices that must be executed in the given order, with the whole order finished within D days. Find the smallest daily volume cap that makes this possible.
SIG
November 29, 20260
0
0 solved
A block order is split into child slices that must be executed in the given order, with the whole order finished within D days. Find the smallest daily volume cap that makes this possible.
SIG works large client and principal orders over time to limit market impact, so a binary-search-on-the-answer problem framed as execution scheduling fits a phone screen. The interviewer checks that you see the monotonic feasibility check and set the search bounds correctly.
What the Interviewer Expects
- Notice feasibility is monotonic in the cap
- Set lo = largest slice and hi = total size
- Write a greedy O(n) check that packs slices day by day
- Use a correct lower-bound binary search with no off-by-one
- State the O(n log S) complexity
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- What if slices could be split across days?
- How would you minimize the maximum day relative to forecast daily market volume?
- What changes if some days are half sessions with lower allowed volume?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: slices, positive integers in execution order, and days. Each day you execute a contiguous run of slices whose total is at most the cap; a slice cannot be split. Return the minimum cap that ...
High-Level Design
If a cap C works, any larger cap works too, since the same daily packing is still legal. That monotonicity lets us binary search C. The cap must be at least the largest slice (it must fit in one day) ...