Pregunta de entrevista de Nanonets

Basic data structure questions and a puzzle.