General Atomics interview question

linked list question, easy-medium leetcode