employer cover photo
employer logo
employer logo

Major League Baseball (MLB)

Is this your company?

Major League Baseball (MLB) Interview Question

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

Interview Answer

Anonymous

Aug 30, 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