Skip to content

Queues: FIFO PrincipleActivities & Teaching Strategies

Active learning helps students grasp the FIFO principle because queues are abstract until connected to concrete experiences. Physical simulations and coding activities make the order of operations visible, reducing confusion about where elements enter and leave the structure.

Grade 12Computer Science4 activities30 min50 min

Learning Objectives

  1. 1Explain the First-In, First-Out (FIFO) principle as it applies to queue data structures.
  2. 2Compare and contrast standard queues with priority queues, identifying differences in element removal order.
  3. 3Design a system using a queue to manage a sequence of incoming requests, such as print jobs or customer service calls.
  4. 4Analyze the efficiency of queue operations (enqueue, dequeue, peek) when implemented using arrays or linked lists.
  5. 5Demonstrate how queues are utilized in breadth-first search algorithms.

Want a complete lesson plan with these objectives? Generate a Mission

30 min·Small Groups

Simulation Game: Card Queue Line-Up

Provide index cards labeled with tasks or customers. Students enqueue by placing cards at the back of a line on desks, dequeue by removing from the front, and record states after each operation. Extend to simulate high-volume arrivals and discuss bottlenecks.

Prepare & details

How do priority queues differ from standard queues in real-world scheduling?

Facilitation Tip: During the Card Queue Line-Up, circulate and challenge students to predict outcomes if someone tries to remove from the middle, reinforcing FIFO rules.

Setup: Flexible space for group stations

Materials: Role cards with goals/resources, Game currency or tokens, Round tracker

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making

Coding: Build Queue Class

Pairs implement a Queue class in Python or Java with enqueue, dequeue, peek, and size methods using a list. Test with 10-15 operations, including edge cases like empty queues. Debug and compare run times for large inputs.

Prepare & details

Explain the 'First-In, First-Out' principle and its applications in computer science.

Facilitation Tip: When students Build Queue Class, require them to include comments that name each method’s purpose and where it modifies the queue.

Setup: Groups at tables with problem materials

Materials: Problem packet, Role cards (facilitator, recorder, timekeeper, reporter), Problem-solving protocol sheet, Solution evaluation rubric

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
50 min·Small Groups

Design: Print Job Scheduler

Small groups sketch a queue-based system for managing print requests, listing inputs, operations, and outputs. Code a prototype that processes jobs in FIFO order and handles pauses. Present designs to class for feedback.

Prepare & details

Design a system that uses a queue to manage incoming requests.

Facilitation Tip: For the Print Job Scheduler, ask groups to present their scheduler’s output for the same input queue to highlight how priority changes the order.

Setup: Groups at tables with problem materials

Materials: Problem packet, Role cards (facilitator, recorder, timekeeper, reporter), Problem-solving protocol sheet, Solution evaluation rubric

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
35 min·Whole Class

Comparison: Queue vs Priority

Whole class codes simple queue and priority queue classes side-by-side. Input mixed-priority tasks, run both, and chart output orders. Discuss when each structure fits specific scenarios.

Prepare & details

How do priority queues differ from standard queues in real-world scheduling?

Facilitation Tip: In the Queue vs Priority comparison, provide a shared set of operations and have students time how long it takes to retrieve each element to quantify the performance difference.

Setup: Groups at tables with problem materials

Materials: Problem packet, Role cards (facilitator, recorder, timekeeper, reporter), Problem-solving protocol sheet, Solution evaluation rubric

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management

Teaching This Topic

Start with physical simulations to build intuition before coding, because abstract data structures make more sense when tied to familiar experiences like waiting in line. Avoid rushing to implementation; let students verbalize the order of operations first. Research shows that students who act out the process before coding debug their own logic errors more effectively.

What to Expect

By the end, students should confidently implement queue operations and explain why FIFO matters in both code and real life. They should also distinguish queues from other data structures and justify their choices in scheduling scenarios.

These activities are a starting point. A full mission is the experience.

  • Complete facilitation script with teacher dialogue
  • Printable student materials, ready for class
  • Differentiation strategies for every learner
Generate a Mission

Watch Out for These Misconceptions

Common MisconceptionDuring the Card Queue Line-Up, watch for students attempting to remove cards from the middle or rear, treating the queue like a list.

What to Teach Instead

Hand each group a deck of cards and ask them to simulate a checkout line. When they try to remove a card from the middle, stop the simulation and ask the group to re-enact the scenario while following FIFO rules, then record why the attempt violated the principle.

Common MisconceptionDuring the Queue vs Priority comparison, watch for students assuming priority queues follow arrival order when the highest priority arrives last.

What to Teach Instead

Provide identical sequences of enqueue operations for both queue types. Ask groups to draw the removal order for each, then present their results side by side. Discuss why the priority queue’s output diverged and how real systems like hospital triage use this difference.

Common MisconceptionDuring Build Queue Class, watch for students conflating queue and stack behavior in their method names or logic.

What to Teach Instead

Before coding, ask students to sketch both a stack and a queue with arrows showing where elements enter and leave. Require them to label each method in their Queue Class with either "FIFO" or "LIFO" to reinforce the structural difference before implementation.

Assessment Ideas

Quick Check

After the Card Queue Line-Up simulation, display a sequence of enqueue and dequeue operations on the board. Ask students to write the queue’s state after each step and the elements dequeued in order on a half-sheet of paper.

Discussion Prompt

After the Print Job Scheduler design activity, pose the scenario: 'Your school’s printer runs out of paper mid-job. Should the scheduler stop all jobs or continue the current one? Discuss how a queue would handle this differently than a priority queue.'

Exit Ticket

After Build Queue Class, collect slips where students define 'enqueue' and 'dequeue' in their own words and give one example of where a queue is used in a computer system, such as buffering network packets or managing print jobs.

Extensions & Scaffolding

  • Challenge students to extend their Queue Class with a method that returns the size of the queue without adding new instance variables.
  • For students struggling with dequeue logic, provide a partially filled queue diagram where they must label front and rear pointers before coding.
  • Deeper exploration: Have students research and implement a circular queue to handle fixed-size arrays efficiently, then compare its performance to a linked list implementation.

Key Vocabulary

QueueA linear data structure that follows the FIFO principle, where elements are added at one end (rear) and removed from the other end (front).
FIFO (First-In, First-Out)The principle that dictates the order of operations in a queue: the element that was added first is the first one to be removed.
EnqueueThe operation of adding a new element to the rear (end) of the queue.
DequeueThe operation of removing and returning the element from the front (beginning) of the queue.
Priority QueueAn abstract data type similar to a regular queue, but where each element has an associated priority, and elements are removed based on their priority rather than their arrival order.

Ready to teach Queues: FIFO Principle?

Generate a full mission with everything you need

Generate a Mission