Reported March 2025
Amazonhash table

Number Of Well Performing Groups

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're looking at an Amazon OA in March 2025, and this one's about grouping elements by performance criteria. The problem asks you to count groups that meet a threshold, which sounds simple until you realize the grouping logic matters more than the counting. Most candidates miss the structural part and jump straight to brute force. StealthCoder can walk you through the grouping pattern in real time if you blank on the logic mid-assessment.

Pattern and pitfall

This problem typically hinges on understanding what 'well performing' means in context: usually a group where a ratio or average exceeds a threshold, or where elements satisfy paired conditions. The trick is recognizing that you're not just counting, you're validating membership rules. Hash tables or sets work well here to track groups, and you'll iterate once to build groups, then again to validate. The pitfall is trying to solve it in a single pass or overcomplicating the membership check. If you get stuck during the OA, StealthCoder will clarify the grouping structure and walk you toward the two-pass or hash-based solution.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Number Of Well Performing Groups 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 for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

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 for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Number Of Well Performing Groups FAQ

What does 'well performing' actually mean in this problem?+

It depends on the exact constraint in your version, but typically it's a ratio (like average performance above a threshold) or a condition that every member of the group must satisfy. Read the problem statement carefully for the exact threshold or ratio.

Do I need to optimize for time, or is a brute force approach okay?+

Hash table or set-based grouping with two passes is the standard expectation. Brute force (nested loops checking all pairs) will likely time out on larger inputs. Aim for O(n) or O(n log n) if possible.

Is this problem likely to appear on Amazon OAs?+

Yes. Grouping and validation problems are common on Amazon assessments. This fits their style of combining hash tables with threshold logic. Expect follow-ups about edge cases like empty groups or single-element groups.

How do I approach this in 30-40 minutes?+

Sketch the grouping logic first. Write pseudocode for how elements join a group and how you validate membership. Then code the hash table construction, iterate once more to count valid groups. Test with a small example before submitting.

What's the most common mistake candidates make?+

Forgetting to validate the entire group after grouping, or misunderstanding the threshold. Some also try to use sorting when a hash approach is cleaner. Read the constraint twice before coding.

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