Pregunta de entrevista de IBM

Array question and data structures question