For two days in early June every year, China comes to a standstill as high school students who are about to graduate take their college entrance exams. Literally the "higher examination", the gaokao is a national event on a par with a public holiday, but much less fun. Construction work is halted near examination halls, so as not to disturb the students, and traffic is diverted. Ambulances are on call outside in case of nervous collapses, and police cars patrol to keep the streets quiet. Radio talkshow hosts discuss the format and questions in painstaking detail, and when the results come out, the top scorers are feted nationally. A high or low mark determines life opportunities and earning potential. That score is the most important number of any Chinese child's life, the culmination of years of schooling, memorisation and constant stress.

On 8 June, the final afternoon of this year's gaokao, parents of exam takers at one school in Beijing were packed tight around the school gate, jostling to get to the front of the crowd where a white metal barrier held them back. Special security guards handed out water bottles and cheap paper fans, while another manned a first aid stand under a large parasol. Cars were parked all the way around the bend of the road leading to the gate, simmering in the summer heat. "They're all here to pick up their kids," a city police officer patiently explained to a driver struggling to find a space. A red banner above the barrier declared the school a "National unified gaokao examination point". At the first sign of movement inside, the parents pushed in closer, craning their necks to spot their children emerging.

Shortly after 5pm, a student named Yuan Qi walked out clutching a clear pencil case and wearing a dazed expression. Around him, hundreds of exam-takers celebrated the end of their ordeal. Some clutched bouquets of flowers given to them by their parents; others posed awkwardly for photographs. Yuan Qi's father, an administrator in the People's Liberation Army, was dressed in shorts and a polo neck. He had been at the front of the crowd, holding his phone up high to record the moment. But when his son came out, he greeted him silently and led him away from the hubbub to where his mother was waiting. She took his pencil case to stop him fidgeting with it. "Hard?" another parent asked Yuan Qi as they passed. "Depends which subject," he replied. His father beamed with pride.

Yuan Qi is 18, thin and wiry, with blue half-rim spectacles, close-cropped hair and budding wisps on his upper lip. A student at Beijing 101 school, one of the capital's most prestigious boarding schools, he is the nervous sort - constantly fiddling with stationery or picking at his fingers. He has a habit of rushing to the end of his sentences, slurring his words when excited, as if frustrated that telepathy is not an option. Ever since he was a young boy, growing up in Hebei, the province surrounding Beijing, Yuan Qi has had a talent for maths, science and problem solving. He loves reading murder mysteries, especially Agatha Christie novels in Chinese translation, which is how he came up with his English name - Hercule - although his moustache is yet to live up to it.

Membership Event: The Long Read live at the Hospital Club

The first time a teacher of his mentioned the gaokao, Yuan Qi was in primary school. Used as a distant incentive for working hard, the word kept cropping up in school and at the dinner table until it dawned on him just how high the stakes were. While college entrance is competitive in any country, in China the top universities can select as few as one in 50,000 students. Competition is intense for white-collar jobs, with a graduate unemployment rate of about 16%, and which college a student goes to has an immediate impact on career and even marriage prospects. That placement is decided by a single factor: their three-digit gaokao score.

Spy cameras, radios and earpieces that transmit questions and answers have been found hidden in pens and underwear

With so much to gain or lose, cheating is a big problem. Spy cameras, radio devices and earpieces that transmit questions and receive answers have been found hidden in jewellery, spectacles, wallets, pens, rulers and underwear. Most examination rooms install CCTV cameras, and some use metal detectors. Last year, police busted a syndicate in Jiangxi province, where professional exam-takers were charging parents up to a million yuan (£121,300) to pose as students. In Luoyang, a city in Henan province, examiners deployed a drone to hover above school buildings and scan for radio signals sent in or out. Fingerprint and iris-matching has been used to verify the identity of students. Exam papers are escorted to schools by security guards and monitored with GPS trackers, while the examiners who draft them are kept under close scrutiny in order to avoid leaks. This year, new regulations came into effect that could sentence cheats to up to seven years in prison.

