This is an interesting take. I'm in my forties, will/hope to be a direct tech contributor for my full career, and definitely make sure to prepare well for whiteboard interviews. I find them fun to a degree, and I used to nail them in my youth...and still do well...

Still, the ageism take is interesting but I don't like falling back to that kind of thinking b/c it is counterproductive.

The evolution of my own performance in whiteboard interviews (and anecdotally what I've heard from other experienced developers) is interesting:

I don't feel like it is directly due to age or cognitive change/decline, but more to do with mastery/experience.

As you get more experienced in this craft (as with others), one of the most important skills you learn is navigating _context_. After solving real world problems repeatedly, you move further away from the aseptic environs of academia/learning and find that prioritization and contextual understanding is far more important to superior execution.

More explanation...

I was in an interview recently and got the typical line of puzzle coding questions. These puzzle questions are completely denuded of context (which is irritable to a professional practitioner). Or, rather, the context becomes not to solve a problem with a given set of outcome constraints (real world) ... but solve a problem and try to guess what the interviewer's particular fetishes are and try to hit those.

Do you get the impression the interviewer has a fetish for OO solutions? You better angle on that or your going to get the ding. Do they want to see you pull out a cool data structure like a min heap? You better realize that right away and get there. Generally speaking, you can "win" in these types of interviews if you angle for big-O optimality (I've found).

I've interviewed this way, myself. But over time -- with experience -- I've found that this doesn't really even correlate that well with outcome. I've interviewed and worked with people that absolutely nail these whiteboard problems but when you get them on the job, and with real world curveballs thrown at them, they freeze - either due to some issue of work ethic, psychological issue/fear, or in the absence of grades they just can't seem to make a move.

What I've found is interviewing with just a Q & A style response and digging into the work they've done and finding out how much ownership they have taken in their past work, how much curiosity they show (for any given piece of tech, just ask and see how well they know it and can even teach it to you if you don't know it), how much drive they have to get things not just done, but get them done well/solidly. Then, pretty quickly I can tell you if we've got a good hire.

Conversely I've made hires where the candidate did not do so well in the whiteboard but proceeded to excel in the professional context.

Think about this: if you have a person that is curious and drives to build the thing well... imagine the day (and these days come but not so often) that they encounter some need for a difficult algorithm. What is this conscientious person going to do? They're not going wing it and write a bad solution. They are going to go do their due diligence, their research, consult with their team members, and they'll get the right solution. So, say they are not so great with coming up with a novel algo on their own. One, that's a skill they can develop, but two -- it's a skill that's only needed in a few people on your team and then you'll overcome those steps at the intermittent times that they come through.

Now of course this ^ way of interviewing requires a personal skillset in one's self -- that is, you have to have a good work ethic, be intensely curious, very responsible, etc in order to recognize these same qualities in the candidate.

Unfortunately, I've found the industry dominates with "smart people" but who tend toward what I call a 'philistinic' position. They lean way too much on their natural intelligence and use that as an excuse to not really grow their skillset. This is what some people call 'expert beginners' and there are far more of these, ime, than truly skilled practitioners.

So -- back to the ageism thing. I think it's less ageism and more an overall industry deficit. If we understood our work better and could produce more masters/professionals then I'd think we'd see an increased valuing of experience.

Blaming it on ageism I think only deters us from getting there.