dsa8 min read
Longest Path in a DAG — Graph DP With Topological Sort + Memoised DFS [Google, Amazon, Meta]
Master longest path in a directed acyclic graph (DAG): a polynomial-time graph-DP that combines topological sort with memoised DFS. The same template solves LeetCode 329 Longest Increasing Path, course planning with prerequisites, and critical-path scheduling — a FAANG interview pattern at Google, Amazon, and Meta.
Read →