The Sui Dynasty was started by a dude who knew the value of fair treatment and honesty, Emperor Wen, who when criticized for punishing his wastrel son answered:
I am the father of just five sons, not the father of all people over the land. If I agreed with you, does that mean I have to draft a Penal Code for the Emperor’s Sons? Even a man as kind as the Duke of Zhou executed his brothers, the lords of Guan and Cai, for their crimes. I am nowhere as capable as the Duke of Zhou, so I can break my own laws?
This backfired slightly on him when his second son decided that under these incredibly unfair circumstances where you couldn’t just count on nepotism, it was probably best to resort to multiple murder. I have to admit I’m almost fond of Emperor Yang. There’s something about a dude who gets his older brother judicially executed, has his father poisoned, casually orders massive architectural projects which kill millions, fights terrible and disastrous wars against Gorguryeo (in Korea), and then kills everyone who tries to desperately warn him that he is hideously unpopular and going to be murdered.
Wendi and Yangdi had some pretty conflicting priorities, in that Wendi wanted maximum utilization of practical degrees, and Yangdi wanted all to love him and despair. The historical record is unclear on how the imperial examination system rose out of the edit war that was their respective sets of educational reform, but rise it did, complete with oral examination, written examination, and letters of recommendation…
(Click through for more.) This one is really long but it could’ve been like ten pages longer. There doesn’t seem to be a good history of the imperial examination pre-Ming, which is… uh… when it worked??