Reported January 2025
Amazonhash table

Equal Products

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 January 2025, and the title alone tells you almost nothing. Equal Products is a deceptive problem that looks like a math puzzle but hinges on how you structure your search. You're given some constraint (likely an array or a target), and you need to find pairs or subsets where products match. It's the kind of problem where brute force fails fast and the interviewer watches you realize it. StealthCoder sits ready if you blank on the optimization.

Pattern and pitfall

The trap here is assuming you need to compute all possible products upfront. Instead, you're probably looking for a way to avoid redundant calculations. Hash tables are your friend: store products you've seen mapped to indices or counts, then iterate smartly through candidates. The pattern often hinges on two-pointers or a single pass with memoization. Common pitfall: forgetting that equal products might come from very different factor combinations, so you can't just sort and compare adjacently. When you're live and stuck, StealthCoder can pattern-match the input shape and surface the hash-table or two-pointer skeleton you need to move past the blank.

Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.

If this hits your live OA

You can drill Equal Products 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. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.

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. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Equal Products FAQ

Is this actually a math problem or a data structure problem?+

It's both, but the OA is testing structure, not math insight. You'll compute products efficiently using a hash map to track seen values, then query against it. The math is simple. The algorithm is the point.

How do I avoid timing out?+

Don't generate all products first. Use a single pass or two-pointer technique with a hash table. O(n) or O(n log n) is the target. Brute force O(n^2) or worse will fail the hidden test cases.

What if there are multiple valid answers?+

Return the first one, the lexicographically smallest, or all of them. The problem statement will clarify. If you're unsure during the OA, code for 'all' and document your assumption. Amazon likes seeing you think ahead.

Does the input size matter for my approach?+

Absolutely. If n is under 1000, a cleaner O(n^2) might pass. Above that, you need O(n) or O(n log n). Read the constraints carefully in the OA. They're always there.

Is this still asked in 2025?+

Amazon reported it in January 2025, so yes. It's a core pattern they rotate. Focus on hash-table fluency and two-pointer logic. Those are Amazon favorites and won't age out this year.

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