Technical phone screen -
Typical medium level leetcode question and I was able to solve it (It was completely new question for me so I took a minute to understand it). Interviewer asked me to optimize it further which I tried, but he wanted it in a specific way (I guess using DP). I couldn't do it in next 5 mins so we moved on to the next question. Did well in other areas.
Got rejected for the same reason that I couldn't optimize my code.
Why does interviewer expect candidates to write a code in a specific way? What is the end goal here?
Optimize your code as quickly as possible because that is all you are going to do in your job,right? :/
I get it that optimization is important but certainly you need enough time to optimize code using DP, if you haven't heard of problem before or you have to be lucky enough to get the known problem.
My personal opinion - I never felt this is a right way of selecting/rejecting candidates but looks like market is full of hackerrank, leetcoders so get in the race because that is how you will be judged :(