Update: Moving on to the Final round
I applied for Google Software Engineering III role back in November and a recuiter got back to me to schedule first round. I have 2.5 YOE. I had two telephonic rounds. In the first one, I got recommended for L3 but my recruiter wanted me to give another and get recommended for L4.
Question:
You’re given a string which may contain "bad pairs".
A bad pair is defined as a pair of adjacent characters, where they are the same letter in different cases. For example, "xX" is a bad pair, but "xx" or "XX" are not.
Implement a solution to remove the bad pairs from the string.
Sample:
• Input: abxXw
• Output: abw
Additional Case:
If the input string is empty:
• Input: ""
• Output: ""
I used stack to solve the question.
Followups
1. Can you write some unit test cases for your solution. Think it as if you are designing a feature. What unit test cases will I consider?
I gave some couple of unit test cases and he was fine with it
2. How will I solve it without using stack and give me a dry test run?
My response: I used 2 pointers approach gave him some dry test run.
I'm still waiting for feedback.