Solve Merge Lists and Vertical Traversal
Company: Meta
Role: Machine Learning Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: This question evaluates proficiency with merging sorted linked lists and performing vertical traversal of binary trees, focusing on algorithms, data structure manipulation, and complexity analysis within the Coding & Algorithms domain.
Merge K Sorted Lists
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([[1,4,5],[1,3,4],[2,6]],)
Expected Output: [1, 1, 2, 3, 4, 4, 5, 6]
Explanation: Merge k sorted lists.
Input: ([[], [1]],)
Expected Output: [1]
Explanation: Empty lists are ignored.
Hints
- Clarify edge cases before coding.
- Keep the return value deterministic.
Vertical Traversal Of Binary Tree
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([3,[9,None,None],[20,[15,None,None],[7,None,None]]],)
Expected Output: [[9], [3, 15], [20], [7]]
Explanation: Vertical traversal groups columns left to right.
Input: (None,)
Expected Output: []
Explanation: Empty tree returns empty list.
Hints
- Clarify edge cases before coding.
- Keep the return value deterministic.