FastPrepMaximum-Efficiency Transmission Path

Maximum-Efficiency Transmission Path

Google logoGoogle● MediumFULLTIMEPHONE SCREEN

Problem statement

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 problem statement continues
Pro

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.

Original screenshot from the interview report
Pro
FastPrep Pro
Reported in 1 Google interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 1 more worked example, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week
See Google hiring insights
CodePython 3
Run and Submit unlock with Pro
FastPrep Pro
Reported in 1 Google interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 1 more worked example, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week