# Lowest Common Ancestor Of A Binary Tree II: Study Guide
Lowest Common Ancestor Of A Binary Tree II shows up often in coding rounds. Here is how I talk through it when the interviewer is watching.
## Key idea
p and q may not exist in the tree; return their LCA or null. A DFS returns a triple (found_p, found_q, node). Only emit the candidate LCA if both flags are true at the root of that subtree. Alternatively search to confirm both nodes exist, then run the classic LCA.
## Steps to say out loud
1. Restate the input and the exact ask, and nail down constraints and overflow.
2. Name the pattern (binary search on the answer, monotonic stack or deque, interval / interval-DP, string hashing, graph traversal, or shortest paths) and why a nested scan or naive search fails.
3. Code it, then trace a short example plus one empty or already-solved edge case.
## Complexity
O(n).
## Common mistake
Using the standard LCA that assumes both nodes exist, which can return a wrong non-null answer when one node is missing.
## Practice tip
Time yourself: two minutes to explain, ten to code, three to test edges. Disclosure: I work on Linkjob AI. I also keep a practice cheat sheet at AI coding interview assistant.