[NDA] Facebook | E5 | Telephonic
Company: Meta (Facebook)
Role: E5
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
Wanted to contribute to the great community irrespective of the result.
As I have signed NDA, will try to give my maximum insights/experience without mentioning the exact questions. Also there are great posts out there in the LeetCode forums about the tips and tricks about the Facebook interviews. I have read almost everything and applied (for example, don't explain more about yourself which will affect your coding time, never write brute force code if you feel confident that you can come up with a better approach, never make any assumption, think aloud and ask all questions etc).
Nearly 1 year of prep. I have solved almost 70% of the Facebook tagged LeetCode problems (sorted by frequency). But still both the questions are not from that.
1. LC easy level. Array based problem. I gave the brute force instantly and optimal solution in the next two minutes. Written code and verified in the next 5 minutes so almost within 15 minutes from the start of the interview I have completed my first question. I got a panic attack while dry running the solution for the interviewer. I have wrongly calculated the numbers and when I tried to go back and fix the numbers for the dry run, the interviewer rushed to the next question and I left it there :(
2. LC medium level. Again Array based problem. My mind didn't come out from the first question panic attack yet. So I asked the interviewer to repeat the question once again. I wanted to give my best here. There are two questions in the problem (from the interviewer). How to store the elements optimally in terms of space? And how to use the optimally stored data structure to solve the second question? I told my approach within 2 minutes for both questions. He said fine and told me to write the code. I am really fast in writing code. Though I'm nervous, I managed to write the bug-free code and execute well this time. Interviewer asked me what is my space complexity. I said O(1) because I haven't used any extra containers or system memory for Question 2. He asked me to verify. I said I didn't use any extra space. He told me to look at the function prototype. C'mon I didn't take the input vector by reference (missed '&'). Interviewer wanted to improve my time complexity. So I came up with the optimal approach very instantly which required 3-4 lines modification in the existing code. He asked me to modify. I have modified the code and started dry running my code. He pointed one mistake before I completed the dry run (most painful moment which I never wanted to happen :'( ). He asked me the current time complexity. I started thinking. When I told the time complexity, no response from the interviewer. I saw my Wifi stopped working. I restarted my router and connected back. Interviewer said he is done and asked me, any question I have. I asked a usual question with a very low tone.
Thinking where I could have done better.