Google L3 Phone screen round
Summary
I experienced a Google L3 phone screen round where I was given a problem similar to LeetCode's 'Move Pieces to Obtain a String' with a follow-up. I solved the initial part but ran out of time on the follow-up, ultimately leading to rejection.
Full Experience
Exactly same as but problem was framed in different way: https://leetcode.com/problems/move-pieces-to-obtain-a-string/description/
Follow up: What if pieces can go out of scope of array?
intialState: "_ L _ L L _ R L _ R R R _"
targetState: "_ _ _ _ L _ R L _ _ _ _ R"
output: true
Was able to solve first part For follow up told that we can remove the chunk of L's from beginning and same for R's from end. And check the middle part using original problem.
He told it is not necessary that pieces will be removed. I mean we need to track indexes. Time was over.
Will I get call for onsites?
Edit: I was rejected. Reason given was that he gave hints ( he just told one edge case, which i think was even mentioned as edge case because problem statement was not explained precisely, that too was discussed before writing the code. My code covered all edge cases in first run.)
Anyways, they wont even match my current base, forget about my base after appraisel.
Interview Questions (2)
Follow up: What if pieces can go out of scope of array?
Given:
intialState: "_ L _ L L _ R L _ R R R _"
targetState: "_ _ _ _ L _ R L _ _ _ _ R"
output: true
The interviewer suggested that we could remove chunks of 'L's from the beginning and 'R's from the end, then check the middle part using the original problem logic, but then clarified that pieces might not be removed and we need to track indexes.