GlobalLogic interview question

Oops concepts