PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Nuro

Find Maximum Path Sum in N-ary Tree

Last updated: May 2, 2026

Quick Overview

This question evaluates understanding of tree traversal and aggregation techniques, including handling of variable-arity nodes, negative values, and path-based dynamic programming on N-ary trees.

  • hard
  • Nuro
  • Coding & Algorithms
  • Machine Learning Engineer

Find Maximum Path Sum in N-ary Tree

Company: Nuro

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Technical Screen

You are given the root of an N-ary tree. Each node contains an integer value and a list of zero or more children. A path is a sequence of nodes where each adjacent pair is connected by an edge. The path may start and end at any two nodes in the tree, but it must not visit any node more than once. Return the maximum possible sum of node values along any path in the tree. Example: ```text 1 / | \ 2 3 4 / \ 5 -6 ``` One maximum-sum path is `5 -> 3 -> 1 -> 4`, with sum `13`. Constraints: - The tree contains at least one node. - Node values may be positive, zero, or negative. - Each node may have any number of children.

Quick Answer: This question evaluates understanding of tree traversal and aggregation techniques, including handling of variable-arity nodes, negative values, and path-based dynamic programming on N-ary trees.

Related Interview Questions

  • Parse logs and count error codes - Nuro (easy)
  • Group points by distance threshold - Nuro (medium)
  • Find gaps between intervals - Nuro (medium)
  • Implement BFS and a Job Scheduler - Nuro (hard)
Nuro logo
Nuro
Jan 30, 2026, 12:00 AM
Machine Learning Engineer
Technical Screen
Coding & Algorithms
0
0

You are given the root of an N-ary tree. Each node contains an integer value and a list of zero or more children.

A path is a sequence of nodes where each adjacent pair is connected by an edge. The path may start and end at any two nodes in the tree, but it must not visit any node more than once.

Return the maximum possible sum of node values along any path in the tree.

Example:

        1
      / | \
     2  3  4
       / \
      5  -6

One maximum-sum path is 5 -> 3 -> 1 -> 4, with sum 13.

Constraints:

  • The tree contains at least one node.
  • Node values may be positive, zero, or negative.
  • Each node may have any number of children.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Nuro•More Machine Learning Engineer•Nuro Machine Learning Engineer•Nuro Coding & Algorithms•Machine Learning Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.