Answer: The Gemara (Berachos 20b) teaches that there is a mitzva mideoraisa to recite kiddush on Shabbos. Rambam (Shabbos 29:4) explains that this mitzva applies to the first kiddush that we recite on Friday night. The Mishna Berura (271:8) notes, however, that the kiddush that we say on Shabbos day is miderabanan (See Baer Heitev 289:2).
The Gemara (Pesachim 101a) writes that kiddush must be recited bemakom seuda, where one is going to eat their meal. Thus, Tosafos (Pesachim 101a) and the Rosh (Pesachim 10:5) write that kiddush must be followed by a bread meal. The Tur (OC 273:5), however, writes that seuda includes a snack or drinking some wine.
Following this, the Magen Avraham (OC 273:11) writes that just as mezonos is considered to be more prominent than hagefen, so too eating cakes, etc. would be like having a bread seuda. While R’ Akiva Eiger (OC 273:5) and the Vilna Gaon (quoted in Biur Halacha 273:5) disagree with the Magen Avraham, most follow the Magen Avraham and rely on cakes, etc. on Shabbos day to be kovea seuda (See Aruch Hashulchan OC 273:8; Mishna Berura 273:25).
The Kitzur Shulchan Aruch (77:14) and R’ Yitzchak Elchanan Spector (Ein Yitzchak OC 12:11) write that one can only have cake as part of their kiddush during the day when kiddush is miderabanan, but not on Friday night when kiddush is mideoraisa.
Nonetheless, R’ Yehoshua Neuwirth (Shemiras Shabbos Kehilchasa 54:22) writes that one can recite kiddush on cake even on Friday night, though, unlike during the daytime, one cannot repeat kiddush before the meal.
In conclusion, it is preferable to have kiddush on Friday night before one eats their meal, though if one has to wait to begin their meal, they may recite kiddush and eat some cake first.