Pergunta de entrevista da empresa Emerson

How does a AND, OR and NAND gate operate?