The nature of the interface between Si and Ge substrates and high-k dielectrics often controls the performance of MOSFET devices. Precleaning and/or chemical functionalization of the surfaces can dramatically affect the formation of an interfacial layer. We have used in-situ IR spectroscopy to probe the relevant interfaces during ALD growth for a variety of surface treatments, including H- and Cl-termination, and nitridation. This paper focuses on understanding of the mechanisms for interfacial SiO2 (or GeOx) formation during HfO2 growth using tetrakis-ethylmethylamidohafnium (TEMAH) as the metal precursor and water or ozone as the oxygen precursor. We find that impurities arising from incomplete ligand elimination during growth (e.g. OH for H2O processing and CO- and NO-containing species for O3 processing) are incorporated into the HfO2 film during growth. Upon annealing, most of these species react, but can also migrate to the interface. Nitridation of Si and Ge surfaces will in general prevent SiO2 or GeOx formation but can also affect the growth rate.