Yuan Qi was quietly confident. In his mocks he was averaging in the 690s, out of a maximum of 750 - good enough to get into the capital's elite universities. He had been cramming for 12 hours a day in the months leading up to the test, with extra classes at weekends. Since March, he had been operating on just six or seven hours sleep a night. Every possible step had been taken to maximise his chances of succeeding. The day before the first morning paper, his parents had rented a hotel room next to Tsinghua University middle school, where he would sit his papers, so that they could arrange his meals and attend to his every other need. By that point, Yuan Qi had spent so much time doing mock exams that he was totally inured to the real thing, which passed in a haze.

"It went about usual," he told me as we walked back to his hotel, massaging his wrist. "Nothing out of the ordinary. Now I just want to go home and play some games." Yuan Qi's father was still recording videos of him, still grinning. "The exam is very nerve-racking, and each time when I was standing outside, before it began, I was terrified. But when you're actually taking it it's not so bad." Now that the struggle was over, there was nothing he could do but wait for the result.

The gaokao is emblematic of the Chinese education system as a whole. In the west, it is often seen as monolithic and rote; in China as tough but fair. In Europe and America, there is the notion that Chinese schools produce automatons incapable of critical thought; in China, many seem to think that western classrooms are full of students standing on desks and ripping up textbooks, à la Dead Poets Society. Yet, where the Chinese model used to be roundly criticised for rewarding rote learning, now the system's gruelling schedule and supposed high standards are increasingly admired overseas. Thomas Friedman, the New York Times columnist, has praised Shanghai's school system with at times absurd hyperbole. (One column was fawningly titled "The Shanghai Secret".) Last year, the BBC invited two Chinese teachers to take over a sixth-form class in the documentary Are Our Kids Tough Enough? (Spoiler: they weren't, but nor were the teachers.)

In China there are no illusions about the system being perfect. The exam is widely criticised for putting impossible pressures on children. Dissatisfaction with the gaokao is one reason that, among wealthier segments of the population, large numbers of students are choosing to study abroad. But, ultimately, most people support it, or at least see no alternative. "China has too many people," is a common refrain, used to excuse everything from urban traffic to rural poverty. Given the intense competition for finite higher education resources, the argument goes, there has to be some way to separate the wheat from the chaff, and to give hardworking students from poorer backgrounds a chance to rise to the top.

The tradition of a single exam that decides a young person's prospects is one that goes back to antiquity in China. The imperial examinations or keju, which tested applicants for government office, was introduced in the Han dynasty (206BC to AD220), and became the sole criterion for selection from the 7th century until its abolition in 1905. Aspiring bureaucrats sat a three-day exam locked inside a single cell, in which they also slept and ate. The "eight-legged essay" was the most important paper, an argument in eight sections that elaborated on a theme while quoting from classics such as Confucius and Mencius. All applicants were checked for hidden scrolls; writing quotes on underwear was a popular form of cheating until examiners cottoned on. The pass rate was 1%. Nervous collapses were routine. There is even a ghost-deity associated with exams in China: Zhong Kui, a scholar who killed himself when he was denied first place.

While not a direct descendant, the gaokao is generally considered a distant relation of the keju. First instituted in 1952 under the new Communist government, the gaokao was suspended during the cultural revolution. Most universities were closed, and remaining college places were assigned according to political background rather than academic ability. It was only in 1977, the year after Mao's death, that the gaokao resumed in its modern form. The first sitting was open to generations who had been deprived of the chance to pursue higher education - 5.7 million people enrolled, competing for just 220,000 university seats. Since 1978, it has been held every summer.

The gaokao is made up of four three-hour papers: Chinese, English, maths and a choice of either sciences (biology, chemistry, physics) or humanities (geography, history, politics). The questions are mostly multiple-choice or fill-in-the-gap, and are notoriously hard - the maths paper has been compared to university-level maths in the UK. But for many students, the most intimidating element is the essay in the Chinese exam. Students are given an hour to write on one of two prompts, which are often infuriatingly elliptical. Prompts in 2015 included "Do butterfly wings have colours?" and "Who do you admire the most? A biotechnology researcher, a welding engineering technician or a photographer?". This summer, Yuan Qi's choice was between "Old accent" and "Mysterious bookmark". (He picked old accent.)

It is no surprise that, for many students, the pressure heaped on them by parents, teachers and themselves, is overwhelming. It is possible to retake the exam one year later, but if a student continues to fail there is no safety net or alternative path to university. Suicides are a regular feature of every exam season; a 2014 study claimed that exam stress was a contributing factor in 93% of cases in which school students took their own lives. Last year, a middle school in Hebei province fenced off its upper-floor dormitory balconies with grates, after two students jumped to their deaths in the months leading up to the gaokao. And the academic stress starts early - in July a 10-year-old boy tried to kill himself in oncoming traffic after fighting with his mother about homework. But still the study mill grinds on.

Yuan Qi in his bedroom at his parents' apartment.




Yuan Qi in his bedroom at his parents' apartment in Beijing. Photograph: Gilles Sabrié for the Guardian

In April, two months before the exam, the campus of Yuan Qi's school was deceptively tranquil. A tree-lined boulevard led up to Beijing 101's front entrance, where two guards with truncheons watched over the security gate. Inside, the school buildings glistened in the sun, surrounded by spacious sports grounds and a lake with a goose house and lotus flowers. Students walked around in colour-coded slacks that, like all school uniforms in China, more closely resembled pyjamas: dark blue for year 11, mauve and white for year 12, purple for year 13. The school nestles into the west flank of Beijing's old Summer Palace - once the relaxation grounds of Qing dynasty emperors - and a back gate connects directly to the garden ruins. Founded in 1946, Beijing 101 was initially set up to educate the children of China's top officials, and it still has many such students among its ranks.

It was an accomplishment for Yuan Qi to even be there. At his local primary school in Hebei province, there had been 70 to 80 children in each class. The school's football pitch was never used, as none of the teachers knew the rules. Yuan Qi's residency papers, or hukou, dictated that he should have stayed in Hebei for middle school, but his father used his connections in the People's Liberation Army and arranged a transfer to Beijing, with a new hukou. Once there, Yuan Qi enrolled in a better middle school and, thanks to a good performance in the zhongkao - the entrance exam for high school - got into Beijing 101 at the age of 16. Yuan Qi was now one step closer to securing his future at the college he dreamed of attending.

Just a hundred metres down the road from Beijing 101, in the heart of the city's university district, lies Peking University (or Beida, as it's known in China). With its illustrious history, roll call of famous alumni and romantic campus dotted with lakes and stone bridges, Beida is the Chinese equivalent of Oxford or Cambridge. Ever since his parents first told him about it as a child, Yuan Qi had always dreamed of going there to study maths. His parents and teachers were encouraging, but even their expectations, he told me, were nothing like the pressure he put on himself.

