Pregunta de entrevista de J.P. Morgan

Medium to complex. Multithreading is must.