← Questions

Vertical order traversal of a binary tree

0
AppleAmazonUberCodingLast asked Jun 2026

A coding interview question asked in Apple's coding round and at Uber and Amazon, last asked Jun 2026. It tests trees, bfs and sorting.

Give every node of a binary tree a position: the root is at row 0, column 0; a node's left child is one row down and one column left, its right child one row down and one column right. Return the node values grouped by column, from the…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Apple · Coding · Last asked Jun 2026
  • Uber · Coding · Last asked Feb 202660 min · Two rounds; one is often object-oriented design (a parking lot, a meeting scheduler, an expression evaluator) · No AI, except a newer AI-assisted debugging round in some senior loops
  • Amazon · Coding · Last asked Jan 202655 min · Usually two rounds; one is often an object-oriented design built in steps · No AI

What it tests

trees · bfs · sorting

Your code and the AI tutor open when you unlock this question.