AO
Back

Shortest Path in Tree Network Visiting All Task Nodes

OAAsync OALast reported November 2025Low Frequency

Problem Overview

Given a start point, end point, and task nodes in a tree network, find the minimum time to start from start point, visit all task nodes, and reach the endpoint. Solution: construct minimum spanning subtree, calculate 2× sum of all edges minus distance from start to end.

What Reports Emphasize

What passers do: Recognized the minimum spanning subtree construction: include only the start, end, and task nodes, then compute 2× the sum of all edges in that subtree minus the direct distance from start to end (the one segment that only needs to be traversed once).; Implemented the solution using DFS in O(n) time, computing edge sums and the start-to-end distance in a single pass.

Prepping for OpenAI with friends?

Send them this page. It is free to read, no account needed.

More OpenAI Questions

Free preview

Every question in the OpenAI catalog gets this depth

What you just read — canonical solution, follow-up arc, what passing candidates actually did — exists for all 91 OpenAI questions, refreshed monthly from new candidate reports.

$59/mo — or $50/mo with the 3-month pass · cancel anytime
OpenAI · OA · Reported 1× across candidate reports
Is this helpful?