Analog Devices interview question

Describe how a Comparator works