The Critical Connections in a Network interview question asks you to find all "bridges" in an undirected graph. A bridge is an edge that, if removed, would increase the number of connected components in the graph. In networking terms, these are the single points of failure where a single cable cut would disconnect parts of the network.
Microsoft and Amazon frequently ask this Hard graph coding problem to test a candidate's knowledge of advanced graph algorithms, specifically Tarjan’s Algorithm or Fleury’s Algorithm concepts. It evaluates your ability to use DFS to find cycles and identify edges that are not part of any cycle. It’s a classic test of technical depth in graph theory.
The problem is solved using a DFS-based Bridge Finding Algorithm (Tarjan's/Rank-based).
discoveryTime to store when each node was first visited.lowLink to store the lowest discoveryTime reachable from the node (excluding its parent edge).lowLink[v] > discoveryTime[u], then the edge is a critical connection (bridge).lowLink value less than or equal to the parent's discoveryTime indicates a back-edge exists, meaning there is a cycle and the edge is not a bridge.Nodes: 0-1, 1-2, 2-0, 1-3.
disc[0]=0.disc[1]=1.disc[2]=2.low[2] becomes 0.low[1] becomes 0.disc[3]=3.low[3] stays 3.low[3] (3) > disc[1] (1). Edge (1, 3) is a critical connection.lowLink update, which would incorrectly make every edge look like part of a cycle.Bridges and Articulation Points are common "Hard" graph topics. Memorizing the relationship between discovery times and low-link values is the key to solving almost all of them in linear time.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Find Closest Node to Given Two Nodes | Medium | Solve | |
| Maximum Employees to Be Invited to a Meeting | Hard | Solve | |
| Reconstruct Itinerary | Hard | Solve | |
| Valid Arrangement of Pairs | Hard | Solve | |
| Minimum Time to Break Locks II | Hard | Solve |