Hello folks,
I had a phone interview at Facebook in the previous week. The question is one of the popular questions tagged with Facebook.
During the meeting, I clarified the every edge case and introduce the possible approaches to solve that. Then I wrote the proper solution. Introduce Time & Space Complexity without any problem. However, the time is ended and we don't have any time for the next question. After a day, I got my rejection.
I just wonder that how it is possible to handle 2 questions with clarifying every requirement and offer the possible approaches and write down the optimal solution. I think it's quite not feasible unless you memorize the answer. Even you memorize the answer, you need to ask questions for restrictions/boundaries and so on. I'm not sure that clarifying the question and inputs are wise approach. It just eats your time. "Do not dive into code directly" is not a good advice because explaining your ideas does not mean anything. Or let's say we just say one or two sentence then dive into code. Because, the clock is ticking. The only important thing is that you need to solve 2 questions in 35 minutes. You shouldn't need to think analytically, you just need to work like a hash table and remember the solution within constant time. I'm a little bit disappointed for this kind of interview.
I just want to share my insights and I really want to get your advice/suggestions for the next attempts.