Pergunta de entrevista da empresa Consilience Software

Two algorithm/data-structure programming questions.