FastPrepMaximum-Efficiency Transmission Path
Problems/Maximum-Efficiency Transmission Path

Maximum-Efficiency Transmission Path

Google logoGoogle● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A reported phone-screen graph task backs this exercise. It asks for the path with the maximum multiplicative efficiency. We chose that edges are undirected, an explicit result for no path, the input limits, and the examples. Our version is about 88% the same as the reported question.

An undirected transmission network has n nodes numbered from 0 to n - 1. Each pair in edges identifies one transmission line, and the value at the same index in efficiencies is a number from 0 to 1.

The efficiency of a path is the product of its line efficiencies. Return the maximum efficiency of any path from source to destination. Return 0.0 when no path exists.

Function

maxEfficiency(n: int, edges: int[][], efficiencies: double[], source: int, destination: int) → double

Examples

Example 1

n = 3edges = [[0,1],[1,2],[0,2]]efficiencies = [0.5,0.5,0.2]source = 0destination = 2return = 0.25

The two-line path has efficiency 0.5 times 0.5, which exceeds the direct line's 0.2.

Example 2

n = 4edges = [[0,1],[2,3]]efficiencies = [0.75,0.5]source = 0destination = 3return = 0.0

The destination is in a different connected component.

Constraints

  • 1 <= n <= 100000.
  • 0 <= edges.length <= 200000, and edges.length == efficiencies.length.
  • Every edge contains two distinct valid node indices; parallel lines may exist.
  • 0.0 <= efficiencies[i] <= 1.0.

Source note: The source image is a source-neutral excerpt of the author-reported prompt.

More Google Phone Screen questions

  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Periodic-Color Binary Forest RootsPHONE SCREEN · Seen Nov 2026
  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Word Chain Jumps in a GridPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • Course Schedule Cycle DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Shortest Travel Time in a Grid with Traffic LightsWaymo · PHONE SCREENWaymo interview questions
  • Cheapest Flights Within K StopsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Shortest Paths in a Nonnegative Directed GraphNation with NaMo · PHONE SCREEN
  • Dijkstra Shortest Paths in a Weighted Undirected GraphGoldman Sachs · PHONE SCREENGoldman Sachs interview questions
  • Shortest Path with Directional Move CostsThe Walt Disney Company · PHONE SCREENThe Walt Disney Company interview questions
  • Shortest-Path Distances with DijkstraApple · PHONE SCREENApple interview questions
  • Fastest Flight Route Between AirportsAirbnb · PHONE SCREENAirbnb interview questions
  • Dynamic Broadcast TimesNetflix · PHONE SCREENNetflix interview questions
  • Path With Maximum ProbabilitySalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Minimum Stress PathWalmart · OAWalmart interview questions

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public double maxEfficiency(int n, int[][] edges, double[] efficiencies, int source, int destination) {
      // Write your code here.
    }
}
Checking account…