1) At least a year or two of experience at another programming job, 2) MONTHS of time studying whiteboarding, and maybe 3) A few good referrals.
I know, because I'm 34 and I have 9 years of enterprise experience. I'm trying to get into Big Tech right now (I've interviewed with Google and Amazon and I'm about to do Facebook). I'm lucky though that I have an undergrad science degree from Stanford, so I have at least some credibility in that world and many of my former peers are in that space.
The only really hard part is finding the will to study leetcode problems for hours.
I have all sorts of thoughts on the subconscious motivations behind the whiteboard grind. It's sort of a hazing ritual. Or, like so many things in America, a class filter initially designed to not be a class filter: rich people can afford to study for months for free. Poor people can't.
But ultimately, it's helpful to think of it as a game. Either play it or don't. There's no point in trying to resist it if my goal is ultimately to succeed personally. I keep getting rejected from Big Tech, but local firms are THROWING job offers at me just for being a decent, experienced programmer. I don't have much to complain about, other than the fact that I'd sort of like to make $400k for a little while and then drop out of society for a year or two.
And I think the large majority of people realize leetcode != software engineering ability. They're just trading off a low false positive rate for a high false negative rate. My wife has also been spending months studying for the LSAT. It's really quite similar except I can work as programmer without formal credentials.