PracHub
QuestionsPremiumLearningGuidesInterview PrepCoaches
|Home/Coding & Algorithms/Roblox

Simulate robot path and detect boundedness

Last updated: Mar 29, 2026

Quick Overview

This question evaluates the ability to simulate iterative movement and reason about repeated state transformations, testing competencies in algorithm design, cycle detection, and geometric reasoning; it falls under the Coding & Algorithms category.

  • Medium
  • Roblox
  • Coding & Algorithms
  • Software Engineer

Simulate robot path and detect boundedness

Company: Roblox

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

A robot starts at (0, 0) facing north on an infinite 2D plane. It executes a command string s consisting of 'G' (move forward one unit), 'L' (turn left 90°), and 'R' (turn right 90°). After finishing s once, the robot repeats the same string k times, where k can be as large as 10^9. Implement an algorithm that (a) returns the robot’s final position and facing direction after one execution of s, and (b) determines whether the trajectory remains within a bounded region if s is repeated indefinitely. Provide time and space complexity and avoid simulating all k repetitions.

Quick Answer: This question evaluates the ability to simulate iterative movement and reason about repeated state transformations, testing competencies in algorithm design, cycle detection, and geometric reasoning; it falls under the Coding & Algorithms category.

Related Interview Questions

  • Find Windows Containing a Target - Roblox (medium)
  • Implement Sliding-Window Rate Limiter - Roblox (medium)
  • Find target-heavy sliding windows - Roblox (medium)
  • Find most frequent call path in logs - Roblox (medium)
  • Track Highest-Earning Experience - Roblox (medium)
Roblox logo
Roblox
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
18
0

A robot starts at (0, 0) facing north on an infinite 2D plane. It executes a command string s consisting of 'G' (move forward one unit), 'L' (turn left 90°), and 'R' (turn right 90°). After finishing s once, the robot repeats the same string k times, where k can be as large as 10^9. Implement an algorithm that (a) returns the robot’s final position and facing direction after one execution of s, and (b) determines whether the trajectory remains within a bounded region if s is repeated indefinitely. Provide time and space complexity and avoid simulating all k repetitions.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Roblox•More Software Engineer•Roblox Software Engineer•Roblox Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.