This question already has an answer here:
A friend described a book he remembered reading as "It was set in a future dystopia ruled by an aristocracy fitted with mental implants. At a certain age, all children got fitted with an implant, and those whose bodies accepted the implants became/remained part of the social elite, and those who rejected it became slaves (shaved heads were important somehow in this whole process - I THINK the slaves all had shaved heads).
The story was written from the point of view of a child of one of the most elite elites, as their social group approached their implant fittings.
In the end of the story, one of the child's close friends becomes a slave, and the child finds out that who will reject their implant, and hence become a slave, is in fact decided in advance and is done to maintain the status quo.
It would have been young-adult SciFi, PROBABLY written before the '80s."
It sounds very familiar but no matter what I search for or try to remember I can't get anywhere. Does anyone recognize this plot?