Qualcomm interview question

Linked List middle element code