Microsoft interview question

linked list traversal and construction