Google - Software Engineer - New Grad Phone interview

Status: New grad, BS CS
Position: n/a currently
Location: SF Bay Area

Technical phone screen 1 (45 minutes):
“Underline Mistaken Numbers”

  • Each person has a sign with a unique number on it (1 - 600). The problem is, if some people hold up a sign upside down, it could be mistaken for another number. Find out all the numbers that need to be underlined to prevent this from happening. (After this was done: what about if we have numbers from 1 - 1000 now?)
  • Ex: 89 --> 68

Technical phone screen 2 (45 minutes):
“Array Picture”

  • had to implement the following class:
  • ArrayPicture
  • def set(self, index, value): # normal array set value at index
  • def get(self, index): # normal array get value from index
  • def take_picture(self): # takes a picture of the current array and stores it somehow for use in the next method, returns the picture_number so this picture can be accessed later
  • def get_from_picture(self, index, picture_number): # get the element at the specified index for the specific picture_number
  • After completing this (I initially used a list of lists), interviewer asked how storing the snapshots could be improved if user uses take_picture A LOT (answer was basically storing “deltas” ie. (1,1,6) # this means first snapshot had element at index 1 changed to 6). was asked how get_from_picture would change in general)
  • Next, was asked how to improve class in case where user takes MILLIONS of snapshots…(ie. what would we change about the class and how get_from_picture would change to be efficient)