Preheat oven to 350°F (175°C). Grease and flour a 9x13-inch baking pan.
In a large bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, and nutmeg.
In another bowl, beat sugar, oil, and eggs until smooth and creamy. Gradually add the dry ingredients to the wet ingredients, mixing until combined.
Fold in grated carrots, crushed pineapple, and walnuts if using. Pour the batter into the prepared pan and spread evenly.
Bake for 30–35 minutes or until a toothpick inserted in the center comes out clean. Let the cake cool completely.
Once cooled, use the handle of a wooden spoon to poke holes evenly across the cake.
In a medium bowl, whisk together pudding mixes and milk until thickened. Pour the mixture over the cake, spreading it into the holes. Refrigerate for 1 hour to set.
Spread whipped topping evenly over the chilled cake. Garnish with crushed nuts and refrigerate for another 30 minutes before serving.