Domanda di colloquio di Texas Instruments

How does a transistor work as a switch?