Preheat oven and bake carrot cake according to package instructions using a 9x13-inch pan. Let cool for 10 minutes.
Using the handle of a wooden spoon, poke holes all over the cake.
Whisk together milk and cheesecake pudding mix until smooth and thickened, about 2 minutes.
Pour pudding over the cake, filling the holes. Spread evenly. Chill for at least 30 minutes.
In a mixing bowl, beat softened cream cheese until smooth. Fold in whipped topping, pineapple, and shredded carrots.
Spread the cream cheese mixture over the cake. Top with chopped nuts if using.
Refrigerate at least 2 hours before serving for best results.