When I was in we did hot rack. At least 1/3 of the crew was on watch (operating the ship) at any given time so the junior folks would have two bunks assigned to three people. When you got off watch you just hopped into whichever one of the two were empty (and it may still be warm...thus the term "Hot Rack").
The nuke boats were a lot better with accomodations than the diesels. They retired the last diesel boat the day after I retired (I guess there just wasn't anyone left to run it).
First round was on ‘pig boats’ out of key west.(1971)
As low man and unqualed, I slept where I could. Including on a rack toredo.
Went to Norfolk and joined the nuclear navy.
Buck rogers stuff