James Gosling, the creator of the Java programming language, wrote on Facebook that "In the time between Sun and LRI I’d get lines like 'We normally don’t hire people your age, but in your case we might make an exception'". Even a world-class computer programmer is not immune from implicit age discrimination during a job interview. (Or should we call it natural selection in a modern society?) For a long time, I've been thinking of the optimal ages for various professions. They are not necessarily the same as the actual mean ages of the workers in their respective occupations, even though for lack of data, the latter can be substituted as an approximation. For example, the 2015 Labor Department statistics shows that "computer and mathematical occupations" have a mean age of 40.8, and "architecture and engineering occupations" 43.6. But as we all know, IT professionals are much less popular after age 40, or even earlier, while most engineers continue to enjoy their seniority well into 50, simply because the engineering technology is not evolving as fast as computer technology and accumulated personal experience matters.
"Optimal" is in the eyes of the beholder. As a result, no objective measurement may be constructed. Instead, a survey among a large number of employers is needed. As of today, I know of no such data available. But I can imagine that athletes take the youngest extreme, doctors probably take the other, and IT professionals are not too far away from athletes. Each category can be further divided. Shooting athletes don't have to be as young as runners. Database administration is a job well sought after by ageing programmers, for job security as well as a better pay. In China, traditional Chinese doctors (TCM practitioners) will undoubtedly be sitting at the oldest extreme of this age-popularity axis, surpassing non-TCM doctors (called xīyī in Chinese). In all countries, old glass blowers are dearly loved grandpas, who would kindly reject the job offer for a happy retirement life, at least before the time 3-D printing catches up with human glass blowing.