Network Delay Time

Medium · Graphs · about 25 minutes

Asked at Amazon, Cisco, Cloudflare, Google, Palantir, Qualcomm, Tesla, Uber, Zoom, Waymo, Broadcom, Arista Networks, Palo Alto Networks, Vercel, Anduril, Zscaler, Nutanix, Akamai.

Given a network of n nodes and directed weighted edges (u, v, time), a signal is sent from node k. Return how long it takes for all nodes to receive it, or -1 if some never do.

Related guides