TCS interview question

DSA question based on linked list