Find Critical Network Links Between AWS Availability Zones
Last updated: November 29, 2026
Quick Overview
Given n network nodes and undirected links between them, return every link whose removal would disconnect some pair of nodes (a bridge). The graph can have up to 100,000 nodes and links.
Amazon
November 29, 20260
0
0 solved
Given n network nodes and undirected links between them, return every link whose removal would disconnect some pair of nodes (a bridge). The graph can have up to 100,000 nodes and links.
An AWS networking flavored graph problem in the style of Amazon onsite rounds for infrastructure teams. The interviewer is looking for Tarjan's low-link algorithm in linear time, a correct treatment of the parent edge, and an iterative implementation that survives deep graphs.
What the Interviewer Expects
- Explain the brute force (remove each edge and test connectivity) and why it is O(E * (V + E))
- Define discovery time and low-link values
- State the bridge condition low[v] > disc[u]
- Skip only the parent edge, not all edges to the parent, to handle parallel links
- Use an iterative DFS to avoid recursion limits
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 critical nodes (articulation points) instead?
- How would you handle links being added and removed over time?
- How would you recommend the cheapest extra links to remove all 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
Nodes are 0 to n-1; links are pairs, may include parallel links (two cables between the same nodes are not bridges). Graph may be disconnected. Return bridges as sorted (min, max) pairs....
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 v, if `...