On the first day of term at a secondary school in the desert of northern Kenya, Esther Nyakong, the head girl, leads her fellow pupils in assembly prayers in the yard.

It is 7:15 am, and everyone has already been in class for more than two hours.

"I don't need to remind you this is exam time," Esther, from South Sudan, tells the 340 students, all girls and 90 per cent of them refugees, standing beneath the rising sun in their smart uniforms of blue tartan skirts and turquoise shirts. "Once you finish an exam, go and study for the next one. Let's not be found loitering, this is the time we all need to focus."

Kenya: Learning to beat the odds in Kakuma

Providing refugee children and adolescents with an education wherever they find safety is a core humanitarian service, yet many do not have the opportunity. Esther, 18, did not attend school from late 2008 through to early 2011.

Constant insecurity in South Sudan's capital, Juba, forced her to flee to Kenya with her mother and two older sisters. Processing the paperwork to continue her education at Kakuma refugee camp, near the border with South Sudan, took another two years.

Today, she has caught up and is among the brightest pupils at Morneau Shepell Secondary School for Girls, a boarding school managed by UNHCR and funded by a Canadian human resources company. She is on track to complete high school in 2017 with grades that should make her confident of a place at university.

"There are a lot of people who don't achieve this, but I really believe in myself."

"Beggars cannot be choosers, but my wish and my dream is to study medicine in Canada and specialize in brain surgery, to be the first South Sudanese female neurosurgeon," she said. Her role model is Ben Carson, an American neurosurgeon and former US presidential candidate, whose autobiography she found in the school library.

"People ask me, ‘Will you really make it?’" she said with a grin. "I say wait and see. Yes, there are a lot of people who don't achieve this, but I really believe in myself."

Esther has already beaten the odds to make it this far. Her childhood was wracked by war, forcing her to flee from home at age 10. The chances of a refugee completing secondary school are slim, especially for a girl. The chance of reaching university verges on statistical fantasy. Only one in every 100 of the world's refugees go on to tertiary education.

There are about 74,000 school-age children at Kakuma, but fewer than one in four reach secondary school. For girls the odds are even worse: only one in 10 makes it to high school. Traditionally among Esther's people, girls are removed from education early, to help with domestic chores or to be married while still teenagers to earn lucrative dowries for their parents.

Apart from issues of culture, class size is another hurdle. At Kakuma's Mogadishu Primary School, one of 22 feeding into the camp's five secondary schools, there are 31 teachers for 2,661 students. The three youngest classes have no desks or chairs, and the pupils must sit on the dirt floor.

Nonetheless, Joseph Waiyaki, the head teacher, proudly lists last year's results: "We had 101 pupils sit the exams," he said. “One hundred passed." The Kenyan national average is 75 per cent.

More than 4,000 primary school pupils are expected to earn the grades for secondary education this year, but there are only 1,000 places at the five high schools. To try to accommodate everyone, one school has divided its pupils into two groups, using the same classrooms and facilities for one full enrolment of students from 6 am to noon, and another from noon to 6pm. Others endure 80 pupils per class, double the recommended maximum.

"Yes these are refugees, but they are children like any others around the world," said Irene Kinyanjui, the principal at Esther's Morneau Shepell Secondary School. "Education is their only source of hope that they will be able to transform their lives and escape their situation here."

"Education is their only source of hope that they will be able to transform their lives.”

Outside term time, Esther stays with her cousin Rebecca Nyandeng, 31, at her mud-walled, tin-roofed home in the camp. Rebecca has six children between the ages of three and 17. She mends clothes for a living, using an antiquated pedal-powered sewing machine. In a good month, she makes US$30.

"I would have liked to go to school, but when I was only 14 my parents forced me to be married," she said. "I would have been in a better position if I had been able to stay in school."

At Morneau Shepell School, assembly is over and the girls are rushing to their next mock exam. For Esther, it is an important one: biology. Beneath her confidence, there are worries.

"By now, we should know how to dissect a rat," she says. "Other schools will have done that, but here there are no facilities, no chemicals, no scalpels. I really wish we had been able to learn that already. It might be too late. It's not too late, is it?"