The Snowflake process included two approximately one-hour online coding rounds using a runnable editor, with AI assistance not allowed. The first round contained two related N-ary tree problems involving node deletion and tree height. The second focused on detecting whether a newly placed piece creates a Connect Four. Both rounds also included project or behavioral discussion, test-case walkthroughs, and complexity analysis.
Interview Details
Round 1 — Coding 1: Tree Height After Deleting Nodes
You are given an N-ary tree and a collection of nodes to delete. Deleting a node does not remove its entire subtree. Instead, the deleted node disappears and all of its children are promoted to become children of its parent.
For example, suppose the original tree is:
10
/ \
20 30
/ \
40 50
|
60
10
/ \
20 30
/ \
40 50
|
60
After deleting node 30, the tree behaves as if it became:
10
/ | \
20 40 50
|
60
10
/ | \
20 40 50
|
60
The resulting height is 3 corresponding to a path such as 10 -> 50 -> 60
The following requirements were clarified during the interview:
The structure is an N-ary tree rather than a binary tree.
Multiple nodes may be deleted in one call.
Node values are unique.
The root cannot be deleted.
Height is measured by the number of nodes on the path.
A tree containing only the root has height 1.
Only the resulting height needs to be returned; the modified tree itself does not need to be returned.
The interviewer required runnable code, additional test cases, and time/space complexity
Unlock Full Details
Create a free account to unlock this interview experience report.