Pergunta de entrevista da empresa Major League Baseball (MLB)

Given a light and a two switch - create an object model that best represents both items.

Resposta da entrevista

Sigiloso

30 de ago. de 2017

Create a LightSource class and a Switch interface. Create a concrete Switch class to implement the Switch interface. Pass instances of the LightSource to the Switch to control the state of the LightSource. Implement a SwitchFactory to generate different types of switches that can control the LightSource.

1