Two Sigma interview question

Design-pattern implementation