Meta Phone screening ML/AI London
Summary
I had a phone screening with Meta for an ML/AI role in London. The interview included two Data Structures & Algorithms questions: one on making parentheses valid by removing minimum characters, and another on finding the Lowest Common Ancestor of two nodes in a binary tree, perceived as similar to finding an intersection of linked lists due to the input format. I successfully moved to the full loop after this interview.
Full Experience
Meta Phone screening
1- count all paranthese you need to remove to make a valid parenthese. I solved with loop and counting open and closed parentheses.
2- LC236 find lowest common ancestor of two nodes in binary tree. I solved it with map - TC O(N) SC O(N) ).
update -- in fact the question I got was similar to LC160 because they gave the nodes as input. --
as a follow up I discussed the optimal solution with O(1) SC
the idea being to determine the depth of the nodes and then move pointers accordingly. the interviewer did not ask me to code it.
feedback:
- I was nervous so I named the functions to solve the problems func .. feedback told me the naming was bad
- in problem 2 interviewer asked me if i want to do a dry run and if everything ok, I said yeah it is ok, then he mentioned an edge case and asked me what would be the output then I realized that i had a bug in the condition
I moved to full loop
Interview Questions (2)
Minimum Parentheses to Make Valid
count all paranthese you need to remove to make a valid parenthese.
Lowest Common Ancestor of a Binary Tree
Find lowest common ancestor of two nodes in a binary tree. The question was similar to LeetCode 160 (Intersection of Two Linked Lists) because only the two nodes were given as input.
As a follow up, the optimal solution with O(1) SC was discussed, which involves determining the depth of the nodes and then move pointers accordingly.