Screening Round with Google !!!

google logo
google
April 8, 20254 reads

Summary

I had a disappointing screening round with Google where I struggled to understand and solve a complex string parsing problem, despite extensive DSA preparation.

Full Experience

I've been preparing for DSA for over three months, diligently solving more than 372 problems on LeetCode. But what happened next was something I never expected. When you fail to understand the question, what worse could possibly occur? Here's the question that left me baffled:

I realized that the problem required a brute force approach, utilizing a hashMap to check if a sequence exists and decide whether to extend it or not. However, the first rule contradicted my assumptions, leading to confusion. I spent over 30 minutes trying to understand the problem before finally started coding as a last resort.

Interviewer did walk me thorough the appraoch as below. If not seen in map, add it in map and also in sequence. if seen in map extend it. But i was still not clear on when we cant extend. e.g. abccccd 1 - a not seen put in map extend sequence map[a],res:[a] 2 - b not seen put in map extend sequence map[a,b], res:[a,b] 3 - c not seen put in map extend sequence map[a,b,c] res:[a,b,c] 4 - c seen put in map extend the sequence map[a,b,c,cc] res:[a,b,c,cc] 5 - here we cant extend c as cc and cc as ccc beause it breaks rule one so we have to take cd here. i was really confused with what rule we took cd as d is not seen yet. Either my uderstanding was going wrong or the interviewer was not getting what i am asking.

This was a disappointing experiance. I am greatful to google and the interviewer for this opportunity.

Interview Questions (1)

Q1
Get Phrases from String with Rules
Data Structures & Algorithms

Given a string get the phrases. e.g goooooogle, res = g, o, oo, ooo, gl, e e.g abccccd, res = a,b,c,cc,cd

Rules: 1 - Concatenating all phrases should recreate the original string. 2 - You can extend the phrase with a previously seen phrase or start a new one if not seen. 3 - each phrase has to be as long as possible.

Preparation Tips

I've been preparing for DSA for over three months, diligently solving more than 372 problems on LeetCode.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!