Pasta margherita is not pasta, as we think of pasta, but rather a cake that has nothing to do with spaghetti.
Recipes vary. Some use flour, some don’t . All use powdered sugar and potato starch. Some versions add lemon juice.
The simplest recipes for pasta margherita use only 4 ingredients, but they are deceptive: they are still a lot of work.
Some versions have you beat the batter for half an hour; other versions, to avoid this will use a chemical leavener, or use an equal amount of flour and potato starch.
Some are served on their own, with a topping perhaps of stiff uncooked egg white with nonpareilles sprinkled on; others are used in making other desserts such as the Neapolitan version of Zuppa Inglese.
You can buy pasta margherita already made in stores in Italy.
The cake is very similar to pasta paradiso.
Beat together well the egg yolks with the sugar. Add the juice from the lemon, then the flour a bit at a time. Beat for about 1/2 hour. Beat the egg whites stiff, then fold into the rest of the mixture carefully. Butter a cake pan, and dust it with icing sugar and flour. Put in an oven already heated to 375 F / 180 C for about 30 minutes. It’s done when the point of a knife comes out clean. Let rest for a few minutes in the pan, then turn out onto a cake rack.