Infosys interview question

based on only oops and database