Quick Overview

Filter an n-ary tree by removing every node whose value contains a substring along with its full descendant subtree. Validate the flat index representation, preserve child order, reindex survivors in preorder, and avoid recursion limits on deep trees.

Filter Matching Subtrees from an N-Ary Tree

Company: Waymo

Role: Frontend Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Filter an n-ary tree by removing every node whose value contains a substring along with its full descendant subtree. Validate the flat index representation, preserve child order, reindex survivors in preorder, and avoid recursion limits on deep trees.

Read the full Waymo Frontend Engineer interview experience this question came from

Loading…