Find Min Trips
Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Amazon's February OA asked candidates to solve Find Min Trips, a deceptively simple-sounding problem that trips up engineers who don't catch the optimization angle. You're likely looking at a packing or scheduling variant where you need to minimize the number of trips required to move items, deliver packages, or satisfy constraints. The trick is recognizing whether it's a greedy sort, a bin-packing problem, or a search for the minimum threshold. StealthCoder will spot the pattern in real time if you freeze on the approach.
Pattern and pitfall
Without the exact problem text, the pattern here is likely either greedy selection (sort and pack optimally) or binary search on the answer (search for the minimum number of trips that satisfies all constraints). Amazon loves this flavor because it tests whether you can think backwards from the goal. The common miss is attempting a brute-force enumeration of all possible trip assignments instead of recognizing that you can validate feasibility in linear or log-linear time. If it's bin-packing, the greedy approach is sort descending and fit items into bins. If it's threshold-based, binary search on trip count and check if the assignment is possible. StealthCoder acts as your safety net if you blank on which direction to optimize.
The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.
You can drill Find Min Trips 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 for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.
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. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find Min Trips FAQ
Is this a greedy or search problem?+
Almost always greedy with a sort (pack largest items first) or binary search on the answer (find minimum trips where all constraints hold). If you can validate a trip count in O(n) time, binary search is the play. Greedy works if sorting then assigning items sequentially solves it.
What's the most common pitfall?+
Trying to brute-force all permutations of trip assignments. Stop. The problem is asking for a minimum count, not an explicit assignment. Think threshold-validation instead. Can I do all deliveries in K trips? If yes, try K-1. Binary search or greedy sort is the answer.
How do I prepare in 48 hours?+
Drill two patterns: sort and pack (bin-packing), and binary search on a continuous range. Practice LeetCode 1011 (Capacity To Ship Packages Within D Days) and 1482 (Minimum Number of Days to Make m Bouquets). Both are Amazon repeats and teach the exact pattern.
Does trip order matter?+
Almost never. The problem cares about the minimum count, not the sequence. Exception: if there's a dependency (trip 1 must happen before trip 2), the problem would say so explicitly. Default assumption is order doesn't matter.
What edge cases should I handle?+
Items that fit in a single trip (answer is 1). Items so large they require one trip each (answer equals item count). Zero items or empty input. Always code the boundary checks first before submitting.