Pregunta de entrevista de Microsoft

Data structures related 2 questions not able to solve