Microsoft interview question

Basic data structure and O(n)