SCHNEIDER ELECTRIC Hiring | Robot Bounded in Circle | Greedy Simulation | OA 2024

Question · Posted Jun 2026

Problem Statement A robot starts at position (0, 0) facing North. The robot receives a sequence of instructions consisting of: 'G' → Move forward by 1 unit. 'L' → Turn left by 90°. 'R' → Turn right by 90°. The instruction sequence is repeated infinitely. Determine whether the robot remains within a bounded circle or eventually moves infinitely far away. Return: true if the robot is bounded in a circle. false otherwise. Example 1 Input instructions = "GGLLGG" Output true ...

The full answer & interview discussion are available to premium members.

Log in Create a free account