FastPrepMaximum Value in a Binary Tree
Problems/Maximum Value in a Binary Tree

Maximum Value in a Binary Tree

Akuna Capital logoAkuna Capital● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report keeps the recursive goal and the case where all values are negative. It leaves out the function signature, examples and the number limits.

Our version is about 95% the same as the reported question.

Given the root of a nonempty binary tree, return the maximum value stored in any node.

Your implementation must handle trees whose values are all negative.

Function

findMaximumValue(root: TreeNode) → int

Examples

Example 1

root = [3,1,5,null,2,4,8]return = 8
root
312548

The largest node value is 8.

Example 2

root = [-8,-12,-3]return = -3
root
-8-12-3

All values are negative, so the least negative value is the maximum.

Constraints

  • The tree contains from 1 through 10^5 nodes.
  • -10^9 <= Node.val <= 10^9.

More Akuna Capital Phone Screen questions

  • Match Orders by Price and Arrival TimeOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Biased Coin: Probability of Exactly h HeadsPHONE SCREEN · Seen Nov 2026
  • Positive Nth Root with Gradient DescentPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Two SumOA · PHONE SCREEN · Seen Sep 2026
  • Tiered Expiring Item StorePHONE SCREEN · Seen Aug 2026
  • Statistics for the Latest K ValuesPHONE SCREEN · Seen Nov 2025
  • Remove Duplicates While Preserving OrderPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2025
  • Sliding Window MaximumPHONE SCREEN · Seen Oct 2025
  • Evaluate a PolynomialPHONE SCREEN · Seen Oct 2025
  • Reverse Nodes in Groups of KPHONE SCREEN · Seen Oct 2025

Similar questions at other companies

  • Balanced Binary TreeGoogle · PHONE SCREENGoogle 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

Akuna Capital interview experiences

  • Akuna Capital Quant Trader and QR Interviews: 5 Experiences
  • Akuna Capital JQR CodePair Rounds: 8 Experiences (Part 6 of 6)
  • Akuna Capital QR Probability Phones: 14 Experiences (Part 5 of 6)
  • Akuna Capital QR-ML Interviews: 11 Experiences (Part 4 of 6)
  • Akuna Capital QR Regression Rounds: 11 Experiences (Part 3 of 6)
  • Akuna Capital QR Coding Interviews: 17 Experiences (Part 2 of 6)
All Akuna Capital interview questionsSee Akuna Capital 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 int findMaximumValue(TreeNode root) {
        // write your code here
    }
}
Checking account…