The word "mandarin" has several meanings which are all interconnected. Perhaps the most common use of it is as the name for the nine grades of Chinese administrations who were selected by a series of very difficult examinations.
In the T'ang dynasty (A.D. 618-906), this system of scholar officials was operating extremely effectively. This administration proved to be the backbone of the great Chinese Empire that persisted through about 20 successive dynasties.
The name mandarin is also given to the language spoken in China by officials and educated people and to a grotesque toy figure in Chinese costume which goes on nodding after it is shaken. The mandarin scholar-official wore yellow silk robes and so a dye obtained from a coal tar, a sweet, flattened, easily-skinned orange and a yellow liquor also have the name mandarin.