Google phone interview L4 Aug 2022 [Reject]
Anonymous User
1062

Had my phone interview recently. I was asked an LC hard problem similar to : 282. Expression Add Operators : https://leetcode.com/problems/expression-add-operators/
Two differences from the LC question :

  1. only have to consider two operators '+' and '-'
  2. I can't change the order of the numbers. for example : for 456 -> I can do : 4+5+6 or 5-6 or 5+6 or just 6 but NOT 6+4 or 5+4

My approach was to add valid numbers to a list like : 4,5,6 , 45, 56, 456 and via recursive backtarcking see if the combinations equal up to the given target. If they sum up to the target I would add it to the result list. But now after seeing the solution I know that it wouldn't lead to the correct solution.
I have no idea if it's possible for anyone to come up a solution in the 45 min interview of which abput 5-8 mins are used up for introductions.

Losing confidence :( I don't think I would have solved this even after 2 or 3 more months of preparation if I'm seeing this for the first time.

Please comment if any of you would be able to do it.

Loaction : google usa

Comments (3)