If using a whole coconut, prepare it by piercing the three eyes with a skewer, and drain out the liquid. Then, wrap it in a towel, place on a hard surface, such as the floor (or take it outside), and give it a firm blow with a hammer to crack it open. Use a spoon to gently lift the flesh away from the harder exterior and remove the brown skin using a potato peeler if desired.
Toast the cumin and coriander seeds in a small frying pan for about 2 minutes, then grind in a mortar and pestle. Sautee the shallots, garlic, ginger, chile flakes, and ground spices in the coconut oil and 1 tablespoon water for about 5 minutes, stirring occasionally. Add a splash of water if the mixture sticks to the pan.
Add the carrots, fresh coconut, and stock. Bring to a boil and simmer for 30 to 35 minutes until the carrots are soft.
To make the sambal, place the cilantro, grated coconut, ginger, and chile into a mini food processor and pulse to a coarse, dry paste. Stir in the lime juice and season to taste.
When the soup is ready, blend until smooth, season and serve topped with the sambal.