Time for a Config Push to Reach Every Server in the Fleet
Last updated: November 29, 2026
Quick Overview
A config change starts at one server and is forwarded along directed links, each with a delivery delay in milliseconds. Return the time until every server has the change, or -1 if some server never receives it.
Meta
November 29, 20260
0
0 solved
A config change starts at one server and is forwarded along directed links, each with a delivery delay in milliseconds. Return the time until every server has the change, or -1 if some server never receives it.
A weighted shortest-path question in the style of a Meta technical screen, framed around how configuration updates propagate across a fleet of servers. The interviewer checks that you reach for Dijkstra with a heap, skip stale heap entries, and take the max of the shortest distances.
What the Interviewer Expects
- Recognizes single-source shortest paths with non-negative weights
- Implements Dijkstra with a min-heap and stale-entry skipping
- Takes the maximum of all shortest distances as the answer
- Returns -1 if any server is unreachable
- States O(E log V) complexity
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
- Which server receives it last, and along what path?
- How does the answer change if delays can be negative?
- If pushes start from several servers at once, what changes?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: n servers labeled 1..n, links as (u, v, delay) directed with delay >= 0, and source. Output: max over servers of earliest receive time, or -1 if any is unreachable. n up to 10^4, links ...
High-Level Design
Every server receives the change at the length of its shortest path from the source, so compute single-source shortest paths and return the maximum. With non-negative delays, Dijkstra applies: pop the...