Step 1: Preheat and Prepare the Cake Pans
Set your oven to 350°F (175°C). Grease and flour two 9-inch round cake pans, or line the bottoms with parchment paper for easy removal.
Step 2: Combine the Dry Ingredients
In a medium bowl, whisk together the flour, baking soda, baking powder, cinnamon, and salt until evenly mixed. Set aside.
Step 3: Prepare the Wet Mixture
In a large mixing bowl, whisk together the granulated sugar, brown sugar, eggs, vegetable oil, and vanilla extract until smooth and well blended.
Stir in the grated carrots and crushed pineapple until everything is fully incorporated.
Step 4: Combine and Bake
Gradually add the dry ingredients to the wet mixture, stirring just until combined. Avoid overmixing to keep the cake light and tender.
If using, gently fold in the chopped walnuts.
Divide the batter evenly between the two prepared pans and smooth the tops.
Bake for 30 to 35 minutes, or until a toothpick inserted into the center comes out clean.
Step 5: Cool the Cake Layers
Allow the cakes to cool in their pans for about 10 minutes. Then, carefully remove them and place on a wire rack to cool completely before frosting.
Step 6: Prepare the Cream Cheese Frosting
In a large bowl, beat the softened cream cheese and butter together until smooth and creamy.
Slowly add the powdered sugar, mixing until the frosting is light and fluffy.
Mix in the vanilla extract and pineapple juice for an extra touch of flavor.
Step 7: Assemble and Frost the Cake
Place one cooled cake layer on a serving plate or cake stand and spread a layer of frosting on top.
Place the second cake layer over it and frost the top and sides of the cake evenly.
For decoration, garnish with extra chopped walnuts or pineapple slices, if desired.