Compute graph distance and impacted services | LinkedIn Interview Question