← Microsoft questions
CodingEasy

Maximum depth of leaf with target path sum

Filed under Microsoft

Given the root of a binary tree and an integer N, find the maximum depth of a leaf node such that the sum of all node values on the path from the root to that leaf equals N. If no such path exists…

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 Microsoft questions

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