Deloitte interview question

Build a linked list and traverse it