← Amazon questions

Maximum sum subtree which is also a BST

Filed under Amazon

Given a binary tree root, return the maximum sum of all keys of any sub-tree which is also a Binary Search Tree (BST). A BST is defined such that for every node, values in its left subtree are…

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

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