Reported October 2026
DocuSigntree

Symmetric Binary Tree

Reported by candidates from DocuSign's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live DocuSign OA. Under 2s to a working solution.
Founder's read

The DocuSign OA reported in October 2026 hands you a tree with up to 10^5 nodes and asks if it mirrors itself. That size kills anything that rebuilds or serializes subtrees repeatedly. You need one clean pass, O(n). It's the classic Symmetric Binary Tree, a tree problem where the whole game is comparing two nodes at once instead of one. If you've seen it, you'll finish in minutes. If you blank under the timer, StealthCoder runs invisibly on your screen and can hand you the working solution as a safety net. Know the trick first, though.

The problem

Given the root of a binary tree, return true when the tree is symmetric around its center and false otherwise.
Two subtrees mirror each other when their root values are equal, the left subtree of one mirrors the right subtree of the other, and the right subtree of one mirrors the left subtree of the other.

Function
isSymmetric(root: TreeNode) → boolean

Examples
Example 1
root = [1,2,2,3,4,4,3]
return = true
The left and right subtrees have equal values in mirrored positions.
Example 2
root = [1,2,2,null,3,null,3]
return = false
The two nodes with value 3 occupy matching sides rather than mirrored sides.
Example 3
root = []
return = true
An empty tree has no mismatched mirrored pair.

Constraints
The tree contains at most 10^5 nodes.
Each node value fits in a signed 32-bit integer.
The empty tree is symmetric.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick: don't recurse on a single node. Write a helper isMirror(a, b). Both null returns true. One null returns false. Values differ returns false. Otherwise return isMirror(a.left, b.right) and isMirror(a.right, b.left). Call it with root.left and root.right. Handle the empty tree up front, since the problem says it's symmetric. The common pitfall is comparing left to left and right to right, which checks equality, not mirroring. Example 2 trips that exactly. With 10^5 nodes, a skewed tree can blow the recursion stack in some languages, so an iterative version with a queue or stack of node pairs is the safer choice. Push pairs in mirrored order and pop two at a time. If you freeze on the pairing logic during the live OA, StealthCoder is the hedge that gives you the iterative version fast. Either way it's O(n) time.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Symmetric Binary Tree cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as symmetric tree. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass DocuSign's OA.

DocuSign reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Symmetric Binary Tree FAQ

How hard is the DocuSign symmetric tree question really?+

It's easy. It's a well-known tree problem and the whole solution is one helper with two pointers walking mirrored paths. The only real risk is mixing up the child pairing, so test Example 2 mentally before you submit.

What's the trick to solving it?+

Compare two nodes at a time. Match a.left with b.right and a.right with b.left. Start with root.left and root.right. Treat both-null as true and one-null as false. Everything else is a value check plus two recursive calls.

Should I use recursion or iteration with 10^5 nodes?+

Recursion works if the tree is balanced, but a skewed tree with 10^5 nodes can overflow the stack in some languages. Iteration with a queue of node pairs avoids that risk. Both are O(n) time, so pick the one you can write without bugs.

What edge cases should I test?+

Test the empty tree, which returns true. Test a single node, also true. Test a tree where shapes mirror but values differ, and one where values match but shape doesn't, like Example 2. Also negative and large 32-bit values, which compare fine with plain equality.

How do I prepare in 48 hours?+

Write the recursive version from scratch twice, then the iterative pair-queue version once. Then do two or three nearby tree problems like same tree and invert tree. The mirrored-pair pattern shows up in all of them, so it's a fast win.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with DocuSign.

OA at DocuSign?
Invisible during screen share
Get it