Reported January 2026
Amazondesign

Package Delivery System

Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Amazon OA. Under 2s to a working solution.
Founder's read

Amazon's January 2026 OA includes a delivery system design problem that looks like a greedy assignment task but punishes naive approaches. You're given truck capacities and package weights. Each truck can deliver a package if its weight fits, then its capacity halves (floor division). The catch: you need to determine feasibility for multiple scenarios without exploring every possible truck-package pairing. This is a design problem wrapped in a greedy skin, and the trap is thinking brute force will work at scale. StealthCoder will anchor you if the optimal assignment strategy blanks mid-OA.

The problem

Each shipment scenario has a list of truck capacities and a list of package weights. A truck may deliver any package whose weight does not exceed its current capacity. After a successful delivery, that truck's capacity becomes floor(capacity / 2). Determine whether every package in each scenario can be delivered using the available trucks. Return an int[] where each entry is 1 if the corresponding scenario is feasible and 0 otherwise. The single truck delivers package 4, its capacity drops to 3, and it can still deliver package 3. The scenario is feasible. The number of scenarios and the lengths of the nested arrays can be large, so the solution should avoid brute-force backtracking over all assignments.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The key insight is that you can't use standard backtracking when scenarios are large. The pattern is greedy with a twist: sort packages in descending order and try to assign each package to the truck that can deliver it while minimizing capacity waste. However, the real trick is recognizing that after each delivery, truck capacity degrades exponentially (halving each time). This means a truck that handles a heavy package early becomes less useful quickly. You need to simulate intelligently, possibly using a priority queue or sorted structure to pick the best truck for each package in order. The problem is testing whether you can recognize a constrained assignment as a design/simulation task, not a pure DP problem. Many candidates waste time on recursive backtracking; the OA expects a greedy or priority-queue-based pass that runs in reasonable time. StealthCoder's real value here is pattern recognition: when you see 'large scenarios' and 'feasibility check', design and simulation come before backtracking.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Package Delivery System 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. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Amazon's OA.

Amazon reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Package Delivery System FAQ

Should I try all possible truck-package assignments?+

No. The problem explicitly warns that brute-force backtracking fails at scale. Use greedy assignment: sort packages descending, then for each package, pick a truck that can deliver it (prefer higher-capacity trucks to preserve flexibility). Track capacity after each delivery.

Does the order in which I try to deliver packages matter?+

Yes. Sorting packages in descending order (heaviest first) typically works best. Heavy packages have fewer truck options; assign them first. Lighter packages are more flexible and can use degraded truck capacities later.

How do I handle the capacity halving efficiently?+

After each delivery, update the truck's capacity to floor(capacity / 2). Use a data structure (like a multiset or heap) to quickly find trucks that can still deliver the next package. Avoid recalculating all truck states each iteration.

What makes this a design problem instead of DP or greedy?+

The problem asks you to design a system that decides feasibility under constraints. It's not asking for optimal truck usage or minimum deliveries; it's a yes/no feasibility check. That framing, plus the emphasis on handling large scenarios, signals design and simulation over pure algorithm.

How do I know if a scenario is infeasible early?+

If at any point a package weight exceeds all remaining truck capacities, that scenario is infeasible. Also precompute the sum of all truck capacities at the start; if it's less than the sum of package weights, feasibility is impossible (though this is a loose bound due to halving).

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Amazon.

OA at Amazon?
Invisible during screen share
Get it