What is queue

Last updated: April 1, 2026

Quick Answer: A queue is a line of people or things waiting their turn for something, or in computing, a data structure that processes items in first-in-first-out (FIFO) order. It's fundamental to managing requests and tasks in sequence.

Key Facts

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:

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.

Sources

  1. Wikipedia - Queue (Abstract Data Type)CC-BY-SA-4.0
  2. Wikipedia - QueueCC-BY-SA-4.0