PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

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.

  • medium
  • Meta
  • Coding & Algorithms
  • Machine Learning Engineer

Solve Merge Lists and Vertical Traversal

Company: Meta

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Two coding tasks were mentioned for a 40-minute round: 1. **Merge multiple sorted linked lists**: You are given an array of `k` singly linked lists, where each list is sorted in nondecreasing order. Merge all of them into one sorted linked list and return the head of the merged list. 2. **Vertical traversal of a binary tree**: You are given the root of a binary tree. Group nodes by their vertical column index, from the leftmost column to the rightmost column. Within each column, output nodes from top to bottom. If two nodes share the same row and column, preserve their left-to-right order as seen in a standard breadth-first traversal.

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

Input linked lists are represented as sorted Python lists. Return the merged sorted values.

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

  1. Clarify edge cases before coding.
  2. Keep the return value deterministic.

Vertical Traversal Of Binary Tree

Trees are [value,left,right]. Return column groups from left to right using BFS order within each column.

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

  1. Clarify edge cases before coding.
  2. Keep the return value deterministic.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Find Shortest Unique Prefixes - Meta (medium)
  • Compute Exclusive Execution Times - Meta (medium)
  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve Tree Diameter and Palindromic Counts - Meta (medium)
  • Simulate Monster Team Battles - Meta (hard)