MEDIUMasked at 2 companies

Redundant Connection

A medium-tier problem at 66% community acceptance, tagged with Depth-First Search, Breadth-First Search, Union Find. Reported in interviews at InMobi and 1 others.

Founder's read

You're in an OA and hit Redundant Connection. It looks like a simple graph problem, but the trick isn't obvious without seeing the pattern first. Given a list of edges that form a tree plus one extra edge, you need to return that extra edge. InMobi and Box ask this one. The acceptance rate sits at 66%, which means a third of candidates either miss the cycle detection trick or pick the wrong edge when multiple cycles exist. If you freeze on the live assessment, StealthCoder surfaces the right edge in seconds, invisible to the proctor. No need to reinvent Union Find under pressure.

Companies asking
2
Difficulty
MEDIUM
Acceptance
66%

Companies that ask "Redundant Connection"

If this hits your live OA

Redundant Connection is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.

Get StealthCoder
What this means

The trap: you can detect a cycle, but which edge caused it? A naive DFS or BFS finds a cycle, yet you might remove the wrong edge and still have a cycle left. The real solution uses Union Find to build the graph incrementally. When you try to union two nodes already in the same set, that edge is redundant. Why this matters: candidates often code a cycle detector and return the first cycle edge they find, not the last one added (which is what the problem wants). The optimal path avoids backtracking through the entire graph repeatedly. When you hit this live and your first instinct stalls, StealthCoder handles the Union Find boilerplate and edge case logic without manual tracing. It's the safety net for the one pattern you didn't drill.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Redundant Connection recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Redundant Connection interview FAQ

Is Redundant Connection still asked at Box and InMobi?+

Yes. Both companies appear in the report data for this problem. Acceptance rate is 66%, so it's not rare but not trivial either. If you're interviewing there, this is high-probability prep. It tests Union Find fluency, which is a hard-earned skill most candidates skip.

What's the trick if there are multiple valid redundant edges?+

The problem asks for the last edge in input order that creates a cycle. A naive cycle detector returns the first cycle edge found. Union Find naturally gives you the last one because you process edges sequentially and stop at the first union that fails. That's why Union Find beats DFS here.

How does this relate to Depth-First Search and Breadth-First Search?+

DFS and BFS both detect cycles, but neither tells you which edge to remove. Union Find does both detection and identification in one pass. DFS requires backtracking and careful parent tracking. Union Find is cleaner for this specific problem shape.

Can I solve this without Union Find?+

Yes, but it's slower. DFS with parent tracking works if you iterate through edges and test removal. You'll TLE or timeout on large inputs, or pick the wrong edge. Union Find is O(n) with near-constant per-union cost. It's the intended solution.

How hard is Redundant Connection really?+

Medium difficulty is honest. It's not a one-liner, but it's not a nested DP nightmare either. The hard part is knowing Union Find exists and writing it correctly under pressure. If Union Find is in your toolkit, it's a 5-minute problem. If it isn't, you're guessing at cycle detection logic.

Want the actual problem statement? View "Redundant Connection" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.