Reported December 2024
Amazon

Get Max Stability

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 asked this in December 2024 and it's a stability/balance problem that looks simple on the surface. You'll see a structure that needs optimization, and your gut will say greedy or simulation. The real trick is recognizing what "stability" means in the context they've defined, then building a solution that either balances forces, finds optimal placement, or maximizes some equilibrium metric. This is the kind of problem where the first implementation fails on edge cases. StealthCoder is your safety net if the problem statement doesn't click in the live OA.

Pattern and pitfall

Without the exact problem text, the pattern is likely one of: greedy placement to maximize balance, dynamic programming to find an optimal configuration, or simulation of a system reaching equilibrium. "Max stability" usually means minimizing variance, finding a center of mass, or preventing something from tipping. The common pitfall is assuming a naive greedy approach works when the optimal solution requires tracking state or trying multiple configurations. If it's a physics-based problem, you'll need to calculate forces or distances. If it's structural, you're probably sorting or using two-pointers to find the best pivot point. When you're live on the OA and stuck, StealthCoder reads the actual problem and gives you the exact pattern and skeleton code in real time.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Get Max Stability 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 passed his OA cold and still thinks the filter is broken.

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 passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Get Max Stability FAQ

What does 'stability' actually mean here?+

It depends on context. Could mean minimizing imbalance between two sides, finding a point where something doesn't tip, or maximizing the smallest margin. Read the problem's definition carefully. That's often the entire trick.

Is this a greedy or DP problem?+

Greedy usually works for simple balance problems (like partitioning an array). DP is needed if you need to track multiple states or the optimal solution requires revisiting choices. The problem structure will tell you.

How do I approach it in under 45 minutes?+

Start by implementing a brute force or simulation solution. Get something working on the examples. Then optimize. Amazon OAs reward correctness first, optimization second. Avoid premature optimization.

What's the common edge case failure?+

Ignoring negative values, floating-point precision errors if stability involves division, or assuming a single optimal position when there are ties. Always test boundary cases like single elements or all identical values.

Should I memorize a specific algorithm?+

No. Understand sorting, two-pointers, and basic DP. For this problem, focus on understanding what the problem is asking, not memorizing a template solution.

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