脸熟挂经

We start talking about my background, I thought it was pretty casual question, never asked as another companies about the hardest technical challenge.

So we start to the code problem.

Given an array of length N, return all the products excluding the current index of the array

Example: [1,2,3,4] Should Return [2 3 4, 1 3 4, 1 2 4, 1 2 3] => [ 24, 12, 8, 6 ]

I started kind of nervous, well who doesn’t it’s Facebook. So I said to my interviewer that In my first approach I could think in an O(n^2) solution, but let me think to get an O(n) approach

After discussing some thoughts, I finally gave him the O(n) solution, I code it with explanation thru the process (he never gave me hints) and finally I run sample test cases (important, if you have 0s)

So he gave me another test case, we tested it seems runs, we did it in 30 minutes so I think we had more time if I needed to fix something, but he just said, go to the question step, do you have any? I asked my doubts and that’s it.

Finally, I’m getting back the feedback, my recruiter is very sweet because she’s telling my just good things, but with the bad news that I was rejected for the next steps.

Since we started talking until the end, I felt kind of weird talking with the interviewer, I think we don’t match talking, so I don’t know if my approach were really bad or if I need to be more friendly. Don’t know.