Google | L3/L4 | Bangalore | May 2022 [Reject]
Anonymous User
1724

Posting details of Google Virtual Onsite interview, which consisted of 4 rounds, of 45 mins each -- 3 technical and 1 behavioural. All rounds were scheduled on the same day, and it was a very smooth interview experience.

Round 1 : The interviewer was very formal and to-the-point, expecting crisp answers to every question. I was asked to design a temperature register, which would receive numerous of temperature readings at any given time and display maximum temperature received in the last 24 hours. The design should scale to handle millions of readings gracefully. The solution I offered was to use a max heap where the root node would always refer to the maximum temperature. Since my approach would result in the heap growing indefinitely, I also suggested a cleanup module to delete all temperatures periodically every 24hours. The interviewer accepted this solution and asked time complexity for every module. He then suggested this can be done via a BST as well. I feel it could have been done via a Deque too, but I think it boils down to how much it scales.

Round 2 : This was the Googleyness round. Interviewer asked some basic behavioural questions. Listing down the ones i can recall:

  • What is the most difficult project you have done so far and how did you handle it?
  • What are your learnings from the above?
  • Recall one incident when you had to meet a very strict deadline and how you were able to meet it.
  • Have you ever been in a position where there has been a clash of perspective with colleagues and how did you overcome it?
  • Have you ever gone above and beyond your current set of responsibilities at work and done something which benefits the team as a whole?
    This felt like a normal conversation and she seemed satisfied with my answers. We ended the interview 7 minutes early.

Round 3: You are given an array depicting heights of buildings. You can jump from one building to next, if it's height is less than or equal to the current building. If the next building's height is greater than the current one, you have to climb it. You can use either bricks or ropes for the climb. Each brick is of height 1 unit. A rope can assist you to climn any unit of height, but one rope can be used just once.
Given the number of ropes and bricks, use them optimally to jump to as many buildings as possible and return the index of the farthest building that you can jump to. For e.g.,
Input: heights = [4,12,2,7,3,18,20,3,19], bricks = 10, ropes = 2
Output: 7

I brainstormed and improved from recursive solution to a DP solution to finally a solution with heaps. That took O(nlogn). I covered all edges cases and did dry run with given set of inputs. However it took me 4minutes more than the time limit, which i feel led to deduction of points despite a proper solution. Interviewer was friendly and gave me a hint when i was thinking and i was able to catch it. She was nice enough to give me 4mins to finish the code but well :P

Round 4: Given a list of inequations, you have to find if they are solvable or not. Return true if solvable, else return false. For e.g.,
Input:

  1. [ (a<b) ]
  2. [ (a<b), (b<a)]
  3. [ (c<d),(p<q),(f<k)]

Output:

  1. true
  2. false
  3. true

The inputs would be given as list of string arrays. The language of the question was confusing, it mentioned that the value of the variables could be anything and we are not allowed to subsitute or make any ordering based on literal values / ASCII values of characters. It took me a lot of time to figure out what is actually happening here, and in the end i finally coded the solution but it was not optimal.
Interviewer suggested in the end that this can be done most optimally using forest and topological sort.

Overall, few points which i could realise from this experience and would like to share with the community:

  • Google doesnt just want you to write code which works, it wants you to be perfect. (Bug free, production level code which follows conventions and is most optimal and scalable)
  • 45 mins makes a huge difference. You really have to be extremely efficient in time management. Cut short your introduction into a crisp one liner, that'll help you save time.
  • Always think out loud. It is encouraged by interviewers.

Hope this helps !

Comments (7)