Pergunta de entrevista da empresa CHEP

Full of data structures and logical question. Interviewer will give clues to solve the problem.