Pergunta de entrevista da empresa FanDuel

How would you solve this same problem in another context (reusability/OOP design)