If it were my company doing layoffs, I’d hold on tight to the best and most senior engineers and lay off the entry level ones if I had to. Knowing what you have to do and why is much more important than the details of how you get there
It's a case by case basis and thinking you can apply a general rule across the organisation is completely misguided. I don't want to rehash the same arguments so just read the rest of the comments.