Min Days to Deliver Parcels
Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Amazon's 'Min Days to Deliver Parcels' is a binary search problem dressed up as a logistics question. You're in the OA in a few hours, and this is the kind of problem that looks like math until you spot the search space. The trick: you're not calculating anything from first principles. You're guessing a number of days, checking if it's feasible, and narrowing the range. StealthCoder will give you the skeleton if you blank on the binary search bounds, but the pattern is straightforward once you see it.
Pattern and pitfall
The problem gives you parcels with weights or delivery constraints and asks for the minimum days needed under some capacity or rate limit. The solution always follows the same shape: binary search on the answer (days), then for each candidate number of days, simulate whether it's possible to deliver all parcels in that time. The feasibility check is a greedy simulation, usually left-to-right through the parcels. The hard part is setting the search bounds correctly: lower bound is 1 or the ceiling of total work, upper bound is the total number of parcels. This is a classic min-max problem that trips up candidates who try to calculate directly. StealthCoder can confirm your bounds and check your greedy logic if you get stuck on the simulation.
Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.
You can drill Min Days to Deliver Parcels cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as capacity to ship packages within d days. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Amazon's OA.
Amazon reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Min Days to Deliver Parcels FAQ
How hard is this compared to typical Amazon OA questions?+
It's mid-tier. Not a gimme, but it's a known pattern. If you've seen binary search on the answer before, you'll recognize it in 2-3 minutes. If not, it can feel opaque. The greedy check is usually simple logic, so the challenge is just the search setup.
What's the trick that catches people?+
Trying to math it instead of searching. Candidates often overthink the capacity constraint and attempt to compute a closed-form answer. Wrong approach. Always binary search the answer space, then check feasibility greedily for each candidate.
Is this still being asked by Amazon in late 2024?+
Yes. Reported in December 2024. Amazon loves binary search on the answer for optimization problems. They ask variants of this every few months. It's a reliable pattern.
How do I set the binary search bounds?+
Left bound: usually 1 or the ceiling of total parcels divided by capacity. Right bound: total number of parcels or a large safe upper limit. Test the bounds on simple cases before submitting to avoid off-by-one.
What if I forget the pattern in the OA?+
Start by hand-simulating small examples with different day counts. You'll see the greedy pattern emerge. Then recognize that you're searching for the minimum valid count. That realization alone will unlock the binary search structure.