← Goldman Sachs questions
CodingReported in a candidate post, Jun 2022

Shortest path in a weighted graph

Filed under Goldman Sachs

Given a weighted graph with non-negative edge weights, a source node and a destination node, find the cost of the shortest path from source to destination. Return -1 if the destination is unreachable…

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 Goldman Sachs questions

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