Preheat the oven to 175°C (350°F) and prepare a sheet cake pan with grease and parchment paper.
Mix flour, baking powder, baking soda, cinnamon, and salt in a bowl.
Beat eggs, sugar, oil, and vanilla extract until well combined.
Add the dry ingredients and mix gently until a smooth batter forms.
Fold in grated carrots and optional nuts.
Pour the batter into the prepared pan and bake for 30–40 minutes until a toothpick comes out clean.
Cool completely, spread with cream cheese frosting, and cut into squares before serving.