Pergunta de entrevista da empresa Siemens Digital Industries Software

2 puzzles, one question from linked lists, another from arrays