Accenture interview question

Linked list based DSA question