Newput Infotech interview question

mainly based on oops