Note: the country is a socialist dystopia.
I have thought of the following system which could be a fair solution to the problem of different social classes and the distribution of people between them:
Any healthy child, regardless of the social status of his parents, is given a free and mandatory education that follows an universal one size fits all model. The education consists of a school that the child visits from the age of 7 to the age of 14 years. The minimum level of education equals that of a secondary modern school of the past British tripartite system that guarantees basic academic and manual skills. The student can attend completely free additional courses that allow specialization in various subjects if he wishes to.
At the age of 14, all children are subjected to a central examination that consists of an IQ test and of course tests their knowledge in the subjects taught at school. From then on, the further life of the children will be predestined by their results in the examination. The groups are based on the respective person
Lowest 75% - manual workers and farmers - will be sent to various factories or assigned to jobs such as street cleaners or servants. If they are not in the lowest 40% they can choose an apprenticeship instead that will lead to a more advanced manual profession (Butcher, baker, woodworker, etc...). Will either live in small apartments or in community dwellings and allowed a low life standard.
75 to 90% - will be sent to school for 2 more years in preparation for professions that include some sort of leadership and management - e.g. secretaries, supervisors at factories, teachers and officials; those who will pass a physical test will instead be drafted into the army to serve as soldiers and petty officers. Will have a better life standard and some privileges (e.g. a month's worth of vacation time per year, larger apartments or private houses).
90 to 97% - will be sent to school for 4 more years and prepared for leadership positions or to become scientists and engineers. Will coordinate factories, become military officers, work at laboratories. Doctors will also be drawn from this group. This group will enjoy large privileges such as having private houses and servants and enjoy a higher life standard that includes fresh food and advanced medical care.
97 to 99% - will be sent to school for 6 more years (and possibly study at foreign universities) and involved in the government of the country in some way. Top military officers or advisors of the leader and of his ministers will be drawn from this group. This group will enjoy a luxurious lifestyle.
best 1% (>99%) - the leadership cadre. Will study at foreign universities and be predestined to positions as military commanders, top advisors, ministers or even the leader himself.
What do you think of this system? It is intended to offer a fair opportunity to everybody, regardless of their social status. The class a child will be ranked into will be based purely on his academic performance.