Indosolar interview question

NAND gate, XOR gate explanations