Boats to Save People
A medium-tier problem at 60% community acceptance, tagged with Array, Two Pointers, Greedy. Reported in interviews at Sigmoid and 5 others.
Boats to Save People hits different when you're in the OA and realize the greedy choice isn't obvious. The problem gives you people with weights, a boat capacity, and asks for the minimum number of boats needed. Companies like Walmart Labs, Atlassian, and Deutsche Bank have all asked this one. The catch is that brute force gets slow fast, and the sorting trick that unlocks the two-pointer solution isn't intuitive if you haven't seen the pattern. If you blank on the greedy strategy during your live assessment, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Boats to Save People"
Boats to Save People is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.
Get StealthCoderThe trap is trying to fit people greedily from lightest to heaviest without planning. The real move is to sort and use two pointers: match the heaviest person with the lightest. If they fit together, both go. If not, the heavy person goes alone. This greedy choice always minimizes boats because pairing the lightest with the heaviest wastes the least capacity. Array, Sorting, Two Pointers, and Greedy all converge here. Most candidates see the sorting step but miss why the two-pointer greedy direction works. The acceptance rate sits at 60%, which means a chunk of people either overthink it or implement greedy wrong. If this problem lands in your OA and the greedy pattern doesn't click, StealthCoder hedges that wall instantly.
Pattern tags
You know the problem.
Make sure you actually pass it.
Boats to Save People recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Boats to Save People interview FAQ
Why can't I just pair people greedily from lightest to heaviest in order?+
Pairing consecutive light people wastes boat space. The two-pointer greedy approach pairs the heaviest with the lightest, which maximizes the chance they share a boat and minimizes wasted capacity. Sorting unlocks this; the order matters.
Is this still asked at FAANG and big tech?+
Yes. Walmart Labs, Atlassian, Deutsche Bank, and others on the company list have reported it. The 60% acceptance rate suggests it's medium-difficulty and competitive enough to differentiate candidates.
What's the time complexity and why does it matter?+
Sorting is O(n log n), two pointers is O(n). Total O(n log n). Brute-force attempts to pair people without sorting hit O(n^2) or worse and time out on large inputs, which is why the greedy + two-pointer approach is the expected solution.
How does this relate to the other greedy problems I've seen?+
Greedy works here because the choice (pair heavy with light) is locally optimal and leads to a global optimum. Unlike some greedy problems, the trick is the two-pointer direction, not just picking the best available option at each step.
If I get stuck on this in the OA, what's my move?+
Start with sorting and two pointers. If the greedy logic doesn't click under time pressure, implement a brute-force or suboptimal solution to get partial credit, then pivot. StealthCoder can surface the optimal solution instantly if you hit a real wall during screen share.
Want the actual problem statement? View "Boats to Save People" on LeetCode →