← Amazon questions
CodingReported in a candidate post, Oct 2022

Diameter of a Graph

Filed under Amazon

Given a connected, undirected graph, find its diameter, which is defined as the maximum distance (shortest path between any pair of nodes) across all pairs of nodes in the graph.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.