modular·Software Engineer·Technical Phone Screen
- Given a directed acyclic graph of tasks where each task has a name, a list of prerequisite tasks, and a duration, write a function that returns the critical path value (the maximum total duration along any dependency chain) and one corresponding ordered list of task names on that longest path.
“This is basically topological sort plus dynamic programming once you see it clearly, but I spent a few minutes fumbling around trying to think about it as a pure DFS before remembering you can just compute earliest completion times in topo order.”