Google Virtual Phone Screen | Google Meet Interview
Anonymous User
10246

I had a virtual phone screen interview with Google on 24th October 2023 - 3pm to 3:45pm MST. I think its safe to detail out the truth in its entirety considering I'm going to be posting this anonymously. So here goes -

My Background:
I should mention that I'm closing on 8 years of work experience. Although I haven't been fortunate enough to find a dev role right at the start of my career, I am in one now. I started out as a Content Writer at a Digital Marketing firm (earning $120/month) for a year, followed by 2.5 years in Functional Testing and Prod Support, then a Masters' with an internship where I did my first UI (real dev) project, then followed by another 2 years with a pseudo dev contract work, and finally a Full Stack for the past year.

I was fortunate enough to even land this opportunity with Google, and I'm content that I didn't embarass myself as much. Anyway, pardon my sad background of a story, I just wanted to vent a little. I know I have ways to go, and I will keep at it.

Anyway, here's my interview experience -

Interviewer - Intro
Me - Intro + Pleasantries
Interviewer - Smiles > In the interest of time, he politely asks if I'm ready to get into the coding challenge.
Me - (Nervous like a mother) Sure

Question

There's this text log file (single file) that contains a chat transcript of a chat room (can have multiple people talking).
Something like the following -

10:00 <alice> Hi! What's up?
10:01 <bob> Hey
10:03 <alice> Dinner?
10:04 <john> I'm down! But only if it isn't vegan.
.
.
.... could be more entries

You have to parse this file. And store data into a DS of your choice. Furthermore, we want to know the top n number of most talkative people. You would return that in a DS of your choice again, which must contain the top n people's usernames and the number of words they have typed out per the transcript.

My code response - (JavaScript)

Note: We skipped the parsing part, since he was interested in the data structure usage, and I did explain what we would use and how we would extract data (tl;dr: regex + return in an array with key value pairs as items in the array)

const wordMap = new Map();
  words.forEach((w) => wordMap.set(w, (wordMap.get(w) || 0) + 1));
  const wordArray = Array.from(wordMap, ([word, count]) => ({ word, count }));
  wordArray.sort((a, b) => {
    if (a.count === b.count) return a.word.localeCompare(b.word);
    return b.count - a.count;
  });

  wordArray.length = k;
  return wordArray.map((wa) => wa.word);

I have only begun my prep journey and have done only about 20 leetcode problems so far. about 15 easy and 5 medium ones. No hard questions obviously - can't even understand the damn questions!

So, after the interview, I tried to search similar problems and I'm pretty certain it was built on this one -
https://leetcode.com/problems/top-k-frequent-words/

I solved it, and seems to work. Although I correctly pointed it out that the complexity would be O(nlogn) because of the sorting, I couldn't come up with a O(n) solution. I tried my best to articulate my thoughts while coding but couldn't be as eloquent as I wanted to be. I did mention and discuss the approach before I dove into the problem though, which later he did say met his expectations.

I also fumbled when he asked me which data structure would be ideal to store the values after parsing it so the retrieval would be easy? (Answer: Heap for better storage retrieval and ideally Bucket Sort + Trie) I said - "I'm thinking a tree of some sort, but I don't really know." I was thinking that a tree would adjust its nodes and the sort algorithm could be circumvented to avoid the nlogn time, but you know by now, I'm stupid.

He gave me plenty of hints, but I'm glad I at least was able to solve it via brute force in the time we had.

I'm posting to seek advice on how to prepare. I know I have to focus on solving more problems. If someone could give me a fair target at which I would be able to clear these big tech firm interviews, that would be awesome.

Comments (10)