Panda Guru LogoPanda
Guru

Google L4 Technical Screen US

Round 1

Questions: 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:

Candidate's Approach

I used a stack to solve the question.

Interviewer's Feedback

No feedback provided.

Follow-up Questions

  1. Can you write some unit test cases for your solution? Think of it as if you are designing a feature. What unit test cases will I consider?
  2. How will I solve it without using stack and give me a dry test run? My response: I used a 2 pointers approach and gave him some dry test run.