Start by preheating your oven to 350°F (175°C).
In a medium saucepan, whisk together sugar, flour, and salt.
In a separate bowl, beat the egg yolks and gradually add milk, ensuring a smooth consistency.
Combine the egg mixture with the dry ingredients in the saucepan and cook over medium heat until the mixture thickens.
Remove from heat and add vanilla extract, stirring until well incorporated.
Create layers in your baking dish: start with a base of vanilla wafers, followed by a layer of sliced bananas, and pour a portion of the custard over them.
Repeat the layers until you've used all the ingredients, finishing with a layer of custard on top.
Bake in the preheated oven for approximately 15-20 minutes or until golden brown.
Allow the pudding to cool, then refrigerate for at least 4 hours or overnight for optimal flavor.