China.
Based on the excerpt, the civil service examination system changed Chinese society by leading to the dominance of a highly educated and privileged class. This system, rooted in Confucian philosophy, incentivized students to pursue government employment, thereby creating a bureaucracy composed of individuals who were deeply versed in Confucian ideas. As a result, those who succeeded in these examinations gained significant influence and status in society, establishing a hierarchy that favored education and Confucian scholarship.