This problem teaches you to decompose a tree check into functions: one that walks every node, and one that compares trees for exact equality. The outer function asks "does the subtree rooted here match?" at every node.
You'll get comfortable writing recursive helpers that work together. Amazon asks tree problems frequently because their services form tree-like hierarchies, and engineers need to reason about recursive structures daily. If you can write clean tree recursion here, you'll handle harder variants too.