Sieve gram flour directly to a wide heavy bottom pan. Turn on the flame and dry roast the besan stirring continuously for 5 minutes on a low flame.
Be attentive as we don't want the color of the besan to change but want it to loose the raw flavor. So keep stirring. When you smell it good turn off the heat.
Pour 4 to 6 tablespoons ghee and mix well to a smooth paste. Then add another 2 to 4 tablespoons and mix well. There should be no lumps in the flour mixture. If your ghee is solid, put the pan on a low heat on the stove until the ghee melts & then mix well. Set this aside.
Grease a tray or line with a parchment paper. You can use a 6 or 7 inch cake tray.
Add sugar and water to a heavy bottom pan and cook until you see an almost 1 string consistency, but not a full 1 string consistency. It is sticky and you see the string breaks when you check a drop of syrup in between your thumb and index finger.
Pour the besan and ghee mixture all at once to the sugar syrup and mix continuously non-stop until it becomes a uniform mixture.
Cook this stirring continuously on a low flame for 2 minutes. Then pour ¼ cup ghee and incorporate it into the Mysore pak mixture again.
When you see all of the ghee is absorbed, add another 2 tablespoons ghee and incorporate it again.
You should see no ghee separating at this stage. Then add the last 2 tbsps of ghee in batches ensuring it is absorbed by the mixture.
Keep stirring all this constantly to avoid burning. At the last stage you will see the mixture turns thick and will leave a trail in the pan. Turn off the heat.
Testing - You can test by taking a small portion of the mixture into a spoon. Cool quickly and roll to a ball. It should be non-sticky and soft. Be quick at this stage.
Pour all of the mixture at once to the greased and lined tray.
Let it cool for 5 to 6 mins on a wired rack so it won't sweat at the bottom.
After 5 to 6 mins or when it firms up a bit, draw lines. If using a 6 inch tray cut to 9 pieces. If using a 7 inch tray slice to 12 pieces.
Cool it fully for another 30 mins or so. Slice the Mysore pak and store it in air tight container.