Media playback is unsupported on your device Media caption Henry Chau, Lily Yue and Amelia Bian, now studying in London, talk about the culture of learning in China

China's education performance - at least in cities such as Shanghai and Hong Kong - seems to be as spectacular as the country's breakneck economic expansion, outperforming many more advanced countries.

But what is behind this success?

Eyebrows were raised when the results of the Organisation for Economic Co-operation and Development's international maths, science and reading tests - the Programme for International Student Assessment (Pisa) tests - were published.

Shanghai, taking part for the first time, came top in all three subjects.

Meanwhile, Hong Kong which was performing well in the last decade of British rule, has gone from good to great. In this global ranking, it came fourth in reading, second in maths and third in science.

These two Chinese cities - there was no national ranking for China - had outstripped leading education systems around the world.

The results for Beijing, not yet released, are not quite as spectacular. "But they are still high," says Andreas Schleicher, the OECD's head of education statistics and indicators.

Cheng Kai-Ming, Professor of Education at Hong Kong University, and closely involved in the Hong Kong and Shanghai tests, puts the results down to "a devotion to education not shared by some other cultures".

Competitive exams

More than 80% of Shanghai's older secondary students attend after-school tutoring. They may spend another three to four hours each day on homework under close parental supervision.

WHAT MAKES SCHOOLS WORK? Image caption Shanghai and Hong Kong schools have gone straight to the top of international league tables The World Bank has looked at the distinguishing features of successful school systems. According to the World Bank's education specialist, Harry Patrinos, this includes: improving the quality of teachers and making sure that teachers are highly regarded; providing information to make schools accountable and giving autonomy to schools and head teachers. Putting money into the system does not necessarily lead to better results. This matters not only for individual pupils but for the well-being of countries, he says, because improving educational performance has a direct impact on improving economic performance. Successful school systems include Finland and South Korea.

Such diligence also reflects the ferociously competitive university entrance examinations.

"Not all Chinese parents are 'tiger mothers'," insists Prof Cheng. "But certainly they are devoted to their children's education."

Certainly both these open and outward-looking cities set great store by education, willing to adopt the best educational practices from around the world to ensure success. In Hong Kong, education accounts for more than one-fifth of entire government spending every year.

"Shanghai and Hong Kong are small education systems, virtually city states, with a concentration of ideas, manpower and resources for education," says Prof Cheng.

The innovation in these cities is not shared by other parts of China - not even Beijing, he says.

Under the banner "First class city, first class education", Shanghai set about systematically re-equipping classrooms, upgrading schools and revamping the curriculum in the last decade.

It got rid of the "key schools" system which concentrated resources only on top students and elite schools. Instead staff were trained in more interactive teaching methods and computers were brought in.

Showcase schools

The city's schools are now a showcase for the country. About 80% of Shanghai school leavers go to university compared to an overall average of 24% in China.

Image caption Changing China: Terracotta warriors appear as tennis players in Shanghai

Meanwhile, dynamic Hong Kong was forced into educational improvements as its industries moved to cheaper mainland Chinese areas in the 1990s. Its survival as a service and management hub for China depended on upgrading knowledge and skills.

In the last decade Hong Kong has concentrated on raising the bar and closing the gap or "lifting the floor" for all students, says a report by McKinsey management consultants.

The report, How the World's Most Improved School Systems Keep Getting Better, rated Hong Kong's education system among the best in the world.

But Hong Kong schools are undergoing another huge reform, lopping off the final year of secondary school and instead moving towards four-year university degrees from 2012 to align it with China.

Abandoning the old British model is a gamble and no-one knows how it will play out in terms of quality.

Top teachers

However, Hong Kong believes it has laid solid, unshakeable foundations.

SHANGHAI Shanghai took first place in the OECD's global school rankings for reading, maths and science

The city of 21 million has 1% of China's population and generates 12.5% of the country's income

84% of teenagers go on to higher education

80% of pupils have after-school tutors

There are now more than 200,000 overseas people in Shanghai, particularly from Japan, US and South Korea

"In the late 1990s we moved to all-graduate [teachers]. If we want to have high achievement, subject expertise is very important for secondary schools," said Catherine KK Chan, deputy secretary for education in the Hong Kong government.

Hong Kong, like Singapore, now recruits teachers from the top 30% of the graduate cohort. By contrast, according to the OECD, the US recruits from the bottom third.

Shanghai recruits teachers more broadly. But it is already a select group.

Shanghai controls who lives and works in the city through China's notorious "houkou" or permanent residency system, allowing only the best and the brightest to become residents with access to jobs and schools.

"For over 50 years Shanghai has been accumulating talent, the cream of the cream in China. That gives it an incredible advantage," says Ruth Heyhoe, former head of the Hong Kong Institute of Education, now at the University of Toronto.

Migrant children

The OECD's Mr Schleicher believes teacher training has played a part in Shanghai's success, with higher-performing teachers mentoring teachers from lower-performing schools, to raise standards across the board.

Image caption Rising schools mirror a booming economy: Shanghai's new Apple store opened last month

"What is striking about Shanghai is that there is quite a large socio-economic variability in the student population, but it does not play out in terms of its Pisa results," said Mr Schleicher.

"Some people have even suggested we did not include Shanghai's fairly large immigration population. Around 5.1% of the population are migrants from rural areas. Their children are definitely included," he said.

Last year Shanghai claimed to be the first Chinese city to provide free schooling for all migrant children. This year migrants outnumbered Shanghai-born children for the first time in state primary schools, making up 54% of the intake.

Prof Cheng agrees the Pisa results reflect a broad cross section. However the majority of migrant children are below 15 - the age at which the tests for international comparisons are taken. It is also the age of transfer to senior secondaries.

"If they were allowed to attend senior secondary schools in the city, the results would be very different," said Prof Cheng.

Even now "to some extent, where people are born largely determines their chances of educational success", said Gu Jun, a professor of sociology at Shanghai university.

Their societies are changing rapidly and for both Shanghai and Hong Kong, being top might prove to be easier than staying there.