Meta | Facebook | Technical (Phone) Screen | Mid level Software Engineer (Java) | USA
Anonymous User
1329

Just got done with my first Technical screen in Meta for Menlo Park, California location. I was asked two questions:

  1. Find the minimum element in each level of a Binary Tree. Similar to
    LC102. Binary Tree Level Order Traversal, but just need to keep track of the minimum element in each level.
    Follow-up: What if we have to do this in O(log n) space?

  2. Write a Sorted List Iterator that will have the following functions:

    • public boolean hasNext() that would return true if a next element exists or false otherwise
    • public boolean next()that will return the minimum element from a list of k sorted lists.

    Seemed like a mix of :
    https://leetcode.com/problems/merge-k-sorted-lists/description/ - but I was given a List<List<Integer>> lists not linked lists and the question mentioned in this post: https://leetcode.com/discuss/post/352704/airbnb-iterator-over-list-of-lists-by-la-g961/

Comments (2)