Facebook | Phone | Valid Palindrome & Diameter of Binary Tree
Company: Meta (Facebook)
Role: unknown
Interview Stage: Phone Screen
Location: London
Year: unknown
Original Post Content:
Location: London
I had my phone interview a couple of days back.
1. Valid Palindrome without any temp storage. Ran through the code with the sample inputs given with the problem statement.
2. Diameter of a Binary Tree : What is the TC and SC [mainly the recursion stack]. Ran through the sample tree given with the problem statement.
3. Diameter of an N-Ary Tree. Ran through the sample tree given with the problem statement.
I did all in 45 minutes and still got rejected. Actually, I am still clueless that why I got rejected. May be GOD is not feeling safe to send me to London due to the high COVID figure [Only Joking Please don't take this part seriously]
The reason for Rejection are : [ My Guess]
* The interviewer is a c/c++ guy maybe. He was very unhappy about the global variable for maxDia in the 2nd Solution. He seemed okay after I passed it as an Object instead of a global variable. He did not like the concept of using a global variable to track the maximum diameter during the recursion.
* He was not interested from beginning. I found him not at all interested about the interview after it started. Maybe he is going through some personal problem during this difficult time. He was just asking questions and I did not find him attached with the process at all.