Google Four-Round Interview Experience
Company: Google
Role: L3 (SWE1)
Interview Stage: Onsite
Location: unknown
Year: 2024
Original Post Content:
Background:
I obtained a bachelor's degree in computer science in May 2024 and began working at Amazon. I applied for a position at Google without much hope, but ended up getting an interview opportunity. Although I was rusty on Leetcode, I still passed the online assessment.
Round 1: Technical Interview
Q: Adding and Searching Words in a Trie
Due to limited preparation time, I mainly reviewed common topics like graph theory and dynamic programming, but didn't cover Trie. The question was about adding and searching words. Using a Trie structure, since it's a tree-like structure, you can quickly search for words, but you need to pay attention to what you return. I directly told the interviewer that I knew this was a Trie-related problem, but I hadn’t practiced Trie. He understood this and still wanted me to continue answering. Then I suggested using a hash table to solve it, which seemed to satisfy him, but he still guided me to implement it using Trie. In the end, it wasn’t solved, but he seemed to understand my situation.
Round 2: Technical Interview
Q: There is a class with two methods: addNonOverlappingInterval() and another to check if a number is within an interval.
The interviewer asked me to discuss three approaches: O(N), O(logN), and O(1) for the checkIntervalInRange() function. I proposed a linear-time solution and suggested using binary search to achieve O(logN) time complexity. For O(1) time complexity, I couldn't think of a solution at the moment, so I suggested creating a hash table containing all numbers within the interval and then performing a query. He asked me to express the time complexity of this solution in terms of bit depth, and I messed it up. Finally, he told me that I performed well overall and that if I had more time, I should have been able to calculate the correct time complexity.
Round 3: Technical Interview
Q: Given a file consisting entirely of IP headers, count the top 10 most frequently occurring IP addresses in the file.
My approach was to use a priority queue. Then he asked a follow-up question: If there are ties in frequency, return nested pairs, along with the nested frequencies and a list of all IP addresses with that frequency. Here I used an approach similar to bucket sorting. Finally, there was an open-ended follow-up: What if the memory isn't large enough to read the entire file?
Round 4: Googleyness
The questions I was asked:
· Tell me about how you work with difficult people.
· Do you prefer working in small or large teams?
· Define your ideal work environment and manager.
If you encounter any difficulties or have any questions, please feel free to come here to find solutions.