Meta Screening E5

meta logo
meta
May 19, 20254 reads

Summary

I had my screening interview at Meta, during which I was asked two specific LeetCode problems: Kth Largest Element in an Array and a variation of Binary Tree Vertical Order Traversal.

Full Experience

I had my screening interview at Meta. The following questions were asked:

  1. https://leetcode.com/problems/kth-largest-element-in-an-array/description/
  2. https://leetcode.com/problems/binary-tree-vertical-order-traversal/description/ or https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/description/ with no specific order mentioned for the colliding elements (elements in the same row and column)

For the second question, when I mentioned BFS traversal, the interviewer asked why I couldn't use DFS and requested an example to prove it.

Interview Questions (2)

Q1
Kth Largest Element in an Array
Data Structures & AlgorithmsMedium

Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element in the sorted order, not the kth distinct element. The problem expects a solution with O(n) time complexity.

Q2
Binary Tree Vertical Order Traversal
Data Structures & AlgorithmsMedium

Given the root of a binary tree, return the vertical order traversal of its nodes' values (i.e., from top to bottom, column by column). The specific variant discussed did not mention a specific order for colliding elements (elements in the same row and column). I was also asked to explain why BFS traversal might be preferred over DFS for this problem and to provide an example to prove it.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!