Autobrains Interview Question

Regarding my solution to programming exercise