Meta Phone Screen MLE E5
Anonymous User
515

Giving back to community

Question 1:
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iii/description/

First gave O(n) solution but E wanted me to optimize. Then gave O(1) solution

Follow-up: "How can you prove that the O(1) solution would converge?" I fumbled on this but said something like they will because they belong to the same root, and same tree. Don't know if this is right

Question 2:
https://leetcode.com/problems/valid-word-abbreviation/description/

Gave O(n) solution with two pointers

Follow-up: "what if both the abbr and word can have digits? What would you do? What is the time complexity?" I said that we would need to check digits from both strings, move pointers according. That would bring time complexity to O(n + m) because we need to move through both word and abbr. E looks satisfied with answer but not sure if correct.

Meta wants perfection so not sure if this is a pass. Praying and waiting for the best.

Comments (6)