What tech companies should do when it comes to hiring is hire more contract workers. Pay them well so they stick around, but at least you dont have to go through giant severance packages and contract workers arent part of head count as they technically arent employees. So if Meta or Twitter had tons of contract workers, there's tough times and the company needs to save costs you can gas them easier or simply not renew their contract. Of course, you might get loud pissy tech workers complaining about the company not extending their contract duration but this will prevent roller coaster hiring and firing cycles.
If things are going great, then slowly offer FT tenure.
My company does the same. There's a certain core of FT employees, but when work heats up we hire contract. When the company proves it can keep it up we offer FT work so the head count officially goes up over time. But in a controlled way.