FastPrepBalanced Binary Tree
Problems/Balanced Binary Tree

Balanced Binary Tree

Google logoGoogle● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: An interview report names this well-known problem, Balanced Binary Tree. Our version uses the usual height-balance rule exactly.

Given the root of a binary tree, determine whether it is height-balanced.

A binary tree is height-balanced when, at every node, the heights of the left and right subtrees differ by at most one.

Function

isBalanced(root: TreeNode) → boolean

Examples

Example 1

root = [3,9,20,null,null,15,7]return = true
root
3920157

Every node's two subtree heights differ by at most one.

Example 2

root = [1,2,2,3,3,null,null,4,4]return = false
root
1234432

The left side contains a node whose subtree heights differ by more than one.

Example 3

root = []return = true
root
empty

An empty tree is height-balanced.

Constraints

  • The tree contains from 0 to 5000 nodes.
  • -10000 <= node.val <= 10000.

More Google Phone Screen questions

  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Periodic-Color Binary Forest RootsPHONE SCREEN · Seen Nov 2026
  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Word Chain Jumps in a GridPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • Course Schedule Cycle DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Maximum Value in a Binary TreeAkuna Capital · PHONE SCREENAkuna Capital interview questions
  • Maximum Root-to-Leaf Sum in a BSTZillow · PHONE SCREENZillow interview questions
  • Binary Tree Target-Sum PathsByteDance · PHONE SCREENByteDance interview questions
  • Count Uni-Valued SubtreesAmazon · PHONE SCREEN
  • Validate Binary Search TreeLyft · PHONE SCREENLyft interview questions
  • Check Whether a Tree Is a Sum TreeAdobe · PHONE SCREENAdobe interview questions
  • Height-Balanced Binary TreeExpedia · ONSITE INTERVIEWExpedia interview questions
  • Sum Root-to-Leaf NumbersMeta · ONSITE INTERVIEWMeta interview questions
  • Binary Tree Maximum Path SumGoldman Sachs · ONSITE INTERVIEWGoldman Sachs interview questions
  • Balanced Tree Node ReportNetflix · ONSITE INTERVIEWNetflix interview questions

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
Saved
/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode() {}
 *     TreeNode(int val) { this.val = val; }
 *     TreeNode(int val, TreeNode left, TreeNode right) {
 *         this.val = val;
 *         this.left = left;
 *         this.right = right;
 *     }
 * }
 */
class Solution {
    public boolean isBalanced(TreeNode root) {
        // Write your code here.
    }
}
Checking account…