How are microwaves produced

(i) How are microwaves produced ? Why is it necessary in microwave ovens to select the j frequency of microwaves to match the resonant frequency of water molecules ?
(ii) Write two important uses of infrared waves.[Delhi Comptt. I, II, III 2014]

(i) Microwaves are produced by special vacuum tubes like the klystron/ Magnetron / Gunn diode.
The frequency of microwaves is selected to match the resonant frequency of water molecules, so that energy is transferred efficiently to the kinetic energy of the molecules.
(ii) (a) Associated with the greenhouse effect.
(b) In remote switches of household electrical appliances. [CBSE Marking Scheme, 2014]