← Netflix Interview Insights

Netflix·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

Netflix SWE interview with a graph scheduling problem that looked like a simple topological sort until it wasn't. The cycle detection piece caught me a bit off guard and the follow-up on returning per-task finish times added more bookkeeping than I expected.

Questions Asked (1)

Q1

Given n tasks with durations and prerequisite dependencies, compute the earliest finish time for each task and the minimum total time to complete all tasks. If the dependency graph has a cycle, return an error.

Algorithms & Data StructuresSystem Design
Author's notes

I went straight to topological sort, which was the right instinct, but I fumbled the part where multiple prerequisites feed into one task.

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. Use topological sorting to detect cycles and compute earliest finish times in linear time, then take the maximum finish time as the minimum total time.

Pro tip: Explicitly discuss how you would handle large-scale dependencies and parallel execution, as Netflix values scalability and efficiency in distributed systems.

1. Model the problem as a graph

Represent tasks as nodes and dependencies as directed edges. Clarify that a cycle indicates invalid dependencies.

2. Detect cycles and compute topological order

Use Kahn's algorithm or DFS to detect cycles and produce a topological ordering of tasks.

3. Compute earliest finish times

Process tasks in topological order, setting each task's earliest start as the max finish time of its prerequisites, then add its duration.

4. Determine minimum total time

The minimum total time is the maximum earliest finish time across all tasks, assuming unlimited parallelism.

5. Analyze complexity and edge cases

Discuss O(V+E) time and space complexity, and handle edge cases like empty input, single task, or disconnected components.

Key Points to Mention

  • Topological sorting for dependency resolution and cycle detection
  • Earliest finish time computation using dynamic programming on DAG
  • Time and space complexity: O(V+E) where V is number of tasks and E is number of dependencies
  • Handling cycles by returning an error (e.g., using DFS with recursion stack or Kahn's algorithm)
  • Assumption of unlimited parallelism for minimum total time
  • Potential for parallel execution and scalability considerations

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