Infosys Interview Question

Question on oops dsa c++