Leetcode 536. Construct Binary Tree from String
Reconstruct a binary tree from its preorder string representation where node values are integers and left/right children are given as parenthesized substrings (e.g., "4(2(3)(1))(6(5))"); parse nested parentheses and multi-digit/negative numbers and attach subtrees appropriately using recursion or a stack.
Asked at:MoEngage
M
SpaceX
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Early August, 2026
M
Mid-level
Instead of numbers it was like "Rocket(phase_1,phase_2)"
Early June, 2026
SpaceX
Mid-level
Late April, 2026
M
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.