Agilent Technologies interview question

Explain how a diode works.