# Vertical Order Traversal Of A Binary Tree: Interview Notes

Vertical Order Traversal Of A Binary Tree is a common tree question in coding rounds. Below is how I talk through it in an interview setting.

## Key idea

Record (col, row, val) for every node via DFS, sort by column, then row, then value, and group by column.

## 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 log n).

## Common mistake

Ties in the same row and column must be sorted by value, unlike the simpler vertical order problem.

## 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 Linkjob AI interview assistant.