PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Meta

Solve tree traversal and interval merging tasks

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithmic problem-solving and data-structure competency, focusing on binary tree traversal and column-wise ordering (including BFS versus DFS trade-offs) as well as interval merging and sorting strategies for scheduling.

  • Medium
  • Meta
  • Coding & Algorithms
  • Software Engineer

Solve tree traversal and interval merging tasks

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Part A — Column-wise Binary Tree Grouping: You are given the root of a binary tree. Group nodes by vertical column index, where the root has column 0, the left child of a node at column c has column c−1, and the right child has column c+1. Within each column, list nodes from top to bottom; for nodes that share the same row and column, order them from left to right. Return a list of columns from leftmost to rightmost, each containing the ordered node values. Explain and compare BFS versus DFS for this task (ordering guarantees, memory usage, recursion depth), state which you would implement and why, and analyze time and space complexity. Discuss edge cases such as skewed trees and very deep trees. Part B — Merge Meeting Time Ranges: You are given a list of half-open intervals [start, end) representing meeting times during a day. Merge all overlapping or touching intervals and return the condensed schedule sorted by start time. Describe an O(n log n) approach for unsorted input and a single-pass O(n) approach if the input is already sorted by start. Specify the data structures you will use, how you handle zero-length intervals and endpoint inclusivity/exclusivity, and provide time and space complexity.

Quick Answer: This question evaluates algorithmic problem-solving and data-structure competency, focusing on binary tree traversal and column-wise ordering (including BFS versus DFS trade-offs) as well as interval merging and sorting strategies for scheduling.

Related Interview Questions

  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve Tree Diameter and Palindromic Counts - Meta (medium)
  • Simulate Monster Team Battles - Meta (hard)
  • Solve a Key-Door Corridor Maze - Meta (medium)
  • Solve Array Merge and Parentheses Cleanup - Meta (medium)
Meta logo
Meta
Aug 13, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
3
0

Part A — Column-wise Binary Tree Grouping: You are given the root of a binary tree. Group nodes by vertical column index, where the root has column 0, the left child of a node at column c has column c−1, and the right child has column c+1. Within each column, list nodes from top to bottom; for nodes that share the same row and column, order them from left to right. Return a list of columns from leftmost to rightmost, each containing the ordered node values. Explain and compare BFS versus DFS for this task (ordering guarantees, memory usage, recursion depth), state which you would implement and why, and analyze time and space complexity. Discuss edge cases such as skewed trees and very deep trees.

Part B — Merge Meeting Time Ranges: You are given a list of half-open intervals [start, end) representing meeting times during a day. Merge all overlapping or touching intervals and return the condensed schedule sorted by start time. Describe an O(n log n) approach for unsorted input and a single-pass O(n) approach if the input is already sorted by start. Specify the data structures you will use, how you handle zero-length intervals and endpoint inclusivity/exclusivity, and provide time and space complexity.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Software Engineer•Meta Software Engineer•Meta Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ 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
  • Compare Platforms
  • Discord Community

Support

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

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.