I think most people here would agree that it's not a race. If your legs are fatigued, ride slower or take a break. Eat what you want when you want to. If you go to road biking you will get different answers.
Sometimes I will try to maximize calories per dollar at the gas station, but that usually means eating something gross.