Pergunta de entrevista da empresa Two Sigma

Two intermediate level C++ programming problems.