"In middle school I realised that primary school was easy," he said. "And in high school I realised that middle school was easy." At Beijing 101, classes had just 20 to 30 students, but the work was twice as intensive as before. As Yuan Qi's grades were good, he was put into one of four "experimental classes" in his year, which went at an even faster pace. And on top of his regular subjects, like all Chinese students, he also took two hours of politics class each week. They included the compulsory modules of Mao Zedong thought and Deng Xiaoping economic theory, which were introduced in 1991 as part of a patriotic education campaign. I ordered online one of the politics textbooks that Yuan Qi would be studying from. It was titled Integrity of Thought, and a typical page featured a cartoon of three boys sitting around a table discussing the latest government initiatives (as one does), with an accompanying discussion question for students: "What are the everyday applications of these laws?"

The routine at Beijing 101 is punishing. At 6.30am Yuan Qi was out of his dorm bed, and he was in the canteen for breakfast by 6.50. At 7.20 came half an hour of self-study reading time. From 8am he had five 40-minute classes, broken by a half an hour of group calisthenics in the yard - a thousand students doing jumping jacks in unison - or running around the grounds. Another three afternoon classes were interrupted by five minutes of eye exercises, during which students massaged their tired brows while a recorded track told them to rub behind their ears and press their temples. School broke at 4.05pm, but there was still another three or four hours of homework to be completed before bed.

