Google · Onsite
In processGoogle 2026 New Grad Onsite: Filesystem Size and Dynamic Friendship Connectivity
Role: Software Engineer, New Grad
Result: Passed the onsite
Report time: April 2026
The candidate completed two in-person coding interviews back to back, with only a short break.
Coding 1: filesystem total size
The input is a strict tree of filesystem nodes:
- A file has a
sizeand no children. - A directory has children and no own size.
Given the root directory, return the total size of every file below it.
The candidate initially added cycle detection because real filesystems may contain hard links. After the interviewer clarified that the input was a strict tree, they removed that logic.
Follow-ups covered time complexity, caching subtotals to speed up repeated calculations, and whether cache lookup could be improved further. The candidate later thought an iterative implementation might have been another useful optimization.
Practice: Filesystem Entity Total Size
Coding 2: friendship connectivity with breakups
The base problem was a friendship-connectivity task solved with Union-Find.
The follow-up allowed friendships to break, turning the problem into fully dynamic connectivity. With little time remaining, the candidate maintained the original graph and used DFS, but felt that solution had major gaps.
Commenters discussed offline segment trees and rollback DSU. The candidate later agreed that rollback DSU appeared to be the best approach, while clearly stating that they did not know it during the interview.
Practice: Dynamic Friendship Connectivity
The second interviewer gave little feedback, which made the candidate feel the loop had gone poorly. They later updated the thread to say they passed.
Comments
0No comments yet — be the first to share what you know.