Find Network Links Whose Failure Would Split the Cluster
Last updated: November 29, 2026
Quick Overview
Given n servers and undirected network links, return every link whose removal would disconnect some pair of servers that were previously connected (the bridges of the graph).
Meta
November 29, 20260
0
0 solved
Given n servers and undirected network links, return every link whose removal would disconnect some pair of servers that were previously connected (the bridges of the graph).
Bridge finding with Tarjan's low-link values is in the style of Meta's hardest onsite graph problems, framed around reliability reviews of data center network topology. The interviewer checks that you can define discovery time and low-link precisely and implement the DFS without hitting recursion limits.
What the Interviewer Expects
- Rejects removing each edge and re-checking connectivity as O(E * (V + E))
- Defines discovery time and low-link values
- States the bridge condition low[v] > disc[u] for tree edge u-v
- Skips only the parent edge, handling parallel links correctly
- Implements iterative DFS or raises the recursion limit consciously
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
- How would you find articulation points (servers whose failure splits the cluster)?
- How would you suggest the fewest links to add so no bridge remains?
- How do parallel links between the same pair change the answer?
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 and links as [u, v]. Output: list of bridge links, any order. The graph may be disconnected and may contain parallel links. n up to 10^5, links up to 10^5....
High-Level Design
Run DFS, assigning each node a discovery time disc. low[u] is the smallest discovery time reachable from u's subtree using tree edges down and at most one back edge up. For a tree edge u to child ...