Reported January 2025
Amazonhash table

Calculate Max Salary

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

You've got an Amazon OA in the next couple of days with a salary calculation problem. This one looks simple on the surface but trips up candidates who don't catch the edge cases. You're probably dealing with filtering, aggregation, or conditional logic on a dataset. StealthCoder will be your safety net if you blank on the exact logic flow during the live assessment. The trick is usually in how you handle ties, nulls, or multiple matching records.

Pattern and pitfall

Amazon loves salary problems because they expose how you think about data filtering and max-finding. The pattern here is likely hash-table or array-based filtering combined with a max operation. You'll read through records, apply some condition (department, role, status), and find the highest value. The pitfall: candidates often skip the edge case handling. What if multiple people have the same max salary. What if the dataset is empty or has nulls. What if the input structure is slightly different than expected. Work through the problem statement line by line. Build a clean solution that handles at least two edge cases explicitly. StealthCoder can verify your logic against the hidden test cases in real time, so you're not guessing.

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 Calculate Max Salary 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.

Calculate Max Salary FAQ

Is this a hash-table or array problem.+

Likely both. You'll iterate through an array of records and use a hash-table or simple aggregation to group or filter by some key, then find the max. Think of it as filter-then-reduce.

What's the most common mistake on this problem.+

Not handling the case where multiple records match your filter criteria, or ignoring nulls and missing fields. Code defensively. Check the data structure before accessing nested fields.

How much time should I spend on this problem.+

Aim for 15-20 minutes total. 5 minutes to read and understand the filter logic, 10 minutes to code, 5 minutes to test edge cases and off-by-one errors.

Do I need to optimize for space or time.+

Probably not. Amazon's OA problems at this level care more about correctness and clean code than O(n log n) vs O(n). Write clear logic first.

Should I sort the data or iterate once.+

Iterate once if you can. Track the max as you go. Sorting adds complexity and is usually overkill for a max-finding problem unless the problem explicitly asks for ranking or multiple top-k values.

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