01 -
Preheat the oven to 350°F (175°C) and grease and flour two 9-inch round cake pans.
02 -
In a large mixing bowl, whisk together the all-purpose flour, granulated sugar, baking soda, baking powder, ground cinnamon, and salt until thoroughly blended.
03 -
In a separate bowl, whisk the vegetable oil and eggs until fully incorporated. Stir in the grated carrots, drained crushed pineapple, shredded coconut, and chopped walnuts if using.
04 -
Gently fold the wet mixture into the dry ingredients, stirring by hand only until just combined to ensure a tender crumb. Do not overmix.
05 -
Evenly divide the batter between the prepared cake pans and smooth the surfaces with a spatula.
06 -
Bake for 25 to 30 minutes, or until a toothpick inserted into the center emerges clean with a few moist crumbs attached.
07 -
Allow cakes to rest in pans for 10 minutes. Carefully remove from pans and transfer to wire racks to cool completely.
08 -
In a bowl, beat softened cream cheese and butter on medium speed until smooth. Gradually add powdered sugar, then blend in vanilla extract, beating until the frosting is light and fluffy.
09 -
Spread frosting over the first cake layer, top with the second layer, and generously frost the top and sides. Garnish with shredded coconut or additional pineapple if desired.