Sleep is a necessary requirement for pilots during long-hour flights. All country’s aviation regulators govern the amount of sleep that flight crews must get and the maximum hours of work per day.
There are multiple pilots on each flight so that one crew member can rest while other takes the responsibility. Therefore, private sleeping compartments are made in Boeing and Airbus where pilots can sleep.
These private cabins are usually present behind the cockpit and are restricted to crew members only. Passengers are not given access for security concerns. Moreover, it is prohibited to sleep in the compartment during the takeoff and landing as all the pilots must be present in the cockpit during critical phases of flight.
Each bunker is installed with a comfortable mattress, lights for reading, and a phone that enables the pilot to speak directly to the cockpit in case of emergencies. Additionally, the resting time is divided equally among the pilots.