Posting is not totally random.
It depends on what's "random".
My section mate and some of my platoon mates all landed outside the army after BMT. And it was only subsequent choices in vocations that separated us eventually.
Before that, the entire bunch of us were together, sleeping in the same bunk in the later phase as well.
And out of those from my bunk (BMT and later phase), those that entered the same vocation as me went on to the same unit.
Obviously the buggers on top went by the register list.