Pergunta de entrevista da empresa Cisco

A basic data structure question and logic puzzle.