Google | L4 | Bangalore | Feb 2020 [Offer]
Anonymous User
7231

YOE: 6+

Phone Screen:
A question on binary trees. I don't quite remember it. It is LC medium. I got a little nervous initially but I was able to get myself together and give the proper solution.

To be clear, the onsite interviews were scheduled on two different days. Two rounds on the first day and rest on the second.

Round 1: Algo & DS
I do not quite remeber the question from this round. It was around intervals. I beleive it's something like this,

Given a set of intrevals (calendar events) and a list of times, return the number of active events at those given times.

I was able to come up with the optimal solution and started coding it. I have finished coding it. However, I missed a couple of corner cases. With a bit of practice, I could've avoided this mistake.

My Approach Sort the start and end times. Use two pointers and keep a count of active events.

Round 2 & Round 3:
Googlyness or Leadership Principles

Standard set of questions. I decided to answer these questions as appropriate as I could. If any of the scenarios didn't happen with me, I have stated so instead of trying to come up with an answer. I did give some similar examples, but isn't quite what the interviewer has described for some of the scenarios.

Overall, I think this is a very personal round. I personally haven't prepared much for this. I did try to clear up my head and thought of how to approach these questions and decided on some appropriate experices that I wanted to present. I have put rather more importance on what not to say than what to say.

Round 4: Algo & DS
There are N cars places along the x-axis in the order of input. You are give an array of N velocities for these N cars. All the cars start at the same time. Return the total number of possible overtakes.

The question was laid out in a tricky way. I gave the brute-force solution right away. However, I took a while to figure out what needs to be solved. In the end, I was only able to come up with an average case Nlog(N) solution. I was quite certain even at that time that there's a best case Nlog(N) solution. But I couldn't quite figure it out. The interviewer asked to code up my proposed solution and I did that without any problems. I later came up with a best case NlogN solution.

Very Similar to https://leetcode.com/problems/count-of-smaller-numbers-after-self/ (pointed out by coronosky in comments).

Solution (that I could think of) If you look at it, the end result is a sorted list of velocities. As such, we need to count the number of swaps required in a bubble sort. But that's worst case N2. A better approach is to use Merge sort. I have only checked it on paper. Haven't implemeted it. Let me know if you have a different opinion or a better solution.

Round 5: Algo & DS
Two questions. Both LC medium.

  1. https://leetcode.com/discuss/interview-question/algorithms/175551/google-list-k-largest-elements-of-a-max-heap
  2. https://leetcode.com/problems/delete-nodes-and-return-forest/

Solved these without any issues.

Round 6: System Design
Design a chrome service to notify users of pages that are plagiarised.

The stress was more on the BE system. The design of the data store, the approach to find plagiarised content and datasize estimates, etc.

I didn't do very well in this round. It's not difficult as such. But I got a little flustered. I didn't prepare very well for this round and practiced very little. Overall, it was just average. I could've performed far better with a bit more practice.

Result:
Overall, the feedback is mixed. The HR informed me that my profile has been forwarded to the HC. Waiting to hear from him.

Edit 1
Some have asked for any pointers. I will list out things that have worked out in my favour. I think I also got a bit lucky in that I didn't get any hard problems.

  • I was able to come up with an optimal solution within the first 10 minutes or so. I don't think this a difficult feat.
  • Once I started coding, I hardly made any mistakes in my code. There's only one logical issue that I wasn't able to fix. Coding on chromebook has definitely helped. On LC, I've only coded on the web interface, no IDE. This too has helped. I tried to write clean code with good spacing and line gaps.
  • Communicate well. I could've done better at a few places. Overall though, I was able to communicate well.

General Advice:
To be honest, I don't consider myself to be very good at algorithms. Practice on leetcode has helped a lot. Before this, I've failed at some other interviews. Most of these were LC medium as well. Everytime I failed, I would think it over and try to figure out my inefficiencies. To figure out what I could've done better to reach at the answer. I tweaked my thought process to be able to do this. There are enough resouces/posts on LC to help with this.

Despite all this, I know there is still a lot for me to improve on. I decided to keep trying at my own pace. My suggestion is not to take interviews too personally and work on getting better at them in general.

All the best :)

Edit 2
Got the offer.

Comments (16)