think-cell interview question

Data structures question, coding challenge