Line a 8 by 8 tray with parchment paper. Or select a smaller tray if you want thick burfi slices.
Place a wide heavy bottom pan or kadai over medium heat. Add ghee to start with and let melt.
Next, add the sifted besan. Mix and on low heat start roasting it while stirring continuously. At first the besan mixture will be quite thick and lumpy needing quite a bit of effort to stir. However after about 12-14 minutes, the mixture will start getting smoother and easier to stir.
Keep stirring else the besan will burn. This step needs a lot of patience. Slowly ,the mixture will change color from pale yellow to light yellow to a nice pinkish golden yellow. Don't let it become too dark or brown. It takes about 25-30 minutes for the besan to become roasted.
Take the pan off the stove and continue to stir for another 2-3 minutes. This is because the pan as well as besan is still quite hit and it will burn at bottom if left alone. Let the mixture stand while you make the sugar syrup.Note- If you wish, mix a bit of yellow food color (powdered) with the besan for a bright yellow color burfi. Combine water and sugar in a small pot and set on stove to boil over medium heat. Once bubbling, swirl the pot 1-2 times by (carefully) lifting up and swirling the pot holding it from the handle. Don't stir because sometimes the mixture starts to crystallize. Make sure that the sugar has completely dissolved.
On low heat, continue to simmer the syrup for 6-8 minutes to a 1 string consistency. Carefully, take a little syrup between your thumb and index finger, gently press them together a few times and then slowly pull them apart. The syrup should feel sticky and form a single thin string between your fingers. This is the one-string consistency we are looking for.You can also check it with a digital thermometer, which takes out some of the guesswork. After about 5 minutes of simmering, dip the thermometer into the syrup, making sure the tip doesn’t touch the bottom of the pan. For a one-string sugar syrup, you’re looking for a temperature of around 220°F (104°C). Mix in the cardamom to the syrup. Start adding the hot syrup to warm besan. Add in 3 parts. Add the syrup and mix well using a silicone spatula before adding again. You will immediately notice that the besan & ghee mixture swells up and feels light and fluffy as you incorporate syrup. Mix syrup slowing avoiding too much beating or whisking. Spread the mixture evenly in the parchment lined tray. I use both silicone spatula and flat spatula to smothen the top. Press down nuts as well. Avoid pressing the mixture too hard else the ghee will start squeezing out. Also the texture of barfi will be hard.
Leave the mixture on the kitchen counter to set for 2 hours. If its too hot outside, place in the refrigerator to set for 1.5 to 2 hours.
Using a sharp knife, cut into 12 pieces. Store the barfi pieces in an air tight container for 2 weeks. You can refrigerate as well.