Reported September 2024
Amazon

Maximum Quality Sum

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 hit you with Maximum Quality Sum in September 2024, and it's a graph or greedy problem hiding behind a deceptively simple name. You've got limited time before the OA, so the goal here is to recognize the pattern fast and lock in the logic. This one rewards candidates who can spot when you're optimizing a sum subject to constraints. StealthCoder sits in the background as your safety net if the twist catches you mid-OA.

Pattern and pitfall

Maximum Quality Sum is almost certainly asking you to maximize a sum of values while respecting some constraint structure, often involving graph traversal or selection rules. The common pitfall is brute force enumeration when a greedy or dynamic programming approach is meant to work. You're likely choosing elements from a set or traversing a graph to accumulate quality, subject to limits on selections or path length. The trick is recognizing whether you're looking at a shortest-path variant, a selection problem with exclusion rules, or a tree DP. StealthCoder will pattern-match the input fast and surface the right approach when you blank on the name.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Maximum Quality Sum 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 would have shipped this the night before his JPMorgan OA if he'd had it.

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 would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Quality Sum FAQ

Is this a graph problem or an array problem?+

Without the full problem text, treat it as either. If nodes have quality values and edges have costs or constraints, it's graph traversal (likely DFS or Dijkstra). If it's selecting items from an array with rules, it's greedy or DP on the array. Amazon mixes both. Read the structure first.

What's the trick Amazon usually hides here?+

Often it's that you can't just pick the highest-quality items. There's a constraint: edge weight limits, visit order, or mutual exclusivity. Greedy fails. You need DP or graph search. Look for what makes a choice invalid, not just what makes it good.

How do I recognize the pattern in 30 seconds?+

Look for 'maximum' plus 'quality' or 'value' in the problem. If there are nodes, edges, or dependencies, it's graph-based. If it's a flat list with rules, it's selection-based DP. Either way, constraint inspection beats assumption.

Can I solve this with a simple greedy sort?+

Rarely. Amazon tests on problems where sorting alone fails because constraints interact. You'll likely need memoization or a priority queue. Test the greedy approach on the sample input. If it fails one case, pivot to DP or Dijkstra immediately.

What should I code first if I'm stuck live?+

Write a recursive function that explores all valid choices and returns the maximum sum. Add memoization once the logic is correct. This beats guessing the optimal structure. Start dumb, then optimize. The OA usually accepts the working solution even if not the most efficient.

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