Find Max Total Amount
Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Amazon asked this in November 2024 and it's a straightforward optimization problem that trips up candidates who overthink it. You've got a collection of items or transactions, and you need to find the maximum total amount across some subset or configuration. The trick isn't complex math or graph theory. It's recognizing what constraint shapes the answer. StealthCoder sits in your corner if the pattern doesn't click in the first 30 seconds of reading the problem.
Pattern and pitfall
Without the full problem text, the pattern likely hinges on either greedy selection (pick the largest values first), dynamic programming (build up valid subsets), or a simple traversal with state tracking. Amazon loves problems that look like they need DP but actually just need sorted order or a single pass. The common mistake is trying to model dependencies that don't exist. Once you identify whether you're picking items (greedy), respecting constraints (DP), or tracking running state (simulation or prefix sum), the solution falls into place fast. If you blank during the live OA, StealthCoder can read the full problem and pattern-match it in seconds.
StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.
You can drill Find Max Total Amount 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. If you're reading this with an OA window open, you're who this was built for.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Amazon's OA.
Amazon reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find Max Total Amount FAQ
Is this a greedy problem or DP?+
Almost certainly greedy or simulation. Amazon's 'max total' problems usually reward sorting or picking items in order. If there are overlapping subproblems or state-dependent choices, they'll hint at it in the constraints. Without that, assume you're picking the biggest values first.
What's the most common mistake on this type of problem?+
Assuming you can't pick the same item twice, or misreading the constraint on what counts toward the total. Read the problem statement word-for-word. If it says 'total amount', check whether you're summing values, counts, or pairs.
How long should this take to code?+
If you see the pattern, 5-10 minutes to code and test. If you're stuck on the approach after 15 minutes, you've either misread the problem or there's a twist in the constraints you missed. Re-read before you code.
Do I need to optimize for space or time?+
Amazon usually cares about time complexity for backend problems. If the input is under 10,000 items, O(n log n) sorting or O(n) traversal is fine. Only optimize space if the problem explicitly mentions memory limits.
Is there a trick specific to Amazon's version?+
Amazon often adds a twist with multiple rounds, time windows, or priority. The core algorithm stays the same. Focus on the problem text first, then ask yourself: is there state I need to track across multiple iterations?