Intel Corporation interview question

How does a PN junction diode work.