Code Room
CodingHardcod-g741
Subject Union findLevel Senior–Staff~35 minCommon in Algorithms & data structures interviewsIndustries Software development, Telecom

Question

A network has n nodes (0..n-1) and a set of undirected `edges` `[u, v]`. Links fail one at a time in the order given by `removals` (each removal is one of the existing edges). After each removal, report whether the two endpoints of the just-removed link are still connected through the surviving network. Return a list of booleans, one per removal, in order.

Implement
connectivity_after_removals(n: int, edges: list[list[int]], removals: list[list[int]]) → list[bool]
Examples
in[4,[[0,1],[1,2],[2,0],[2,3]],[[0,1],[2,3]]]out[true,false]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.