← Netflix Interview Insights

Netflix·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Apr 2026

Summary

Netflix coding interview for a software engineer role. One algorithmic problem, graph-based, with a twist on a classic problem I'd seen before but not quite in this form.

Questions Asked (1)

Q1

Given n tasks with dependencies between them and a unique completion time per task, find the minimum total time needed to finish all tasks.

Algorithms & Data Structures
Author's notes

Recognized it as a topological sort problem pretty fast, which felt good, but then I fumbled a bit because the variable completion times per task threw me off from the version I'd practiced.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the tasks as a directed acyclic graph (DAG) where edges represent dependencies. The minimum total time is the length of the longest path (critical path) in the DAG, which can be computed using topological sort and dynamic programming. If tasks can be parallelized, the answer is the critical path length; if not, it's the sum of all task times.

Pro tip: Clarify upfront whether tasks can be executed in parallel. If parallel execution is allowed, the problem reduces to finding the critical path; otherwise, it's simply the sum of all completion times. This distinction shows you understand the problem's constraints and avoids solving the wrong problem.

1. Clarify problem constraints

Ask whether tasks can be executed in parallel or must be sequential, and confirm that dependencies form a DAG (no cycles). This determines the solution approach.

2. Model as a graph

Represent tasks as nodes with weights equal to their completion times, and dependencies as directed edges. This transforms the problem into finding the longest path in a DAG.

3. Topological sort

Perform a topological sort to order tasks such that each task appears after its dependencies. This ensures we process tasks in a valid order for dynamic programming.

4. Dynamic programming for longest path

Process tasks in topological order, computing the earliest start time for each task as the maximum finish time of its dependencies. The answer is the maximum finish time across all tasks.

5. Analyze complexity and edge cases

State that the algorithm runs in O(V+E) time and O(V) space. Discuss edge cases like no dependencies, multiple independent chains, and disconnected components.

Key Points to Mention

  • Directed Acyclic Graph (DAG) representation of tasks and dependencies
  • Topological sorting to order tasks
  • Dynamic programming to compute earliest start/finish times
  • Critical path as the longest path in the DAG
  • Time complexity: O(V+E) for topological sort and DP
  • Handling of parallel vs sequential execution assumptions

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.