For the Cake
2 cups all-purpose flour
2 teaspoons baking powder
2 teaspoons baking soda
2 teaspoons ground cinnamon
¾ teaspoon salt
3 cups grated carrots (about 4 or 5)
1 cup coarsely chopped walnuts or pecans
1 cup shredded coconut (sweetened or unsweetend)
½ cup moist, plump raisins or dried cranberries
2 cups sugar
1 cup canola or safflower oil
4 large eggs
For the Frosting
8 ounces cream cheese, at room temperature
1 stick (8 tablespoons) unsalted butter, at room temperature
1 pound (3¾ cups) confectioners' sugar, sifted
1 tablespoon fresh lemon juice
½ cup shredded coconut
Finely chopped toasted nuts and/or toasted shredded coconut, for topping
Getting ready: Position the racks to divide the oven into thirds and preheat the oven to 325ºF. Butter three 9x2-inch round cake pans, flour the insides and tap out the excess. Put two pans on one baking sheet and one on another.
To make the cake:
Whisk together the flour, baking powder, baking soda, cinnamon and salt. In another bowl, stir together the carrots, chopped nuts, coconut and raisins. Working with a stand mixer, preferably fitted with a paddle attachment, or with a hand mixer in a large bowl, beat the sugar and oil together on medium speed until smooth. Add the eggs one by one, and continue to beat until the batter is even smoother. Reduce the speed to low and add the flour mixture, mixing only until the dry ingredients disappear. Gently mix in the chunky ingredients. Divide the batter among the baking pans.
Bake for 40 to 50 minutes, rotating the pans from top to bottom and front to back at the midway point, until a thin knife inserted into the centers comes out clean. The cakes will have just started to come away from the sides of the pans. Transfer the cakes to cooling racks and cool for about 5 minutes, then run a knife around the sides of the cakes and unmold them. Invert and cool to room temperature right side up. (The cakes can be wrapped airtight and kept at room temperature overnight or frozen for up to 2 months.)
To make the frosting:
Working with the stand mixer, preferably fitted with a paddle attachment, or with a hand mixer in a large bowl, beat the cream cheese and butter together until smooth and creamy. Gradually add the sugar and continue to beat until the frosting is velvety smooth. Beat in the lemon juice. If you'd like coconut in the filling, scoop out about half of the frosting and stir the coconut into this portion.
To assemble the cake:
Put one layer top side up on a cardboard cake round or a cake plate protected by strips of wax or parchment paper. If you added the coconut to the frosting, use half of the coconut frosting to generously cover the first layer (or cover generously with plain frosting.) Use an offset spatula or a spoon to smooth the frosting all the way to the edges of the layer. TOp with the second layer, this time placing the cake top side down, and frost with the remainder of the coconut frosting (or more plain frosting.) Top with the last layer, right side up, and frost the top— and the sides, if you want— of the cake. Finish the top with swirls of frosting. If you want to top the cake with toasted nuts or coconut, sprinkle them on now, while the frosting is soft.
Refrigerate the cake for 30 minutes, just to set the frosting before serving.