Way back in the Sui Dynasty, in 606 AD to be precise, Emperor Yangdi introduced something called the Keju system.
Keju was the imperial examination used in feudal times to select officials from among the intellectuals – even including the poorest members of society. The Keju system was eventually abolished under the Qing Dynasty, in 1905.