Minimum Daily Upload Capacity to Ship OneDrive Backups on Time

Last updated: November 29, 2026

Quick Overview

A OneDrive backup queue holds files of known sizes that must be uploaded in order. Each day the uploader sends files until the next one would exceed its daily capacity. Find the smallest capacity that finishes within D days.

Microsoft
Coding & Algorithms
Software Engineer
Microsoft
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


A OneDrive backup queue holds files of known sizes that must be uploaded in order. Each day the uploader sends files until the next one would exceed its daily capacity. Find the smallest capacity that finishes within D days.

This is the template binary-search-on-answer problem in Microsoft screens. The interviewer checks that the candidate identifies a monotone feasibility test, sets correct bounds, and writes a loop that terminates on the exact minimum.

What the Interviewer Expects
  • Notice that more capacity never needs more days (monotone)
  • Lower bound max(sizes); upper bound sum(sizes)
  • Write a greedy O(n) feasibility check
  • Binary search for the first feasible capacity
  • Explain why the greedy check is optimal for a fixed capacity
Key Topics to Cover
binary search on answer
greedy feasibility
monotonic predicate
OneDrive scenario
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
  • Files may be uploaded in any order. Is the problem still easy?
  • Each day has a different capacity multiplier. How does the check change?
  • Split an array into D parts minimizing the largest part sum. Is that the same problem?
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
  • sizes: positive integers, in fixed order.
  • days: 1 <= days <= len(sizes).
  • Output: minimal integer capacity....
High-Level Design

For a given capacity, packing each day as full as possible uses the fewest days: pushing any file to a later day can only increase the count. So days_needed(cap) is a one-pass greedy, and it is non-...


Submit Your Answer
Markdown supported