Facebook | Phone Screen | Verifying Alien Dictionary & BT Iterator

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2019-10-15Added By Anonymous
Source: Link

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

Original Post Content:

45min phone interview. Started with 5-10 min introduction and around 30-35min to code, followed by 3-5min for questions.

Question 1:
https://leetcode.com/problems/verifying-an-alien-dictionary/

Follow up:
How would you make this production ready code and how would you verify/test it i.e., since it is not possible to write all possible test cases, how would you go about it?

Question 2:
Given a reasonably well balanced binary tree, implement an iterator that iterates over it in in-order fashion.
Note: Parent pointer does not exists
https://leetcode.com/problems/binary-search-tree-iterator/

Asked Time and Space complexities for each of them.

Comments