Infosys interview question

string question