New research suggests it may be wise to revise for and sit exams on an empty stomach as hunger can help with the creation and retrieval of memories.
Hunger is controlled by a key hormone
American scientists found the hunger hormone ghrelin can increase the number of nerve connections in the area of the brain where new memories are formed.
The study raises hopes of drugs to treat impaired learning and memory in diseases such as Alzheimer's.
The Yale University study features in the journal Nature Neuroscience.
Ghrelin is released by the empty stomach into the bloodstream, and is known to activate receptors throughout the brain.
Scientists already knew that the hormone acts on an area of the brain called the hypothalamus to trigger feelings of hunger.
However, the hormone's effect elsewhere in the brain has remained something of a mystery.
The Yale team has discovered that it seems to impact on the functioning of a second area known as the hippocampus, which is known to be essential to learning.
The researchers found mice bred to lack the ghrelin gene had 25% fewer 'synaptic' connections between nerve cells in this area.
They also showed that injecting normal mice with extra ghrelin increased the number of synapses in the hippocampus - and improved the animals' performance in several learning and memory tests.
Writing in the journal, the researchers said: "The study provides evidence that ghrelin may control higher brain functions and may represent a molecular link between learning capabilities and energy metabolism."
The researchers say it might be possible to use the hormone to develop new drugs to combat impaired learning and memory, but warn that weight gain could be a side effect.
Professor Stephen Bloom, an expert in appetite regulation at Imperial College London, told the BBC News website: "Memory can be switched on and off, and often it is switched on at times of stress.
"The paper is pretty interesting and it is entirely plausible that we are more alert and keyed up to both remember and recall more readily when stressed by hunger.
"If we weren't our individual forbears might have died out in the competition for food."