← Visa Interview Insights

Visa·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Mar 2026

Summary

Visa SWE interview with a graph problem. Pretty standard algorithmic round, nothing too surprising.

Questions Asked (1)

Q1

Given a directed weighted graph, find the shortest path between two nodes.

Algorithms & Data Structures
Author's notes

Knew it was Dijkstra pretty fast, which was a relief.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints (e.g., non-negative weights, graph size) and then select the appropriate algorithm: Dijkstra for non-negative weights, Bellman-Ford for negative weights, or BFS for unweighted graphs. Explain the algorithm's steps, analyze its time and space complexity, and discuss potential optimizations or edge cases.

Pro tip: Always ask about edge weights and graph size before choosing an algorithm; mentioning that Dijkstra fails with negative weights and suggesting Bellman-Ford or Johnson's algorithm shows depth. Also, relate the solution to real-world scenarios at Visa, such as optimizing payment routing or fraud detection networks.

1. Clarify constraints

Ask about graph size, edge weight ranges (negative?), and whether the graph is static or dynamic. This determines the algorithm choice.

2. Choose algorithm

Select Dijkstra for non-negative weights, Bellman-Ford for negative weights, or BFS for unweighted. Justify your choice based on constraints.

3. Explain algorithm steps

Walk through the algorithm: initialization, priority queue or relaxation, and termination. Use a small example to illustrate.

4. Analyze complexity

State time and space complexity (e.g., O(E log V) for Dijkstra with binary heap) and discuss trade-offs.

5. Handle edge cases and optimizations

Mention unreachable nodes, negative cycles, and possible optimizations like bidirectional search or A* if applicable.

Key Points to Mention

  • Dijkstra's algorithm and its limitation with negative weights
  • Bellman-Ford algorithm for graphs with negative weights and negative cycle detection
  • Time and space complexity analysis (e.g., O(E log V) vs O(VE))
  • Use of priority queue (min-heap) in Dijkstra
  • Edge cases: disconnected graph, source equals target, zero-weight edges
  • Real-world application at Visa (e.g., payment routing, network optimization)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.