Pregunta de entrevista de JPMorganChase

How would I implement two types of classes