Mix the butter and icing sugar together until creamy. Add the egg and vanilla extract, mixing until incorporated.
Add the flour, cornstarch, and baking powder all at once. Knead the dough until it is firm. Wrap the dough in plastic wrap and refrigerate for at least one hour.
Roll the dough out on a floured work surface to a thickness of 5 mm. Cut out 5 cm/2 inches circles. You will need 40 biscuits for 20 alfajores. Place the biscuits on a baking sheet lined with parchment paper.
Bake for 10-12 minutes at 175 °C/340˚F (conventional oven), or until the edges start to brown slightly. Allow the biscuits to cool completely before filling them.
You can either spread the dulce de leche on the biscuits or pipe it on using a piping bag. Spread or pipe the dulce de leche on half of the biscuits, then place the other half on top. Gently press them together, as they are fragile and break easily.
Make sure the filling reaches the edges. Place some grated coconut in a small bowl and roll the edges of the cookies in it. You can also sprinkle some powdered sugar over the cookies.
How to store
They can be stored in a tin for one week. They can also be stored in the freezer for up to three months.