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
Coding & Algorithms
Software Engineer
Meta
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

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
Dijkstra
Heap
Shortest path
Graphs
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported