EASYasked at 2 companies

Destination City

A easy-tier problem at 79% community acceptance, tagged with Array, Hash Table, String. Reported in interviews at Yelp and 1 others.

Founder's read

Destination City is the kind of problem that catches people off guard despite its Easy rating. Yelp and Yandex both ask it, and the acceptance rate sits near 79%, which means roughly one in five candidates still get tripped up. The pattern is simple once you see it, but if you blank on the trick during your live assessment, you're looking at wasted minutes on something that should take under five. This is exactly where StealthCoder runs invisibly behind your screen and surfaces a working solution in seconds so you can move forward.

Companies asking
2
Difficulty
EASY
Acceptance
79%

Companies that ask "Destination City"

If this hits your live OA

Destination City is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround.

Get StealthCoder
What this means

The problem gives you a list of edges (from, to pairs representing flights or routes) and asks you to find the destination city. The trap is overthinking it. Most candidates instinctively build a graph or reach for complex traversal logic. The actual pattern is much dumber: every city appears as a source except one. That one unpaired city is your answer. You hash all sources, hash all destinations, find the destination that's missing from sources, done. Array and Hash Table are the only tools you need. String handling is trivial. The moment you realize you don't need to simulate a journey, the problem collapses to a single pass. If this specific pattern hits your live OA and you start coding a DFS instead, StealthCoder solves it in seconds flat, invisible to the proctor.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Destination City recycles across companies for a reason. It's easy-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Destination City interview FAQ

Is this actually asked by big companies or is it just a warm-up?+

Yelp and Yandex both report this problem. The 79% acceptance rate and Easy label suggest it's more of a baseline assessment than a sieve question, but that doesn't mean you'll see it coming or nail it under pressure if you haven't internalized the pattern.

What's the trick that makes people fail despite the Easy rating?+

Overengineering. Candidates see a graph-like structure (cities, routes) and default to graph traversal or cycle detection. The actual solution is set difference: which destination never appears as a source. Once you spot that, it's trivial. Once you don't, you waste time on unnecessary logic.

Do I need to know graph theory or can I just use a hash table?+

Pure hash table. Hash all source cities, iterate destinations, find the one not in sources. No traversal, no topological sort, no queue. Array and Hash Table from the topics list are all you need. String handling is just key lookups.

How does this relate to harder routing or graph problems?+

This is the toy version. It assumes exactly one destination with no cycles, no branching, no revisits. Harder variants force you to actually traverse a graph, detect cycles, or find the longest path. This one is solved by elimination, not exploration.

Should I memorize this or understand the logic?+

Understand the logic. The insight is 'every city except one appears as a source.' If you can explain why that works and code it in under two minutes, you're solid. Memorizing code is less reliable than internalizing the pattern.

Want the actual problem statement? View "Destination City" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.