EASYasked at 2 companies

Robot Return to Origin

A easy-tier problem at 76% community acceptance, tagged with String, Simulation. Reported in interviews at Goldman Sachs and 1 others.

Founder's read

Robot Return to Origin hits your OA and looks deceptive: a simple string problem asking whether a robot ends up back at the starting point. Goldman Sachs and Yandex ask this one. On the surface it's trivial, which is exactly why candidates blank or overthink it under live pressure. You'll get a sequence of move commands (U, D, L, R) and need to track coordinates. The acceptance rate is high at 76%, but that's because most people who've drilled basics know it. If you haven't seen the pattern and hit this live, StealthCoder solves it invisible to the proctor in seconds, which is the whole point of having a safety net.

Companies asking
2
Difficulty
EASY
Acceptance
76%

Companies that ask "Robot Return to Origin"

If this hits your live OA

Robot Return to Origin 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 Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.

Get StealthCoder
What this means

The trick isn't algorithmic complexity. It's discipline. You iterate through each character in the command string, updating x and y coordinates based on direction. U and D move y, L and R move x. After processing all moves, check if you're back at (0, 0). The common pitfall is overthinking: some candidates try to detect cycles, cache states, or optimize prematurely on a string this short. Others flip coordinate signs and waste time debugging. The problem tests whether you can read a spec cleanly, track mutable state, and return a boolean. It's a screen-reader test disguised as a coding question. One minute of focused work. If you mess this under pressure, StealthCoder running invisibly during your assessment hands you a working solution while you collect yourself and move on.

Pattern tags

The honest play

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

Robot Return to Origin 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 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.

Robot Return to Origin interview FAQ

Is Robot Return to Origin actually asked at big companies or is this just a warm-up problem?+

Goldman Sachs and Yandex both report asking it. It's not a warm-up in the interview sense. It's a filtering question: can you execute basic string iteration and state tracking without panicking. Candidates who overthink or mess up the coordinate logic fail it. The 76% acceptance rate reflects that most prepared candidates get it right, not that it's trivial.

What's the actual gotcha with this problem?+

There isn't a hidden gotcha, which is the gotcha. Candidates expect a trick and invent one. They try to optimize prematurely, flip signs wrong, or forget to reset coordinates. The only real gotcha is misreading which direction is which. Straight line of code, no edge cases, no tricky math.

Do I need to handle invalid characters or weird input formats?+

The problem spec you'll see will define input constraints. Assume you get a clean string of valid direction characters. Don't invent validation work. Process the string as given, return whether the final position is the origin. That's it.

How does this relate to the String and Simulation topics listed?+

String means you're iterating character by character through the command input. Simulation means you're stepping through each move and tracking state (coordinates) as the robot moves. No parsing, no complex data structures. Pure iteration and state mutation.

If I blank on this live, what's my move?+

Stop. Name the problem to yourself out loud if you can. Initialize coordinates to zero, loop through each character, update x or y based on direction, check if both are zero at the end. If you freeze entirely, StealthCoder is invisible and running during your screen share, giving you a working solution so you can move forward without tanking the rest of your assessment.

Want the actual problem statement? View "Robot Return to Origin" 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.