JPMorgan Chase OA 2026 | Deadlock Detection in Directed Graphs & Minimum Partition Difference

Question · Posted Jun 2026

Problem 1 - System Deadlock Preemption (Graph Coloring DFS) Problem Statement An operating system manages N running processes numbered from 1 to N. You are given a directed dependency graph where: dependencies[i] = [u, v] indicates that process u is waiting for a resource currently held by process v. Determine whether the system is deadlocked by detecting the existence of a cycle in the dependency graph. Return true if a cycle exists; otherwise return false. Constraints Constraint 1 ≤ N ...

The full answer & interview discussion are available to premium members.

Log in Create a free account