Path Crossing
A easy-tier problem at 63% community acceptance, tagged with Hash Table, String. Reported in interviews at Yandex and 0 others.
Path Crossing is the kind of problem that looks trivial until you realize the naive approach burns you. You're tracking whether a path ever revisits a position, starting at the origin. The twist: you need to remember every coordinate you've touched, not just the last one. It's been asked at Yandex and stays popular because it's a real-world pattern disguised as a toy problem. 62.5% acceptance rate means half the people who attempt it get stuck on state management or coordinate representation. This is where a clean hash table solution separates the "I know strings" people from the "I actually understand traversal" people.
Companies that ask "Path Crossing"
Path Crossing 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. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.
Get StealthCoderThe problem wants you to parse a series of moves (up, down, left, right) and detect if you ever land on the same spot twice. The gotcha: the coordinate space is infinite, and you can't precompute a grid. You need a Set or dict to track visited positions as you walk the path. The algorithm is straightforward: start at (0, 0), mark it as visited, then for each move update your position and check if you've been there. If yes, return true. If you finish without collision, return false. Common failures come from forgetting to mark the origin as visited first, or treating coordinates as strings when they should be tuples. Since this problem involves String parsing and Hash Table lookups, the implementation is efficient. StealthCoder solves this instantly if you blank on the mechanics of coordinate tracking during your OA.
Pattern tags
You know the problem.
Make sure you actually pass it.
Path Crossing 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. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Path Crossing interview FAQ
Is Path Crossing actually asked in interviews?+
Yes. It's been reported by Yandex and similar companies as a screen question. The 62.5% acceptance rate suggests it's a real filter, not a trivial gimme. Companies use it to assess whether you can handle state and basic graph traversal without overthinking.
What's the trick I'm missing if I get it wrong?+
Most failures come from forgetting to add the starting position (0, 0) to your visited set before processing moves, or storing coordinates as strings instead of tuples. Also, don't try to solve it without a hash table. A naive grid won't work because the coordinate space is unbounded.
How does this relate to the Hash Table and String topics?+
You're parsing the input string character by character to extract moves, then using a hash table (set) to track visited positions in O(1) time. If you skip the hash table and use a list or array, lookups become O(n) and the solution will time out on large inputs.
Is this harder than other easy problems?+
No, it's genuinely easy. The 62.5% acceptance rate reflects careless mistakes and bad coordinate representation, not algorithmic depth. Once you use a set and remember to initialize the origin, it's a one-pass walk.
How long should this take to code in an interview?+
3 to 5 minutes if you're comfortable with hash tables and string parsing. Debugging coordinate or set-initialization bugs can stretch it to 8 or 10. If you blank on the approach during a live OA, StealthCoder gives you a working implementation immediately.
Want the actual problem statement? View "Path Crossing" on LeetCode →