JPMorganChase Interview Question

How would I implement two types of classes