Facebook | Phone | Interval List Intersections & Largest BST Subtree

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-10-05Added By Anonymous
Source: Link

Company: Meta (Facebook)
Role: e5
Interview Stage: Phone Screen
Location: unknown
Year: unknown

Original Post Content:

Position: E5

Hello everyone,

I had my FB phone interview today. The call was for 45 minutes and interviewer directly jumped on question without any introduction. Now even though I had all 45 min to perform, I felt so stressed that even a very easy question which I even had solved earlier, did not click to me in first go and spent something ~5-10 min in various clarification and edge cases as interviewer has tweaked the question in such way that I felt it lot ambiguous. Anyways... Finally I solved in most optimized way and told time complexity and stuff.... She did ask me another question but due to lack of time, we could not go over code and I told her verbally the approach. I later checked and it was correct approach but not sure if she understood well enough but seems like she did.

I was asked to
a) "find intersection of unsorted non overlapping intervals". Wording of question was different though but it drilled down to this only. - I solved with 2 pointer.
b) Largest BST Subtree - I proposed recursive solution ie. find largest in left and right and get max.

I could have solved both question and I consider both of them fairly easy but stressed killed my performance guys. I tried my best though and also couldn't complete the code in given time. Did it happen with anyone else where you have solved just 1 question and got through the phone screen? I don't have any hopes :(

Comments