Infosys interview question

Coding questions, they share some code snipets and want answer for them