HP Inc. interview question

how to get data from linked list