Pergunta de entrevista da empresa JPMorganChase

How would I implement two types of classes