What is queue
Last updated: April 1, 2026
Key Facts
- The term 'queue' comes from the French word meaning 'tail'
- In computing, queues follow the FIFO principle where the first item added is the first to be removed
- Real-world examples include checkout lines at stores, customer service wait lines, and printer job queues
- Message queues are used in software systems to manage asynchronous communication between applications
- Priority queues can be implemented to process items based on importance rather than strict order
Understanding Queues
A queue is a fundamental concept in both everyday life and computer science. In daily life, a queue is simply a line of people or objects waiting for service or processing in the order they arrived. The term originates from the French word 'queue,' meaning tail, as people stand one behind another like a tail.
Queues in Computing
In computer science and programming, a queue is a data structure that stores and manages a collection of elements following the First-In-First-Out (FIFO) principle. This means the element added first to the queue is the first one to be removed and processed. Queues are essential components in many software systems and algorithms.
How Queues Work
Queues typically have two main operations: enqueue (adding an item to the back) and dequeue (removing an item from the front). The front of the queue has the oldest item waiting to be processed, while the back has the newest items. This ordered arrangement ensures fair processing and maintains the chronological sequence of requests.
Real-World Applications
Queues are everywhere in modern systems:
- Printing - Print jobs wait in a queue before being processed by the printer
- Customer Service - Call centers and support systems use queues to manage incoming requests
- Web Servers - HTTP requests are queued and processed in order
- Message Processing - Systems use message queues to handle asynchronous communication between services
Types of Queues
While standard queues follow FIFO order, variations exist for different needs. Priority queues process items based on assigned priorities rather than strict order. Double-ended queues (deques) allow insertion and removal from both ends. Circular queues use a fixed-size buffer efficiently by reusing space as items are removed.
Queues in Modern Systems
Cloud platforms and microservices architectures heavily rely on message queues for system reliability and scalability. Services like Amazon SQS, RabbitMQ, and Apache Kafka are popular queue systems that enable asynchronous processing, decouple system components, and improve overall application resilience.
Related Questions
What is the difference between a queue and a stack?
A queue follows FIFO (first-in-first-out) order, while a stack follows LIFO (last-in-first-out) order. In a queue, the oldest item is processed first; in a stack, the most recently added item is processed first.
What is a priority queue?
A priority queue is a variant where items are processed based on assigned priority levels rather than strict arrival order. Higher priority items are dequeued before lower priority items, even if they arrived later.
What are message queues used for?
Message queues enable asynchronous communication between applications and services, decoupling components so they don't need to communicate directly. They improve system reliability, scalability, and allow processing of requests at different rates.
More What Is in Daily Life
Also in Daily Life
More "What Is" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- Wikipedia - Queue (Abstract Data Type)CC-BY-SA-4.0
- Wikipedia - QueueCC-BY-SA-4.0