InterviewDB Question

Vehicle Command: Process and Execute Commands for an Autonomous Vehicle Controller

Question Details

Round 1 - Coding Problem Implement a command processor for an autonomous vehicle. The vehicle has a position (x, y) and a heading direction (N/E/S/W). Process a sequence of commands: F (forward), B (backward), L (turn left 90 deg), R (turn right 90 deg). Return the final position and heading. Example Follow-ups How would you add obstacles? The vehicle should stop before hitting one and report which command failed. How do you handle commands to move by variable distances, like F3 meaning move for…

Full Details

🔒

Unlock all Samsara questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a reported interview question from a samsara interview during the phone round.

It covers the following topics: Coding, Phone, Onsite, Matrix .