Queue data structure is used in the following way:
Queues are commonly used as waiting lists for individual shared resources like printers, discs, and CPUs.
Queues are used for asynchronous data transfer (when the data transfer rate between two processes differs), such as pipes, file IO, and sockets.
Most applications, such as MP3 players and CD players, use queues as buffers.
Queues are used to manage playlists in the media player by adding and removing songs.
In the operating system, queues are used to handle interrupts.