Pregunta de entrevista de Hudson River Trading

Probability / statistics questions, programming puzzle