Pregunta de entrevista de Jane Street

Coding problem on the class methods implementations with follow-up tasks