← Questions

Minimum root-to-leaf path sum

0
MetaTeslaCodingLast asked Aug 2026

A coding interview question asked in Meta's AI-enabled coding round and at Tesla, last asked Aug 2026. It tests binary tree, dfs and recursion.

Given the root of a binary tree whose nodes hold integers (values may be negative), find the root-to-leaf path with the smallest sum. A leaf is a node with no children.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Meta · AI-enabled coding · Last asked Aug 202660 min · Several progressive tasks on a starter codebase in CoderPad with an AI assistant panel; usually two rounds · The first task usually without AI, later tasks with it
  • Tesla

What it tests

binary tree · dfs · recursion

Your code and the AI tutor open when you unlock this question.