GlobalLogic interview question

Oops programming