Google L3 | Phone Screening | Interview

google logo
google
SDE IOngoing
August 25, 202524 reads

Summary

I recently had a phone screening interview for an L3 role at Google, where I was presented with two challenging string manipulation problems, both of which I successfully solved.

Full Experience

I recently underwent a phone screening interview for an L3 position at Google. The interview focused heavily on my problem-solving skills, and I was given two distinct coding challenges related to string encoding and decoding. I managed to solve both problems during the interview session, feeling confident in my approaches.

Interview Questions (2)

Q1
Encode String with Brackets
Data Structures & AlgorithmsMedium

Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc.
Input: s = "3[a]2[bc]"
Output: "aaabcbc"

Q2
Decode String to Shortest Encoded Form
Data Structures & AlgorithmsHard

Given a decoded string, find the shortest possible encoded string. The encoding rule is: k[encoded_string], where k is the number of times encoded_string repeats. The goal is to minimize the length of the encoded string.
Input: s = "aaabcbc"
Output: "3[a]2[bc]"

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!