If your mug cake recipe overflowed whilst cooking in the microwave, it is most likely because there was too much batter in the mug. I always fill my mug 3/4 full of the cake batter to avoid overflowing. So be sure to use a big enough mug to avoid your cake from spilling over the sides of your mug while cooking.