CapeStart interview question

Basic OOPS concepts and algorithm