Minimum Daily Send Capacity to Deliver InMail Batches in Time
Last updated: November 29, 2026
Quick Overview
InMail batches must be sent in a fixed order; batch i has size w[i] and a batch cannot be split across days. Given D days, find the minimum daily send capacity so that all batches are delivered within D days.
0
0
0 solved
InMail batches must be sent in a fixed order; batch i has size w[i] and a batch cannot be split across days. Given D days, find the minimum daily send capacity so that all batches are delivered within D days.
Messaging infrastructure at LinkedIn is rate limited per sender and per day, so capacity planning questions appear in screens. The interviewer is checking binary search on the answer with a greedy feasibility check and correct bounds.
What the Interviewer Expects
- Identifies the answer space: max(w) to sum(w)
- Writes a greedy feasibility check that packs days in order
- Explains monotonicity: if capacity c works, any c' > c works
- Implements lower-bound binary search without off-by-one errors
- States O(n log(sum)) 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 batches can be reordered?
- What if each day has a different capacity cap?
- How would you handle splitting batches across days with a per-message cost?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
w is a list of positive ints, D >= 1. Batches stay in order and whole. Return the smallest integer capacity C such that greedily filling days up to C uses at most D days....
High-Level Design
Capacity below max(w) can never fit the largest batch, and sum(w) always finishes in one day, so the answer lies in that range. Feasibility is monotone in C, so binary search for the first feasibl...