HP Inc. Interview Question

how to get data from linked list