UST interview question

Logic gates