Server Distances Avoiding Failed Servers and Their Radius
Asked at Google · Coding Questions · Difficulty: Medium · Last asked Nov 4, 2026
A data center is modelled as an undirected graph of servers, and every link has the same cost of one hop. Some servers have failed, and a failure also makes every server near it unusable. Compute how many hops it takes to get from a chosen starting server to every server that is still safe to reach.
Loading the problem…