# Pseudo Palindromic Paths In A Binary Tree: Walkthrough

Pseudo Palindromic Paths In A Binary Tree is a common tree question in coding rounds. Below is how I talk through it in an interview setting.

## Key idea

DFS carrying a 9-bit parity mask; a leaf path is valid when the mask has at most one bit set (mask & (mask-1) == 0).

## Steps to say out loud

1. Restate the input and output, and ask about empty trees and duplicate values.
2. Name the traversal (DFS or BFS) and what each call returns.
3. Code it, then trace a three-node example by hand.

## Complexity

O(n) time, O(h) space.

## Common mistake

Checking at null children instead of true leaves double-counts.

## Practice tip

Time yourself: two minutes to explain, ten to code, three to test edge cases. Disclosure: I work on Linkjob AI. I also keep a practice cheat sheet at the Linkjob AI app.