← Amazon questions

Shortest path between two vertices in an unweighted graph

Filed under Amazon

Given an unweighted graph and two vertices, find the shortest path distance (minimum number of edges) between the source and target vertices.

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.