1In a small bowl stir together the sugar, fish sauce and vinegar.
2In a large, heavy skillet, heat a slick of oil over medium-high heat. Add the rice and cook for a few minutes, until heated through. Push over to one side and pour in the eggs; stir-fry until the eggs are scrambled, allowing them to cook without mixing them into the rice completely (so that you end up with detectable bits of egg); add the chili flakes, then the green onions, carrots and garlic; cook for a few more minutes.
3Pour over the fish sauce mixture, then add the bean sprouts and cook for a minute, tossing with tongs, just until heated through. Serve immediately, in shallow bowls topped with cilantro and peanuts.