Domanda di colloquio di JPMorganChase

How would I implement two types of classes