Nanonets interview question

Basic data structure questions and a puzzle.