Five-membered ring C-alkylated heterocyclic ketene aminals react with diethyl azodicarboxylate to give the quaternary carbon-containing adducts in moderate to excellent yields while the six-membered analogs afford imidazo[1,5-a]pyrimidin-6-one derivatives. The formation of the addition products and their fragmentation reaction pathways are discussed.