Twilio OA Question 2024 August | Trees | on-campus

Question · Posted Jun 2026

Question: Symmetric Tree Problem Statement Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Constraints The number of nodes in the tree is in the range [1, 1000]. -100 <= Node.val <= 100 Examples Example 1: Input: root = [1,2,2,3,4,4,3] Output: true Explanation 1: The tree is symmetric. The left subtree (2→3,4) mirrors the right subtree (2→4,3). Root 1's left child equals its right child (2==2), left-left equals right-right ...

The full answer & interview discussion are available to premium members.

Log in Create a free account