Home
/
Questions
/
Coding
/
Shortest-path depth from node 1
caseSQL
Coding question · Self Join Pairs
Very Hard
Asked at Palantir
Shortest-path depth from node 1
BFS shortest-path via recursive CTE + MIN aggregation.
Unlock with Pro
→
Back to all coding questions
The Brief
← Previous
Every node reachable from node 1