Meta Online Screening Interview - E4 USA
Anonymous User
2436

I have 4+ YOE and I applied online to a lot of Software Engineer positions at Meta, and the recruiter reached out to me to setup an interview for the Software Engineer - Product position.

The interview was 45 minutes long. Interviewer directly jumped into the 2 coding questions after giving a brief intro about himself. The last 5 minutes were reserved for any questions I might have.

Questions asked:

  1. https://leetcode.com/problems/sum-root-to-leaf-numbers/
    • Was asked a variation: If a root-to-leaf path has an even number of negative nodes, the generated number should be added to the overall sum. If the path has an odd number of negative nodes, the generated number should be subtracted from overall sum.
    • I wrote the standard tree traversal approach but also incremented & passed a negative nodes counter in each function call. At leaf nodes, I used the counter to apply the requested odd/even logic.
    • Time complexity was O(N) and space was O(logN) if recursion call stack is considered.
    • Was not asked a Morris Traversal follow-up
  2. https://leetcode.com/problems/kth-largest-element-in-an-array
    • I initially suggested the Min-Heap solution. On being asked if a more optimal solution exists, I suggested the Quick Select solution.
    • Interviewer said that either solution is fine, but if I implement the Min-Heap solution, a follow-up would be asked. But for the Quick Select solution, no follow-ups would be asked if the implementation is correct. I chose to do the quick select solution with Random pivot selection.
    • Space complexity if O(1) if recursion stack is not considered. Time complexity is O(N^2) in worst case scenarios where input is sorted in reverse, and random pivot selection returns extreme indices. But the average complexity of the algo is actually O(N).

The interview was on CoderPad. I wrote the code in Java but didn't have to execute it, I only had to do dry runs.

Comments (6)