Infosys interview question

write a code of advanced level