Google | L4 | US | Phone + Onsite

Anonymous User
572
Feb 20, 2025

Phone Screen:

implement a string replacement object that supports

  1. store(key: str, value: str) -> None; stores a certain value as key

  2. convert(input: str) -> str; convert a input string that utilizes a previously stored key
    i.e., if we have already made a call of store(key="USER", value="leetcoder22"), then convert("username is $USER$") should return "username is leetcoder22".

  3. followups: what if we want to include "$" as part of a key

Onsite1:

in a game, player 1 picks a five letter secret word with no duplicates and player 2 tries to guess it. for every guess, player 1 scores the guess out of 5, indicating how many letters exist within the secret word.

  1. implement score(secret: str, guess: str) -> int; return the score player 1 gives player 2; i.e., score("teams", "abide") returns 2
  2. implement is_possible_guess(hist: typing.Any, guess: str); given previous guessing history and their scores, see if the next guess is a reasonable next guess
  3. implement next_guess(hist: typing.Any) -> str; given previously guessed words and their scores, what should player 2 guess

Onsite2:

given a word indicating the ordering of a foreign alphabet, examine if a input string is sorted in that order
i.e., is_ordered(order="abcd", input="aaaboid") returns True

then we did a code review (??) of some random stuff the interviewer wrote

Onsite3:

implement a restaurant waiting list system that supports

  1. given a party size, put the party in the waitlist, return a party id
  2. given party id, remove party from the waitlist
  3. given a party size, get the next waiting party of that size, return party id

Note #1
I came up with all the function headers as well as usage- as the interviewers often leave things as vague as they can
Note #2
Google does have a pool of questions, but most interviewers choose to ask their own questions anyways; therefore the point of this post is to give folks a sense of how difficult/easy the questions are, I highly doubt you'd run into one of these in an actual interview so no need to memorize any

Still waiting on interview results but will likely decline for a better offer elsewhere

Comments (6)