Yesterday I concluded all the coding rounds for my Google Interview. Over the past 3-4 months, I have thoroughly practiced for this round. I wish to leave this note to myself so that I can revisit this in case anytime in future I again have to prepare for an interview at a similar organization. I’m sharing this with the leetcode community as well I’ve learnt a lot from the community, and in the same way I hope this could be useful for others.
Status: 8 YOE
Location: India
Interview Location: Virutal onsite
This post captures the experience of only the coding rounds( 1 telephonic screening, and then 3 virtual oniste )
There is a plethora of material on the internet giving advice on how to build a study plan and to prepare for the interview. While I still don’t know how I’ve fared in these interviews, I am happy with my performance so far, and I feel good about the hard work I’ve poured in. A reason why I’m writing this document now(before the results are announced) is that I wish to be unbiased by the outcome.
What are the most important topics for the interview?
I appeared for a total of 4 coding rounds so far, one in phone screen, and three later
Usage of hashMap - In two of the questions(1 & 4), I the usage of hash maps was required to effectively solve the problem. In fact in the last coding round, I struggled a bit until the interviewer nudged me towards using hashMap. So he split the question in two parts, for part 1 I immediately suggest useing hash map, and then we discussed how they help in saving time, at the expense of using more space. Somehow in the part 2 as well, I missed using those upfront, and then interviewer hinted me towards that direction. (will write a separate note on hashMap)
Usage of queues, and if the question demands, then priority queues. In the first three questions(1,2 & 3), I had to use either queue or priority queue to effectively solve the problem. In the first one, the question inherently demanded a queue data structure just because the data was thrown in a FIFO environment. For the second one, I used bfs in a matrix where queue was required. For the third one, both normal queue and priority queue was used to effectively capture bfs, and ordering respectively in the same question.
Graph Traversal, especially breadth first search (Q 2 &3). In question 2, I used bfs in a matrix(image) exploration, while in q3, I used bfs to explore a regular graph using adjacency lists. In both these questions, I could have effectively used a dfs solution too, but the bfs, I feel, is more elegant, and I seem to have more control on the traversal as I go through the graph. the implementation is through a queue, and not recursion.
In addition, couple of things that I’ve picked up and worked well are:
Treat the interviewer as a colleague, and thoroughly brain storm the solution with her/him.
Speed of programming - Once you have the solution thought through, you should be able to code it in lightening fast time. Write a skeleton of what you want to do, and then start filling in details, and finally handle edge cases. One way to improve the speed is to keep writing programs of some problems that you’ve already solved again and again. Prepare for these two things(problem solving, and speed of programming) independently
Finally, some of the topics that I prepared and were missing from the interviews. I still feel this needs to be revisited
Dynamic programming - Its an elegant way to solve problems. Essentially its recursion(first find the recursive rules of the problem) + memoization(store what gets computed multiple times). In addition, there are specialized topics such as top-down approach, sliding window, and usage of data structures to effectively capture the memoization.
(Binary) Tree and DFS - As i mentioned that i chose BFS by choice in both of the quesiton above, but there are instances in which either of the approach is mandatory or results in a more optimized solution. So thoroughly practice DFS as well. DFS has extensive use cases(and problem sets)Eg. in the context of binary trees
P.S. I had written this note for my own usage. In case something isn't inherently clear, I would be happy to answer that in the comments below.
Thank you!