Pregunta de entrevista de IMC Trading

Basic algorithm questions, can be done in any language.