We were a strategy consulting firm. Everyone had the same skills (in theory), just different levels of experience. The office seating plan paired up a junior consultant with an experienced project leader. You'd both be at your own clients half the time. So in practice you mostly had a private office. But the other person was there enough of the time that:
(a) you wouldn't get lonely;
(b) you'd learn a lot about being an effective consultant by seeing how they worked and hearing their phone calls with clients (of course, treated as strictly confidential between the two of you); and
(c) you'd get to know each other well and you'd feel comfortable asking dumb questions despite the hierarchy difference.
(d) And also every 6 months, there was an "office move" where everyone except the partners (who had sole offices) got paired up with someone else and assigned a new two-person office. This was aligned with promotions and graduate intakes, rebalancing the junior/senior mix. (The office move also encouraged everyone to archive/throwaway notes from old projects, keeping the office tidy).
The same thing would work in software development etc.
I don't know why so many companies went to full-on open plan rather than this kind of half-way house. You get some of the space savings and none of the open plan or hot-desking disadvantages.