Code Room
CodingHardcod-g254
Subject Dijkstra variantsLevel Senior–Staff~40 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Given an undirected weighted graph with n nodes (0..n-1) and edges [u, v, w] with positive capacities w, find a path from a source to a destination that maximizes the minimum edge capacity along the path (the widest path / bottleneck). Return that maximum bottleneck value, or -1 if the destination is unreachable. If source equals destination, return 0. Constraints: 1 <= n <= 500.

Implement
max_bottleneck_path(n: int, edges: list[list[int]], src: int, dst: int) → int
Examples
in[3,[[0,1,1],[1,2,5],[0,2,3]],0,2]out3
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.