Hunger is a motivational state that drives eating and food-seeking behaviour. In a psychological sense, hunger sets the goal that guides an animal in the pursuit of food. The biological basis underlying this purposive, goal-directed nature of hunger has been under intense investigation. With its rich behavioural repertoire and genetically tractable nervous system, the fruit fly Drosophila melanogaster has emerged as an excellent model system for studying the neural basis of hunger and hunger-driven behaviour. Here, we review our current understanding of how hunger is sensed, encoded and translated into foraging and feeding behaviours in the fruit fly.