Answer:
They were selected through the Imperial examination.
Step-by-step explanation:
Imperial examinations represented a civil service examination system for choosing a candidate for the state bureaucracy in China. These examinations served to ensure their knowledge of writing, the classics, and literary style and to unify the empire by giving legitimacy to imperial rule. This process of selection started with the Song dynasty onward, but its roots date from the Han dynasty.
The examination was designed to select the best candidates for appointment as bureaucrats in the government.