Count Games Won By Group1 (AMZ CN)
Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Amazon's December OA hit candidates with a game-counting problem that looks deceptively simple but trips up people who don't nail the grouping logic. You're given game results and need to count wins by a specific group. It sounds like a one-liner, but the trap is assuming the input format or how groups are defined. StealthCoder will catch you if you blank on the grouping condition, giving you the pattern in real time so you don't tank a correct solution.
The problem
*** Credit to Tong 👑 ***
Reported by candidates. Source: FastPrep
Pattern and pitfall
This is a hash-table / counting problem disguised as a filtering exercise. The core work: parse the game data, identify which player belongs to Group 1, then count their wins. The common mistake is hardcoding group IDs or misunderstanding the win condition. You need to iterate through games, check membership, and increment a counter. It's O(n) if the input is clean, but the real friction is in the parsing and validation step. Many candidates waste time on defensive code instead of reading the problem once. StealthCoder handles the format edge cases and locks in the grouping rule so you can move on.
The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.
You can drill Count Games Won By Group1 (AMZ CN) 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 StealthCoderRelated leaked OAs
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.
Count Games Won By Group1 (AMZ CN) FAQ
Is this a real hard problem or just grouping data?+
It's data filtering plus counting. No dynamic programming, no graph search. Hard part is understanding the exact input structure and win condition. The problem statement matters more than the algorithm. Read it twice before coding.
What's the trick Amazon usually hides in game-counting problems?+
The trick is group definition. Is Group 1 a set of player IDs, a numeric property, or something inferred from the data? Amazon loves making you extract that rule from context. Check the examples first.
Do I need to handle ties or draws?+
Depends on the problem statement. If it says 'wins', only count wins, not draws. If it's silent, assume ties don't count. Run through the examples to confirm before you code.
How much time does this usually take strong candidates?+
5-8 minutes of reading and parsing, 3-5 minutes of coding. If you're over 15 minutes, you're overthinking the grouping logic. Simplify and iterate through the data once.
Should I validate that Group 1 exists or just assume it's in the input?+
Assume it's in the input unless the problem says otherwise. Amazon OAs rarely test error handling for missing data. Focus on correctness for the happy path.