Molex interview question

Coding question on linked list