General Motors (GM) interview question

There were 2 coding questions.