Reported September 2026
Googlearray

Count Score Categories

Reported by candidates from Google's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Google OA. Under 2s to a working solution.
Founder's read

A plain array and three counters. That's the whole data structure behind the Google "Count Score Categories" OA, reported in September 2026. You're probably expecting a trap, and there isn't a big one. Scores run 0 to 100, the array tops out at 100 elements, and you return three counts in a fixed order. The danger here isn't difficulty. It's rushing and flipping a boundary at 50 or 80. If you freeze on a problem this simple, StealthCoder is the safety net running invisibly during the live OA, but you shouldn't need it.

The problem

You are given an integer array scores. Classify every score into exactly one category:
Failed: the score is less than 50.
Regular pass: the score is from 50 through 80, inclusive.
Passed with honors: the score is greater than 80.
Return an array containing the three category counts in this order: failed, regular pass, passed with honors.

Function
countScoreCategories(scores: int[]) → int[]

Examples
Example 1
scores = [49,50,80,81,100]
return = [1,2,2]
49 fails, 50 and 80 are regular passes, and 81 and 100 pass with honors.
Example 2
scores = [50,75,80,20,90]
return = [1,3,1]
Only 20 fails, 50, 75, and 80 are regular passes, and 90 passes with honors.
Example 3
scores = [0,100]
return = [1,0,1]
0 fails, no score is a regular pass, and 100 passes with honors.

Constraints
1 <= scores.length <= 100.
0 <= scores[i] <= 100.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Use a result array of size 3, initialized to zeros, and one pass over scores. For each score, if it's under 50, bump index 0. If it's 80 or below, bump index 1. Otherwise bump index 2. Checking in that order means you only need two comparisons, and the inclusive 80 boundary falls out naturally. The pitfall is the edges. 50 and 80 are both regular passes, and Example 1 tests exactly that, so run it by hand before submitting. Another slip is returning counts in the wrong order. It's failed, regular, honors. Don't sort, don't build a hash map, don't overthink it. Time is O(n), space is O(1). If your mind goes blank on a freebie like this, StealthCoder can hand you the three-branch loop during the live OA, but trace the examples yourself first.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Count Score Categories 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 by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Google's OA.

Google reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Count Score Categories FAQ

How hard is the Google Count Score Categories OA question really?+

It's easy. One loop, three counters, no tricky data structures. The constraints are tiny, with at most 100 scores between 0 and 100. The only way to lose points is an off-by-one at the 50 or 80 boundary, so test those values first.

What's the trick to this problem?+

There's no trick, just careful boundaries. Under 50 is failed, 50 through 80 inclusive is regular, above 80 is honors. Use if, else-if, else so each score lands in exactly one bucket. Return the counts in that exact order.

What data structure should I use?+

A fixed-size array of length 3 as your result. A hash map or sorting is overkill. You increment index 0, 1, or 2 as you scan. That keeps space at O(1) and time at O(n).

What edge cases should I test before submitting?+

Test 49, 50, 80, and 81 since they sit on the boundaries. Also try 0 and 100 from the extremes, and a single-element array. Example 3 covers the case where the regular pass count is zero, so make sure you still return a three-element array.

How do I prepare for this in 48 hours?+

Don't grind it. Write the loop once from memory, then run all three examples by hand. Spend the rest of your time on harder array and hashing problems, since an OA like this from Google usually comes with other questions that are tougher.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Google.

OA at Google?
Invisible during screen share
Get it