Phone Screen:
implement a string replacement object that supports
-
store(key: str, value: str) -> None; stores a certainvalueaskey -
convert(input: str) -> str; convert a input string that utilizes a previously storedkey
i.e., if we have already made a call ofstore(key="USER", value="leetcoder22"), thenconvert("username is $USER$")should return"username is leetcoder22". -
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.
- implement
score(secret: str, guess: str) -> int; return the score player 1 gives player 2; i.e.,score("teams", "abide")returns2 - 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 - 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
- given a party size, put the party in the waitlist, return a party id
- given party id, remove party from the waitlist
- 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