As summer arrived, the pace picked up for Yuan Qi and his classmates. Almost all classes were now spent looking at past gaokao papers in methodical detail. After school, there were two extra hours of mock exams every day, on top of the homework, and five additional classes on Saturday. On Sundays, Yuan Qi's parents had arranged private tuition for him in English and Chinese. His only relaxation was playing computer games, but whereas in middle school he had enjoyed complex online roleplayers, now he only had time for smartphone apps.

When I visited Beijing 101, the scene was not as disciplined as I had expected. School pupils in China are kids, after all, not robots - they goof around, joke, talk over each other. At the front gate as I waited to be let in, three boys were lifting up a fourth, giving him a wedgie. Inside was a bulletin board listing extra-curricular activities, from drama to traditional crosstalk comedy performances. A corrugated steel fence next to a basketball court was covered in graffiti, albeit sanctioned by the teachers and expletive-free: V for Vendetta; an alien face with the words "Once I was normal"; "Big Brother is Watching You", with one of the letters replaced with a swastika. But in class the students quietened down, listened carefully and took notes. In years of reporting in China, I have never heard a single student grumble about their workload. To them, it is simply normal.

The campus of Beijing University (Beida), one of China's top universities.




The campus of Beijing University (Beida), one of China's top universities. Photograph: Gilles Sabrié for the Guardian

I sat in on one of Yuan Qi's maths classes while the teacher - a tough but kindly woman with a strong Beijing accent - walked through exam-paper equations that left me feeling like a dunce. Yuan Qi followed along at his white plastic desk, where sheets covered in intricate geometrical squiggles were sprawled out next to his pencil case and a roll of toilet paper for blowing his nose. At the back of the classroom, a cartoon of Xi Jinping was drawn in coloured chalk on the blackboard next to the words "Wishing you a successful exam" and a reminder: "46 days". This countdown is a national obsession. If you search for "gaokao" on Baidu, China's largest search engine, in the months leading up to the exam, an image appears at the top of the results page, with a clock counting down to the start of the exam, next to a cartoon of a schoolgirl riding a flying book.

Before Yuan Qi knew it, the countdown was at 30 days. 15. Ten. Five. With just three days left, on 4 June - while the rest of Beijing either forgot or ignored the 27th anniversary of the Tiananmen Square massacre - Beijing 101 held a big pre-exam event in the main lecture hall: part pep talk, part rules refresher. Yuan Qi and his friends joked among themselves, half-listening while the headteacher went through the exam drill in excruciating detail, from how students should register with their IDs to what to do if they needed extra paper. At the end, all the teachers lined up and waved at their pupils from under a PowerPoint slide that read: "We have already done abundant preparation! Wishing you every success! Awaiting the good news!"

With that, 12 years of primary and secondary education were finished. The climax of it all was in sight. Yuan Qi went home, and got his head straight for the first paper.

In China, the gaokao is sometimes described as a dumuqiao, which translates as "single-log bridge" - a difficult path that everyone has to walk. But some have better shoes than others. Rich families lay on extra tutoring for their children in what Jiang Xueqin, a Canadian-Chinese education scholar, described as an "arms race" among households looking to increase their child's chances. Provinces with larger populations have tougher standards of entry into the best universities, while those that are sparsely populated set a lower bar. (This loophole has led to illegal "gaokao migrants" transferring to schools in Inner Mongolia just before the exam.) Students in Beijing and Shanghai get special privileges - they are the beneficiaries of generous local quotas for the best universities - despite being more likely to be privileged anyway.

"Scores are highly correlated with socioeconomic status," Trey Menefee, a lecturer at the Hong Kong Institute of Education, told me. I asked if he considered the exam meritocratic. "I don't," he replied, "but almost every Chinese person does ... Or it's meritocratic only because it's equally bad for everyone."

There has been talk of reforming the gaokao for as long as it has existed, but little ever comes of it. The major concession in the early 2000s was to allow separate provinces to draft their own exam papers. This year, top universities trialled interviews with students who show special promise at school. Those who impress may be awarded extra points, which are added to their final exam score. Many students and their families have also called for the English paper - a stumbling block for many without access to private tuition - to be made optional.

Students revise for the gaokao in Jiaxing, China.




