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 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.
Send them this page. It is free to read, no account needed.
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.