Hot Bunking or Hot Racking was the practice within Starfleet and prior military organizations of assigning more than one person to a bed, also known as a rack, in order to reduce the amount of space required for sleeping on a ship.
Among humans this practice was followed as early as the 16th century. Hot bunking was particularly used with submarines as space was at a premium on such vessels. In the Federation the practice survived as late as the 23rd century; crew members on board Archer-class scout ships shared four sleeping spaces via hot bunking. (VAN novel: Harbinger)