Google · OA
In processGoogle New Grad OA: Token Scores and Four-Digit Codes With Sum S
Role: Software Engineer, New Grad
Result: OA completed
Report time: October 2025
The OA contained two questions and hidden test cases. The candidate specifically warned about equality edge cases.
Question 1: score tokens on a board
An integer array points and a string tokens describe N cells. tokens[i] is T when a token occupies the cell and E when it is empty.
The score equals:
- The sum of
points[i]for every token cell. - One extra point for every adjacent pair of token cells.
Example: points = [3,4,5,2,3], tokens = TEETT returns 9: eight cell points plus one adjacent-token bonus.
Practice: Score Points
Question 2: four-digit codes with digit sum S
Consider every four-digit code over digits 0 through 9, including leading zeroes. Given S, return how many codes have digit sum S. The constraint is 0 <= S <= 36.
Examples include S = 4 -> 35 and S = 2 -> 10.
The screenshot's printed list for S = 35 repeats 9899 while claiming four codes. That visible source typo is not treated as a distinct code.
Practice: Count Four-Digit Codes With Sum S
Comments
0No comments yet — be the first to share what you know.