To prepare the barfi add sugar to a pan along with 3cups of water and cardamom powder. Bring it to a boil and cook till the sugar dissolves, we need thin watery syrup. Remove from heat.
Grind together pineapple and coconut long with a dash of water to a puree. Strain the puree to extract a clear juice of pineapple and coconut. To this extract add custard powder and whisk it to avoid any lumps.
Add this mixture into the hot sugar syrup slowly and gradually mix it. Remember while adding this custard powder mixture the gas has to be off.
Once mixed start heating the pan and keep stirring. Cook till the content thickens, make sure you cook it on low heat and gradually increase the heat to medium high. After cooking for about 3mins add 1 tbsp of ghee. Mix till it incorporates completely. Once done add another tbsp of ghee and repeat the process till all of the ghee is incorporated.
You will notice that when you add ghee the mixture splits, but that it temporary. Make sure you keep scrapping the bottom and sides to incorporate all the ghee.
Once all the ghee is used cook the mixture to the point that when you take a spoonful of it and upturn it, it does not fall or falls very slowly.
Post that remove the block of barfi by upturning the tray, remove the butter paper and cut it into squares or any desired shape. Garnish it with chopped nuts and serve.
Pineapple and coconut barfi will stay good to eat for a week in a fridge.At this stage turn off the heat and empty it out in a greased tray or line a tray with butter paper and then pour it over it. At this stage you can also add nuts to it or simply garnish them later. Allow it to cool completely and then put it in a fridge for at least an hour.