Infosys interview question

Basic of coding and oops concept