Reported October 2024
Expediabreadth first search

Get Min Steps

Reported by candidates from Expedia's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Expedia OA. Under 2s to a working solution.
Founder's read

You've got an Expedia OA in your inbox and "Get Min Steps" just landed in October 2024. This is a shortest-path problem dressed up in domain language. You need to find the minimum number of moves from point A to point B, and the trick is almost always BFS or dynamic programming depending on whether the graph is weighted. StealthCoder sits invisible during your OA and can feed you the pattern in real time if you blank on the approach.

Pattern and pitfall

Get Min Steps is asking you to compute the shortest distance in an unweighted or lightly weighted graph, or to optimize steps through a grid or state space. The canonical approach is breadth-first search (BFS) if you're moving between discrete states with unit cost per step. If there's a mathematical shortcut (like Manhattan distance or a greedy heuristic), the problem setter wants you to spot it. Common trap: overthinking it as dynamic programming when BFS solves it faster. The other trap: forgetting to handle visited states and revisiting nodes. When you're live and second-guessing yourself, StealthCoder gives you the confidence that BFS with a visited set is the reliable fallback.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Get Min Steps cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as shortest path in binary matrix. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Expedia's OA.

Expedia reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Get Min Steps FAQ

Is this asking for shortest path or fewest moves?+

Fewest moves almost always means shortest path in an unweighted graph. Use BFS. If the problem mentions costs or weights per edge, you might need Dijkstra, but start with BFS. It's simpler and usually correct.

What's the trick Expedia wants me to spot?+

Often it's recognizing the state space. Is it a grid (use BFS with row/col)? A graph (build adjacency list then BFS)? Or a math problem (steps can be calculated directly). Read the constraints. If N is huge but the answer is small, there's a formula.

Will BFS time out?+

Only if the state space is exponential and you don't prune properly. Always track visited states to avoid cycles. If your visited set grows beyond 10^6 or 10^7, the approach is probably wrong. Reconsider the problem.

Do I need to reconstruct the path or just return the count?+

Read the output spec carefully. If it's just the minimum steps, return the distance from BFS. If you need the actual moves, store parent pointers and backtrack. Don't code both unless asked.

How do I prepare for this in 48 hours?+

Know BFS cold. Implement it on a grid and a graph. Recognize when a problem is shortest-path in disguise. Practice one example with coordinates and one with a state machine. That covers 90% of Expedia's variants.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Expedia.

OA at Expedia?
Invisible during screen share
Get it