Find the Shortest Distance in a Weighted Undirected Graph

Read the full interview experience this question came from →

Quick Overview

Find the minimum total weight between two vertices in a large undirected graph with positive edges. Build an adjacency list, run Dijkstra with a priority queue and stale-entry checks, use wide distances, and return a clear sentinel when no path exists.

Find the Shortest Distance in a Weighted Undirected Graph

Company: Visa

Role: Software Engineer I

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Online Assessment

Overview: Find the minimum total weight between two vertices in a large undirected graph with positive edges. Build an adjacency list, run Dijkstra with a priority queue and stale-entry checks, use wide distances, and return a clear sentinel when no path exists.

Read the full Visa Software Engineer I interview experience this question came from

|Home/Coding & Algorithms/Visa
Visa logo
Visa
Aug 8, 2026
mediumSoftware Engineer IOnline AssessmentCoding & Algorithms
3
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...