Google · Phone screen
In processGoogle New Grad R1: Longest-Match Tokenization and Priority Follow-Up
Role: Software Engineer, New Grad / Early Career
Result: Final outcome not disclosed
Report time: May 2026
R1 contained one coding interview followed by one behavioral interview.
Coding: dictionary tokenization
Given a text string and a dictionary mapping tokens to IDs, scan the text from left to right.
At each position:
- Find the longest dictionary token that matches the remaining text.
- Output its mapped ID.
- If no token matches, output the unmatched character literally.
The candidate stored the dictionary in a HashMap and scanned forward from every position to find the longest match.
Follow-up: explicit token priority
The interviewer changed the selection rule from longest match to priority match.
For example, if abcd, abc, and ab all match but ab has the highest priority, choose ab even though it is shorter. The candidate discussed the approach but did not have time to implement the follow-up.
Practice: Longest Dictionary Tokenization
Behavioral interview
Questions included:
- Helping peers who are underperforming
- The candidate's most challenging project
The candidate felt the behavioral discussion went well.
Comments
0No comments yet — be the first to share what you know.