Students revise for the
gaokao in Jiaxing, China. Photograph: VCG/VCG via Getty Images

Meanwhile, relatively small changes can meet fierce resistance. In May, the government announced that a quota of 80,000 university places in Jiangsu and Hubei provinces would be reserved for students from poorer regions, in an effort to address provincial inequality. But mobs of middle-class parents took to the streets in six cities to protest against the measures, fearful that positive discrimination in favour of poorer families meant their own children would lose out. "The gaokao isn't for everyone," Jiang Xueqin told me. "It's for the middle class."

When it comes to more comprehensive reform, the general consensus among education scholars in China is that any alternative would be too easily manipulated by the rich. Were coursework or regular school marks to be taken into account alongside exam grades, bribery would be even more rampant than it already is (parents often give "red packages" stuffed with banknotes to teachers in return for special attention for their child in class, or simply a seat nearer the front). The same goes for direct university admission. And so, futures are still decided by how well each child performs at a cramped desk in a closed room for two days in early June.

Not every student in China signs off their fate to the gaokao. Although more than nine million people still take it every year, the number is declining. This is partly down to the rising popularity of vocational courses, which often offer better prospects of finding a job after graduation, especially for those whose grades are less competitive. Above all, more and more students are heading abroad for university, and increasingly for high school. It used to be that the best students went to Beida; now they go to Harvard. There are more than 300,000 Chinese overseas students in US higher education and 90,000 in the UK. While many colleges overseas recognise the gaokao, it isn't necessary to take it to secure a place. Just as China's moneyed classes are deciding to protect their wealth by placing it overseas, their children are opting out of the country's education system on an industrial scale.

One of Yuan Qi's classmates in the experimental class at Beijing 101, Jiang Xinye, joined the exodus. During her last year of school, by arrangement with her teachers, she stopped coming to class and instead prepared applications to US colleges. Her parents hired the services of Bridge International Education, a company that helps students select colleges and pull application materials together (the bill was roughly £8,000; other companies charge up to £20,000). Instead of the gaokao she took the TOEFL, an English proficiency exam, and her SAT, the US college-entrance aptitude test. She settled on a major in business, and wrote in her personal statement about her experience selling phone cases at school. With the help of a college counsellor she filled in forms for 12 universities. When it was all over she accepted a place at Brandeis, a private university in Massachusetts.

Jiang Xinye feels strongly that her chosen path is preferable to that of many of her classmates. Chinese schools just teach the exams, she told me, even more so than abroad. "We don't solve problems ourselves," she said, "the teacher just tells you the right answer … and refuses to hear different voices." One time, over a bowl of bibimbap in a Korean restaurant, the conversation turned to Yuan Qi and his other classmates who remained in the system. "They don't realise that their imagination is limited. Even if they want to voice their opinions, they are too timid to challenge the teacher." This struck me as the opposite of something Yuan Qi once told me: "Everything has a right answer. Even if it's testing your argument, not the specific contents." That's why he disliked the more freeform essay question, while Jiang Xinye disliked everything else. While he sat the gaokao on 7 and 8 June, she was packing for America.

Yuan Qi often asked me what school was like in the UK. I swallowed my guilt as I mumbled something about less homework and bad food. One afternoon he used a term, qiutubeilun, which I didn't understand. I looked it up on my phone: "prisoners' dilemma", the famous paradox about mutual competition despite the benefits of cooperation. "If every [student] agreed to take it more easy, and pursue their own interests and hobbies, then the competition wouldn't be so intense," he said. "But they would rather sacrifice that free time and spend all their time studying to have a greater chance of getting a high mark, and so everyone has to follow."

Parents wait for their children to finish taking the gaokao, outside the Beijing Renmin University Affiliated High School, one of the most prestigious in the country.




Parents wait for their children to finish taking the
gaokao, outside the Beijing Renmin University Affiliated High School, one of the most prestigious in the country. Photograph: Kevin Frayer/Getty Images

