Pregunta de entrevista de Emerson

How does a AND, OR and NAND gate operate?