Shortest Path interview questions
17 shortest path problems tagged across recent interview reports. Drilled most heavily by atlassian, uber, and blackrock.
Shortest Path problems ask you to find the minimum-cost or minimum-distance route between nodes in a graph. With 17 problems in this pattern, it's a staple of tech interviews. Atlassian, Uber, BlackRock, and others use it to test whether you can pick the right algorithm (Dijkstra, BFS, Bellman-Ford) and implement it cleanly under time pressure. When a variant lands in your live OA and you freeze, StealthCoder reads the graph constraints and solves it invisibly.
Most-asked shortest path problems
| # | Problem | Diff | # Companies | Pass % |
|---|---|---|---|---|
| 01 | Evaluate Division | MEDIUM | 17 | 63% |
| 02 | Cheapest Flights Within K Stops | MEDIUM | 9 | 40% |
| 03 | Design Graph With Shortest Path Calculator | HARD | 2 | 64% |
| 04 | Minimum Cost to Buy Apples | MEDIUM | 2 | 67% |
| 05 | Network Delay Time | MEDIUM | 2 | 57% |
| 06 | Number of Possible Sets of Closing Branches | HARD | 2 | 48% |
| 07 | Path with Maximum Probability | MEDIUM | 2 | 65% |
| 08 | Find Edges in Shortest Paths | HARD | 1 | 46% |
| 09 | Find the City With the Smallest Number of Neighbors at a Threshold Distance | MEDIUM | 1 | 70% |
| 10 | Minimum Cost of a Path With Special Roads | MEDIUM | 1 | 40% |
| 11 | Minimum Cost to Convert String I | MEDIUM | 1 | 58% |
| 12 | Minimum Cost to Convert String II | HARD | 1 | 26% |
| 13 | Minimum Cost to Make at Least One Valid Path in a Grid | HARD | 1 | 71% |
| 14 | Minimum Cost to Reach City With Discounts | MEDIUM | 1 | 60% |
| 15 | Minimum Time to Visit a Cell In a Grid | HARD | 1 | 57% |
| 16 | Reachable Nodes In Subdivided Graph | HARD | 1 | 51% |
| 17 | The Maze II | MEDIUM | 1 | 54% |
You can't drill every shortest path variant before the assessment. StealthCoder runs invisibly during screen share and solves whichever variant they throw at you. No browser extension. No detection signature. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.
Get StealthCoderMost Shortest Path problems disguise themselves as grid traversals, pricing queries, or conversion chains. You'll recognize them by the presence of weighted edges, a source and target, and a cost to minimize. Variants split into three buckets: single-source (Dijkstra for non-negative weights), unweighted graphs (BFS), and all-pairs or constraint-heavy twists (Bellman-Ford or dynamic programming). Drill order: start with BFS on unweighted grids, then Dijkstra with heaps, then edge cases like negative cycles or k-hop constraints. If you hit an unfamiliar variant during the assessment, StealthCoder is your hedge, solving it in real time while the proctor sees only your normal screen.
Companies that hire most on shortest path
17 shortest path problems.
You won't drill them all. Pass anyway.
Shortest Path is one of the patterns interviews actually filter on. Memorizing every variant in a week is a fantasy. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds, no matter which shortest path flavor lands in your live OA. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Shortest Path interview FAQ
How many Shortest Path problems should I drill before an OA?+
Aim for 8 to 10 solid problems across BFS, Dijkstra, and one harder variant. This pattern has 17 problems in the bank, but depth matters more than volume. Focus on recognizing when to apply each algorithm rather than memorizing every twist.
Which companies drill Shortest Path the hardest?+
Atlassian leads with 8 problems tagged to this pattern, followed by Uber with 5. BlackRock, MakeMyTrip, PhonePe, Samsung, Snap, Snowflake, Stripe, and Citadel also weight it heavily. If you're interviewing at any of these, Shortest Path is non-negotiable.
How do I recognize a Shortest Path problem in disguise?+
Look for: a graph or grid with weighted edges, a source and destination, and a cost to minimize. Problems like 'Cheapest Flights Within K Stops' or 'Minimum Cost to Convert String' are Shortest Path under the hood, even if they don't mention graphs explicitly.
Should I memorize Dijkstra's algorithm?+
Yes. Know the heap-based implementation cold, including edge relaxation and visited sets. Understand when to use it (non-negative weights) versus Bellman-Ford (negative weights allowed). Implement it at least three times from scratch before your OA.
What's the most common mistake on Shortest Path problems?+
Using BFS on a weighted graph, or forgetting to check if a node is already visited before processing it. Also, not handling k-hop or constraint-based variants, read the problem statement twice before coding.