Yuan Qi sat at a corner window on the second floor of McDonald's, slurping a McCafé red tea before picking apart the empty cup. It was the morning of 23 June, two weeks after he had sat the exam, and the results would be posted online in a few minutes. The greasy wrapper of a crispy chicken fillet sandwich lay curled on the tray in front of him, next to a book titled Procrastination: Why You Do It and What to Do About It NOW. (In the margins, he had scrawled phrases such as "overcome fear" and "know your weakness". Next to the sentence "You tell lies about how you organise your time", he had written, in English, "ME".) His phone was out on the tabletop and he checked it compulsively every few minutes, waiting for a text from his dad with his score.

The previous fortnight had been stressful but not idle. The day after his final exam Yuan Qi was back at the grind again, preparing for an interview at Beida - part of the new measures that now allow elite universities to meet with promising candidates. It took place a week after the gaokao: there was a written maths test, which was a breeze, and a sit-down with three Beida teachers and five other students, talking about Confucian culture and theoretical maths. The teachers liked him but the outcome was token: they could only give him a maximum of 10 points to be added to his score. After it all, he would still be just a number.

The results were released at noon. Most students checked them online, although they could also ring a hotline, or go to their school to check a printout posted on a bulletin board. Later, a full breakdown of their score would be mailed to each student, but for now it was a single mark for each exam and the all-important total, plus their ranking among other students in their province. Yuan Qi was so nervous that he couldn't bear to be at home. He asked his father to text him, and repaired to McDonald's instead.

Noon came and passed. I tried to distract him with smalltalk, but he was fiddling uncontrollably. Why hadn't his dad texted yet?

At 12:41, his phone buzzed. "What is the score that you're hoping for?"

"Just tell me, alright? ……" Yuan Qi fired back. "Don't keep me on tenterhooks …………!!!"

Another three minutes. Buzz. "Are you on the first floor or the second floor?"

"Why in hell are you asking that for?"

"Is it a good time to talk?"

"Just send the text to me, you're not allowed to ring!"

"Is anything wrong?"

Yuan Qi was visibly straining not to be rude as he replied. "Can you just send it, OK? Nothing's wrong, but if you keep not telling me then it will be!!!"

A minute passed in agonising silence. Then it came, with no gloss.

"664, ranked 1,020 in Beijing."

It was significantly lower than Yuan Qi, or his parents, had expected. Still a high mark, an achievement: 1,020th out of 61,222 examinees in Beijing. But only the top 500 had a real shot at getting into Beida, where the cutoff point was generally taken to be 680. Yuan Qi's mock results were in the 690s but this mark, in his words, was "ordinary". Not even in the top thousand.

His father texted again: "It's OK son". He stressed that they could apply to have his papers re-marked. But Yuan Qi was hyperventilating, taking short shallow breaths and pushing them out through pursed lips, as he stared at his phone. He scrolled down an online list of everyone's results in Beijing, to double-check his ranking. The Katy Perry song Teenage Dream was blasting over the stereo. His peers were posting their scores in messaging app groups for each of his classes. I didn't know what to say, and as a journalist I have never felt more intrusive as I watched a young man's hopes crumble before my eyes.

Even with the full breakdown, Yuan Qi never knew exactly why he had underperformed. It was just one of those bad exam days. A few weeks after results day, he was accepted into Beijing Aviation and Space Flight University, known as Beihang for short. It is a good college, specialising in aeronautics, but with an excellent reputation for maths - not the best of the best, but the best Yuan Qi could have got into. He would go on to start college that September.

For now, he was using his summer to do all of the things he didn't have time for while at school. He went swimming, took classes for the boardgame Go, learned how to ride a bike. And, now that it had served its purpose, his gaokao mark could be forgotten - no longer relevant, like much of the knowledge he had crammed to achieve it. Yuan Qi still didn't complain about the exam, even though, by its narrow definition of success, he had failed - just as the exam had failed to capture his individuality, his passion for learning and discovery.

"I don't feel disappointed so much as lost," he said, as we left McDonald's that day. "If it was just me, if I didn't have parents, then I would feel a bit better. But why do I feel like it's they who are the most disappointed? From when I was little, they had such high expectations."

He gathered himself, picked up his book on procrastination, and went home to finish reading it before getting ready for the next chapter.

Follow the Long Read on Twitter at @gdnlongread, or sign up to the long read weekly email here.