Infosys interview question

simple oop concepts, programming logic