Find Lowest Latency Routes Between Azure Regions
Last updated: November 29, 2026
Quick Overview
Given measured round-trip latencies between pairs of cloud regions, compute the lowest total latency from a source region to every other region and be able to return the route to any one of them.
Microsoft
November 29, 20260
0
0 solved
Given measured round-trip latencies between pairs of cloud regions, compute the lowest total latency from a source region to every other region and be able to return the route to any one of them.
Azure's backbone routes traffic between regions over a private WAN, and choosing relay paths by latency is a real concern for services like Front Door and Traffic Manager. Microsoft interviewers use this framing to check Dijkstra fluency, stale heap entry handling, and path reconstruction.
What the Interviewer Expects
- Identifies a weighted shortest path problem with non-negative weights
- Implements Dijkstra with a binary heap and skips stale entries
- Stores predecessors to reconstruct routes
- States O((V + E) log V) and compares with BFS and Bellman-Ford
- Handles unreachable regions explicitly
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Latencies change every few seconds: how would you keep routes fresh without recomputing from scratch for every source?
- Find the best route that uses at most two intermediate hops.
- Some links are metered: minimize cost subject to a latency budget.
- How would you compute all-pairs latencies for 60 regions, and which algorithm would you pick?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Links are bidirectional with non-negative millisecond weights. From one source, return the shortest latency to every reachable region and a way to get the path. Unreachable regions should be clearly a...
High-Level Design
Non-negative weights mean Dijkstra applies. Build an adjacency list, start a min-heap at (0, source), and repeatedly settle the closest unsettled region, relaxing its outgoing links. Instead of decr...