← Questions

Validate a binary search tree

0
AmazonAppleCodingLast asked Oct 2026

A coding interview question asked in Apple's technical phone screen and at Amazon, last asked Oct 2026. It tests trees, binary search tree and recursion.

Decide whether a binary tree is a valid binary search tree: for every node, every value in its left subtree is strictly smaller and every value in its right subtree is strictly larger. Duplicates make the tree invalid.

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 · Technical phone screen · Last asked Oct 2026
  • Amazon · Technical phone screen · Last asked Apr 202660 min · Live coding in a shared editor that does not run code, plus Leadership Principles questions · No AI

What it tests

trees · binary search tree · recursion

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