Reported September 2026
Odootree

Same Binary Tree

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

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

The detail that matters in this Odoo OA, reported September 2026, is the line saying trailing missing-child markers may be omitted. That one sentence is why a naive array compare fails. Two level-order string arrays go in, and you return whether they describe the same tree with equal values. It's the classic Same Tree problem wearing a serialization costume, and the tree pattern is the whole game. If you blank on the parsing step during the live OA, StealthCoder sits invisibly on your screen as a safety net and hands you a working solution.

The problem

Two binary trees are serialized in level order. Each node value is a string and # marks a missing child. Trailing missing-child markers may be omitted.
Return whether the two serializations describe identical structure and equal values.

Function
isSameTree(firstLevelOrder: String[], secondLevelOrder: String[]) → boolean

Examples
Example 1
firstLevelOrder = ["1","2","3"]
secondLevelOrder = ["1","2","3"]
return = true
Case 1 exercises the documented deterministic contract.
Example 2
firstLevelOrder = ["1","2"]
secondLevelOrder = ["1","#","2"]
return = false
Case 2 exercises the documented deterministic contract.
Example 3
firstLevelOrder = []
secondLevelOrder = []
return = true
Case 3 exercises the documented deterministic contract.

Constraints
0 <= firstLevelOrder.length, secondLevelOrder.length <= 200000.
Node values never equal #.
Each serialization is structurally valid.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick: don't compare the arrays directly, because trailing # markers can be dropped and arrays of different length can still be the same tree. Example 2 shows the flip side, where ["1","2"] and ["1","#","2"] differ because the 2 sits in a different slot. Rebuild each tree with a queue. Walk the array with an index, and for each dequeued node, read the next two entries as its left and right children. Treat an index past the end as #. Then compare the two rebuilt trees, or skip building and run both parsers in lockstep. With up to 200000 entries, avoid recursion on deep trees, since a skewed tree can blow the stack. Use an iterative queue or stack. The empty-versus-empty case must return true. If you freeze on the pointer bookkeeping during the live OA, StealthCoder is the hedge that gets you unstuck.

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 Same 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 same tree. If you have time before the OA, drill that.

⏵ The honest play

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

Odoo 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.

Same Binary Tree FAQ

What's the trick in the Odoo Same Binary Tree question?+

Trailing # markers may be omitted, so raw array equality is wrong. Rebuild each tree from level order using a queue, treating any index past the end as #. Then compare structure and values node by node. That handles different-length arrays that describe the same tree.

How hard is this one really?+

Easy to medium. The comparison is the classic Same Tree problem. The only real work is parsing level order with omitted trailing markers, which is a short queue loop. Most failures come from off-by-one indexing, not from the algorithm.

Should I use recursion or iteration?+

Iteration. Inputs reach 200000 entries, so a skewed tree can make recursive comparison overflow the stack. Build with a queue and compare with an explicit stack or queue of node pairs. It's barely more code and removes the risk.

What edge cases should I test before submitting?+

Test two empty arrays, which must return true. Test one empty and one non-empty, which is false. Test the shifted-child case from Example 2. Test arrays with different trailing # counts describing the same tree. Also test a single node and a fully skewed tree.

How do I prepare in 48 hours?+

Write Same Tree and level-order deserialization once each from scratch. Practice the queue-with-index pattern until it's automatic. Then combine them on a few small arrays by hand. That covers this question and most tree-serialization variants you'd see.

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

OA at Odoo?
Invisible during screen share
Get it