Infosys interview question

Asked one programming question. Question related to linked list