Reported March 2025
Amazongreedy

Get Max Increments

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 Get Max Increments hit the March OA rotation, and it's a pattern-spotting problem disguised as a math puzzle. You're probably staring at an array and being asked to find the maximum number of times you can increment elements under some constraint. The trick isn't brute force. It's recognizing what operation you're actually simulating, then collapsing it into a formula. StealthCoder will grab the problem text in real time and surface the pattern so you don't have to reverse-engineer it under pressure.

Pattern and pitfall

Get Max Increments is fundamentally a greedy or math problem. You're likely incrementing array elements, and the constraint is either a budget of operations, a condition on which elements you can touch, or a limit on how many times a single element can grow. The common pitfall is simulating every increment one by one. Instead, the intended solution recognizes that you want to maximize a global counter by distributing increments smartly, often by targeting the smallest or most constrained elements first. The math shortcut usually involves sorting, a formula for total operations possible, or a binary search on the answer. In a live OA, if the simulation approach times out, you've already telegraphed the pattern to yourself. StealthCoder lets you see the solution path instantly so you can code with confidence.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Get Max Increments 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 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. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Get Max Increments FAQ

Is this a sorting problem?+

Likely yes. If you're distributing increments optimally, sorting the array first often unlocks a greedy or mathematical solution. Check if the order matters and whether sorting lets you compute the answer in O(n) or O(n log n) instead of simulation.

What's the common timeout trap?+

Simulating each increment operation individually. If the constraint is large, that's a dead end. Look for a closed-form formula, a prefix sum trick, or a binary search on the number of increments instead.

Should I binary search on the answer?+

Maybe. If the problem asks 'what's the max number of increments,' you can binary search on the answer and verify feasibility in O(n). It's a solid fallback when the greedy math isn't obvious.

How do I handle the constraint or limit?+

Identify what's being limited: total operations, increments per element, or operations per step. Once you know what's being capped, you can compute how to distribute increments to maximize the global count without violating the cap.

Is there a pattern from earlier Amazon OAs?+

Amazon repeats greedy and math-based optimization on arrays. If you've seen 'maximize X subject to constraint Y' before, that playbook applies here. Stay sharp on sorting and formula derivation.

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