IBM interview question

DSA array traversal and list traversal