Infosys interview question

About oops concepts & example