Intel Corporation Interview Question

How does a PN junction diode work.