Facebook | Phone | Serialize and Deserialize a Binary Tree

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

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

Original Post Content:

I recently had a phone interview with FB and I was asked this question with a slight twist

Question:
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
The serialize method is only allowed to return a list of integers and no nulls are allowed. The solution should work for positive and negative numbers.

I hadn't solved it before but managed to work through the problem and come up with a solution to solve it. The key was I didn't panic when I got a problem that I hadn't practiced since I trusted my preparation and worked my way through the problem while thinking out loud and managed to code the solution.

I got the confirmation that I've made it to the onsite interviews.

Comments