Earliest Time a Config Rollout Reaches Every Serving Region

Last updated: November 29, 2026

Quick Overview

A configuration change starts at one origin region and is relayed along directed links that each take a known number of milliseconds. Return the time at which every region has received it (and each region's arrival time), or -1 if some region is unreachable.

OpenAI
Coding & Algorithms
Software Engineer
OpenAI
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


A configuration change starts at one origin region and is relayed along directed links that each take a known number of milliseconds. Return the time at which every region has received it (and each region's arrival time), or -1 if some region is unreachable.

OpenAI pushes configuration such as model routing and safety settings to serving regions worldwide, and knowing the worst-case propagation time matters during incidents. This is single-source shortest paths; the interviewer wants Dijkstra with a heap, correct handling of stale heap entries, and a clear unreachable result.

What the Interviewer Expects
  • Recognize single-source shortest paths with non-negative weights
  • Implement Dijkstra with a binary heap and skip stale entries
  • Return the maximum arrival time as the answer
  • Detect unreachable regions
  • Explain why BFS is not enough with weighted links
Key Topics to Cover
Dijkstra
shortest paths
heaps
weighted 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
  • Each region needs 20 ms to apply a config before relaying it: how does that change the model?
  • Links fail with some probability: how would you estimate the expected completion time?
  • Which single extra link would most reduce the completion time?
  • If latencies can change while the rollout runs, what would you do differently?
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 regions, directed links as (a, b, ms) with ms >= 0, and origin.
  • Arrival time at a region is the shortest relay path length from the origin.
  • Output: (max_arrival, arrivals) o...
High-Level Design

Build an adjacency list and run Dijkstra from the origin. The heap holds (time, node); when a popped entry is older than the best known arrival for that node, it is stale and skipped. Relaxing an ed...


Submit Your Answer
Markdown supported