So I was interviewed by one of the fangs. Interview asked me a question which I solved recursively. Then dude asked me to solve the question iteratively. I explained the solution to him however (my bad) I couldn't complete the code correctly. (It was not even coderpad or hackerrank). Just a plain editor. I'd no chance to execute the code. He didn't really test me on other skills I have. Now had I seen that question during practice and solved that question iteratively and recursively, I'd have aced. I am just upset at some interviewers who happen to not really know how to interview, IMHO. I know I'm no saint and perfect. But really this is how you interview? How common it is for other fangs and fang-likes?
Explain the question to us
I can't without giving too much information.
Yes, you fail if you can not code correctly. In a plain editor or whiteboard.
Seriously, is it same in Amazon?
For L5 job, you will fail if you did not check invalid input and edge case
This happened to me few months ago. Give it few days and you will realized how organized and cleverly answered the questions and nailed the interview. But for the next anxiety again :)
Yup that is how it's done. You were lucky to use a computer at all, a lot is done on whiteboards.
If this happened to me, I’ll be glad that I didn’t get hired. Iterative solutions are so dirty that I wish was a TPM rather than a dev.
😂😂😂😂 While there are use case where iterative is the way to go to optimize for memory or speed, in general I find the recursive solution (when it makes sense) much more natural. So gotta agree
OP. You should have told the interviewer “go back to C++. Homeboy!!”.
Depends on the question. Simple example: tree traversal recursive - cs 101 question. Iteratively- many folks fail writing that in interview.
Idea is not to practice every qn out there and “ace” through it, rather it is to see if you can think on the spot about problem at hand and reach a solution. Almost every time I interviewed at FANG, even though I never saw the qn before and was able to solve it, test it for cornercases, I did not make the cut, simply because there is too many “Acers” out there. I just sucked it up and I am happy interviewing at Startups that test you on real skills. FANG money will be always there but you don’t want to define your life by mere TC
Yes. Exactly. For the love of God, can't agree more.
Sometimes it’s just luck or not a fit that time around. Don’t sweat it - interviewing isn’t a perfect process.
That's what I'm telling myself. There's some truth to it.
I understand your frustration. The same thing happened to me at an Amazon on-site. I was given the Coin change problem. I solved it recursively, walked through all test cases, then last five minutes interviews asks me to optimize it. I suggest adding memorization, but make some errors because I don’t want to erase beautiful written code on the whiteboard and fail. I think it would have been better to spend the time writing the most optimal case first, if it’s necessary. I like talking and walking through the recursive implementation because it’s easy to explain your thoughts and then you can go ham on a super optimized approach. I’m just going to write the DP approach first going forward.
Sorry but class of “coin change” problems solved without dp/memo does not pass the hiring bar for fang.
Yeah, also adding memoization on a recursive solution is literally 3 lines of code, you could have written your beautiful code directly with it, wouldn't make it harder to understand
Which of the FANGs was it?
The canine
I don't think it really matters now...