Google | L4 | Rejected
Anonymous User
9462

YoE : 8
Time taken in prep: 3 months
Leetcode problems: 127

I have just botched a google onsite interview and I wanted to share why that happened and what I could've done better.

Tips

  1. Arrive early, I arrived late and it cost me about 10 valuable mins
  2. Find the quickest solution you can and START WRITING CODE! I took a lot of time trying to understand and optimise the problem on the boad before actually writing any code
  3. Problems are going to be purposely vague and seemingly hard, although with a bit of thought they could have a simple solution
  4. Ask if there will be a follow up, you can and you should
  5. Be quick I cannot stress this one enough, practice writing correct and bugless code as quickly as you can. To do that you either solve problems you have already solved or solve very easy ones, you are not learning an algorithm or how to solve a problem, you are merely learning how to write bugless and efficient code fast regardless of the problem, which is a different muscle entirely! (I am working on that one now as I lacked it massively and it cost me this interview).
  6. Hate to say this but you have to know basic algorithms and how to implement by heart! you need to know how to write them if you were blind folded, this is a HUGE time saver. (recursions, DFS, BFS, quick and merge sort, ...etc).
  7. Understand DP, I solved that one pretty quickly but because I lacked fast typing I couldn't write it in time

Questions
I can't remember all the questions as I didn't take notes, but here is what I can recall:

Questions 1
You are given an infinite number of dice and you want to represent numbers with them. A represented number is lining up dice faces to make up the number, so 11 is 2 dies of faces 1 and 1, 15 is one '1' facing die and one '5' facing die . A number can only be represented fully or be a sum of fully represented numbers.for example:
* 66 can be represented fully
* 82 cannot as we don't have a die face for '8' so we have to find a number that sums to 82 and is made up of representable number, so 82 can be 66 + 16 and that would be the correct representation

Given any number, you need to find the optimal way to represent it with the smalles number of representable numbers

Question 2
You need to find the path with the largest sum in a matrix, but you cannot go back or diagonally, also there are barriers of 0s along the way, the matrix also has no cycles, so you cannot go back to a number from another number
Example:

[1,2,3,4,5]
[0,2,0,0,9]
[1,6,7,0,0]
[0,8,0,0,10]

A DP problem

Question 3
I cannot remember the exact question but was similar to guess the word with different variables and we are looking for a set of numbers in a big range

Aced the SDI and the googlyness of course.

Comments (11)