Google · Onsite
In processGoogle New Grad R2: In-Place Game of Life and Door-Crossing Priority
Role: Software Engineer, New Grad
Result: Final outcome not disclosed
Report time: May 2026
Application: Referral
The candidate completed R2 virtually and reported two coding problems.
Coding 1: Game of Life
The first problem was LeetCode 289, Game of Life.
The follow-up required modifying the board in place. The candidate completed the implementation, dry run, follow-up, and tests with about five minutes left for questions.
Practice: Game of Life — In-Place Next Generation
Coding 2: door-crossing times
The input is already sorted by timestamp. Each index represents a different person, and each record contains a timestamp plus an entering or exiting state. Return the time when every person crosses the door.
When multiple people are ready at the same time:
- If someone entered at the previous processed second, entering people have priority.
- If someone exited at the previous processed second, exiting people have priority.
- If the door was idle at the previous second, exiting people have priority.
- Within the same direction, the smaller person index goes first.
The candidate used one queue for entering and one for exiting, plus the current time and previous direction.
The initial solution advanced time one second at a time. The optimization jumped directly to the next input timestamp, reducing the runtime to O(n) for the sorted input.
Practice: Door Crossing Times With Direction Priority
The candidate saw both problems for the first time in the interview. They explained their reasoning continuously and reached the intended solutions. A few obvious implementation mistakes were pointed out by the interviewer and corrected quickly. The second round ended before a complete dry run, although the candidate had already walked through detailed examples and edge cases while explaining the approach.
Comments
0No comments yet — be the first to share what you know.