Prepare the Cake Batter:
Preheat your oven to 350°F (175°C). Grease and flour two 9-inch round cake pans or line them with parchment paper.
In a medium bowl, whisk together the flour, baking soda, baking powder, and salt. Set aside.
Mix the Wet Ingredients:
In a large bowl, cream the butter and sugar until light and fluffy. Beat in the eggs one at a time, followed by the vanilla and almond extracts.
Combine Wet and Dry Ingredients:
Gradually add the dry ingredients to the wet mixture, alternating with the milk. Start and end with the dry ingredients. Fold in the ground pistachios until well incorporated.
Bake the Cake:
Divide the batter evenly between the prepared pans and smooth the tops. Bake for 25-30 minutes, or until a toothpick inserted into the center comes out clean. Let the cakes cool in the pans for 10 minutes, then transfer them to a wire rack to cool completely.
Prepare the Frosting:
In a large bowl, beat the cream cheese and butter until smooth. Gradually add the powdered sugar, one cup at a time, beating until fluffy. Mix in the vanilla and almond extracts.
Assemble the Cake:
Place one cake layer on a serving plate and spread a generous amount of frosting on top. Place the second layer on top and frost the top and sides of the cake.
Garnish:
Sprinkle the chopped pistachios over the top and sides of the cake for a beautiful finish.