Most Reliable Path Between Two Volcano Engine Cloud Regions

Last updated: November 29, 2026

Quick Overview

Regions are connected by links, each with a probability of delivering a packet. Find the highest end-to-end delivery probability from a source region to a destination, where a path's probability is the product of its link probabilities.

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

0

0

0 solved


Regions are connected by links, each with a probability of delivering a packet. Find the highest end-to-end delivery probability from a source region to a destination, where a path's probability is the product of its link probabilities.

Volcano Engine and ByteDance's internal network team route replication traffic over links with varying reliability. The interviewer wants to see you adapt Dijkstra from sums to products, explain why it is still correct when all probabilities are at most 1, and mention the log-transform view.

What the Interviewer Expects
  • Adapt Dijkstra to maximize a product
  • Justify correctness: multiplying by p <= 1 never increases a value
  • Use a max-heap via negated keys
  • Skip stale heap entries
  • Mention the equivalent -log(p) shortest path formulation
Key Topics to Cover
Dijkstra
weighted graphs
probability
priority queue
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
  • What if some links had probability above 1 (for example a boost factor)?
  • How would you find the path itself, not just the probability?
  • How would you handle links whose reliability changes every minute?
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: number of regions n, undirected links (u, v, p) with 0 <= p <= 1, and src, dst. Output: the best probability, or 0 if unreachable....

High-Level Design

Dijkstra works whenever extending a path can only make it worse. Here extending multiplies by p <= 1, so it never helps, and the greedy invariant holds: the first time we pop a node it has its final b...


Submit Your Answer
Markdown supported