Autodesk interview question

Simple algorithms questions.