Carnegie Robotics interview question

Very basic coding questions