Find Network Links Whose Failure Would Partition the Cluster
Last updated: November 29, 2026
Quick Overview
Given n servers and undirected links between them, return every link whose removal would disconnect some pair of servers that are currently connected.
0
0
0 solved
Given n servers and undirected links between them, return every link whose removal would disconnect some pair of servers that are currently connected.
Framed around reliability planning for Google's backbone network, this asks for bridges in a graph. The interviewer is checking whether you know Tarjan's low-link technique, can explain discovery time versus low value, and handle parallel links correctly.
What the Interviewer Expects
- Rejects remove-each-edge-and-test as O(E * (V + E))
- Runs a single DFS recording discovery times and low-links
- Identifies edge (u, v) as a bridge when low[v] > disc[u]
- Skips only the specific parent edge so parallel edges are handled
- Uses an iterative DFS or notes recursion limits on large graphs
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Find articulation points (servers whose failure partitions the network).
- Links are added over time; maintain the bridge set incrementally.
- Which single extra link would remove the most bridges?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
- Input: n nodes 0..n-1, list of undirected edges, possibly parallel, graph possibly disconnected.
- Output: list of bridge edges in any order.
- n and E up to around 10^5, so linear time is expected....
High-Level Design
DFS assigns each node a discovery time disc[u]. low[u] is the smallest discovery time reachable from u's DFS subtree using tree edges downward plus at most one back edge. When DFS finishes child v...