← Goldman Sachs questions
CodingReported in a candidate post, Mar 2025

Count Good Nodes in Binary Tree

Filed under Goldman Sachs · Also reported at SAP

Given the root of a binary tree, a node X is good if on the path from the root to X there is no node with a value greater than X. Return the number of good nodes in the tree. The root is always good.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.