Rahi Systems interview question

What is capacitor, how is it different from diode