Preheat oven to 350 degrees F. Butter an 8 or 9-inch square baking dish; set aside.: The oven preheating creates consistent heat so the top begins to set as soon as it goes in, producing that tender, domed surface. You should feel the warmth against your face when you open the oven, and the scent of warm metal is a small comfort that signals readiness. Buttering the dish prevents sticking and adds a slight richness around the edges, which will brown pleasantly. A common mistake is placing the dish into an oven that has not fully preheated, this leads to uneven rise and a denser cake. Also, use a sturdy pan and check for hot spots in older ovens to prevent lopsided baking. I make sure the dish is centered in the oven for even heat circulation.
In a medium bowl, whisk together the flour, sugar, cocoa powder, baking powder and salt. Add to the dry mixture the milk, vegetable oil, vanilla and walnuts (if using). Stir with a rubber spatula until combined and spread into an even layer in the prepared pan.: As you whisk the dry ingredients, you should notice a uniform, cocoa dusted color and a faint chocolate scent that deepens when the wet ingredients join. Stirring with a rubber spatula helps you fold gently rather than overwork the batter, preserving tenderness. The batter should be smooth, slightly thick yet pourable, and when spread the surface should look even and free of large air pockets. A common error here is over mixing which develops gluten and leads to a tougher top. I take my time to scrape the bowl sides and press the batter into the corners so the final layer bakes evenly.
In a small bowl, combine the brown sugar and cocoa powder, and sprinkle over the batter (do not stir!!). Pour the hot water evenly over the cake (do not stir!!).: When you mix the brown sugar and surface cocoa, the aroma becomes molasses sweet and deeply chocolatey, hinting at the sauce to come. Sprinkling this blend evenly is crucial so the sauce forms uniformly; you should see a light, textured dusting across the batter. Pouring hot water makes a hissing whisper as it hits the pan, and steam immediately rises, carrying warm chocolate scents. The heat dissolves the sugar into the water, allowing the sauce to form beneath the cake. A typical mistake is stirring after pouring, which prevents the pudding from separating and can ruin the texture. I pour the water in a steady, even stream to avoid displacing the sugar layer and to ensure consistent sauce formation.
Bake for 40 to 45 minutes (40 minutes if using 9-inch pan, 45 minutes if using an 8-inch pan) and serve warm. When serving, invert the cake squares onto the plate; the pudding sauce will be on top.: As the dessert bakes you will notice the top taking on a matte, slightly crackled appearance while the edges deepen in color. The kitchen fills with an intensified chocolate aroma and a faint caramel scent from the brown sugar. Tap the top lightly, and it should feel set with a slight spring, not wet. The timing difference between pan sizes matters because a smaller pan creates a thicker top that needs more time to set without burning. Avoid over baking, which can dry the pudding and make the top overly firm. When you invert the squares, steam and glossy sauce will mingle over the top, creating that dramatic puddling effect. I let the pan cool briefly so the sauce is hot but not scalding when served.