Multilevel Feedback Queue (MLFQ) is one of the most important and complex CPU scheduling algorithms in Operating Systems. Whether you're preparing for university exams, competitive coding tests, or trying to build a strong foundation in OS concepts, mastering MLFQ is essential.
In this blog, we've compiled 17 carefully selected and solved questions on MLFQ Scheduling, including both conceptual and numerical problems. These questions help you understand how MLFQ handles multiple queues, priority boosting, aging, and how processes move between queues based on their behavior.
Operating systems' multilevel Feedback Queue Scheduling (MLFQ) algorithm is a sophisticated CPU scheduling technique that enhances multilevel queue scheduling by permitting process switching between queues. This approach helps to maximize CPU utilization and responsiveness by handling a variety of process kinds and dynamically allocating them according to their behavior and CPU burst time.

- Step 1: Set up several queues with varying priorities. The time quantum of higher-priority queues is shorter.
- Step 2: Assign every new process to the queue with the greatest priority.
- Step 3: Apply Round Robin scheduling to every queue.
- Step 4: A process is relegated to a lower-priority queue if it consumes its whole time quantum without finishing.
- Step 5: A process in a lower-priority queue descends once more if it doesn't complete within its allotted time.
- Step 6: Upon restarting, a process in any queue that has reached an I/O limit may move back up to a higher-priority queue.
- Step 7: Keep doing this reallocation until every process is finished or shut down.
Advantages | Disadvantages |
---|---|
Efficient handling of processes with varying CPU burst times. | Complex to implement and manage multiple queues. |
Improved CPU utilization due to dynamic priority adjustment. | Starvation can occur for lower-priority processes. |
Reduces turnaround time for I/O-bound and interactive processes. | Increased overhead for context switching between queues. |
Allows fair sharing of CPU time based on process needs. | Difficulty in choosing appropriate time quantum for each queue. |
Minimizes response time for short tasks or interactive processes. | Performance can degrade if too many high-priority processes exist. |
Adaptable to system load and changes in process behavior. | Requires fine-tuning of parameters to avoid inefficiency. |
Multilevel Feedback Queue Scheduling offers several advantages over simpler algorithms such as First-Come-First-Serve (FCFS), Round Robin (RR), and Shortest Job Next (SJN) due to its ability to adapt dynamically to the changing needs of processes. By enabling processes to shift between various priority queues, MLFQS helps to prevent process starvation, optimizes CPU time utilization, and minimizes turnaround time for interactive and I/O-bound processes. This flexibility ensures balanced performance in systems that manage a variety of workloads, making it a highly efficient option for many contemporary operating systems.
Multilevel Feedback Queue (MLFQ) scheduling is used in systems where different tasks need to be handled based on their priority. It’s helpful in the following areas:
- 1. Operating Systems : MLFQ is utilized in operating systems to handle tasks such as applications and background processes. It ensures that critical tasks are completed promptly while still allowing time for less urgent ones.
- 2. Real-Time Systems: In systems that require immediate processing, such as real-time applications, MLFQ prioritizes critical tasks to ensure they are addressed first.
- 3. Shared Systems: On servers or computers used by multiple people, MLFQ makes sure every user’s tasks are given fair attention based on their importance.
Question 1 : find the average Turn Around Time and Waiting
Time of following processes using MULTILEVEL FEEDBACK QUEUE
Scheduling (MLFQ) algorithm. Consider the following processes
with their Arrival Time, Burst Time. Question criteria :
(1) There are four queue Q1, Q2, Q3, Q4
(2) Queue with their time stamp Q1(T.S=4), Q2(T.S=8),
Q3(T.S=16), Q4(FCFS)
(in Q1, Q2, Q3, we use
Round Robin
and in Q4 we use
first come first serve (FCFS)
scheduling algorithms)
Process | Arrival Time | Burst Time |
---|---|---|
P1 | 1 | 6 |
P2 | 4 | 8 |
P3 | 5 | 12 |
P4 | 8 | 14 |
P5 | 12 | 6 |
P6 | 10 | 10 |
P7 | 8 | 8 |
P8 | 16 | 6 |
solution :
Formula:
Turnaround Time (TAT) = Completion Time - Arrival Time
Waiting Time (WT) = Turnaround Time - Burst Time
Solution:
Gantt Chart
Calculations:
Process | Completion Time | Turnaround Time (TAT) | Waiting Time (WT) |
---|---|---|---|
P1 | 35 | 34 | 28 |
P2 | 39 | 35 | 27 |
P3 | 47 | 42 | 30 |
P4 | 71 | 63 | 49 |
P5 | 67 | 55 | 49 |
P6 | 65 | 55 | 45 |
P7 | 59 | 51 | 43 |
P8 | 69 | 53 | 47 |
Average Turnaround Time:
(34 + 35 + 42 + 63 + 55 + 55 + 51 + 53) / 8 = 48.5
Average Waiting Time:
(28 + 27 + 30 + 49 + 49 + 45 + 43 + 47) / 8 = 39.75
question 2 :
Consider following process, with the cpu burst time given in milliseconds. The system has three queues. first queue is having the T.S = 2, Second queue is having the T.S = 4 and, third queue is having the FCFS scheduling
Process | Burst Time | Arrival Time |
---|---|---|
P1 | 4 | 0.0 |
P2 | 7 | 1.0 |
P3 | 5 | 1.0 |
P4 | 6 | 2.0 |
P5 | 12 | 3.0 |
P6 | 9 | 5.0 |
P7 | 3 | 6.0 |
P8 | 10 | 8.0 |
P9 | 3 | 12.0 |
P10 | 2 | 16.0 |
P11 | 4 | 22.0 |
P12 | 2 | 24.0 |
Draw gantt charts to show execution using multi level feedback queue scheduling (MLFQS). Also determine the process turnaround time and waiting time.
Solution :
Formula:
Turnaround Time (TAT) = Completion Time - Arrival Time
Waiting Time (WT) = Turnaround Time - Burst Time
Gantt Chart
Calculations:
Process | Completion Time | Turnaround Time (TAT) | Waiting Time (WT) |
---|---|---|---|
P1 | 22 | 22 - 0 = 22 | 22 - 4 = 18 |
P2 | 54 | 54 - 1.0 = 53 | 53 - 7 = 46 |
P3 | 33 | 33 - 1.0 = 32 | 32 - 5 = 27 |
P4 | 37 | 37 - 2.0 = 35 | 35 - 6 = 29 |
P5 | 60 | 60 - 3.0 = 57 | 57 - 12 = 45 |
P6 | 63 | 63 - 5.0 = 58 | 58 - 9 = 49 |
P7 | 46 | 46 - 6 = 40 | 40 - 3 = 37 |
P8 | 67 | 67 - 8 = 59 | 59 - 10 = 49 |
P9 | 51 | 51 - 12 = 39 | 39 - 3 = 36 |
P10 | 20 | 20 - 16 = 4 | 4 - 2 = 2 |
P11 | 53 | 53 - 22 = 31 | 31 - 4 = 27 |
P12 | 26 | 26 - 24 = 2 | 2 - 2 = 0 |
Average Turnaround Time:
( 22 + 53 + 32 + 35 + 57 + 58 + 40 + 59 + 39 + 4 + 31 + 2 ) / 12 = 432/12 = 36
Average Waiting Time:
(18 + 46 + 27 + 29 + 45 + 49 + 37 + 49 + 36 + 2 + 27 + 0 ) / 12 = 365/12= 30.416
Question 3 : find the average Turn Around Time and Waiting
Time of following processes using MULTILEVEL FEEDBACK QUEUE
Scheduling (MLFQ) algorithm. Consider the following processes
with their Arrival Time, Burst Time. Question criteria :
(1) There are four queue Q1, Q2, Q3, Q4
(2) Queue with their time stamp Q1(T.S=2), Q2(T.S=4),
Q3(T.S=8), Q4(FCFS)
(in Q1, Q2, Q3, we use
Round Robin
and in Q4 we use
FCFS
scheduling algorithms)
Process | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 6 |
P2 | 5.0 | 2 |
P3 | 8.0 | 5 |
P4 | 10 | 8 |
P5 | 14 | 4 |
P6 | 18 | 3 |
P7 | 22 | 2 |
P8 | 24 | 10 |
solution :
Formula:
Turnaround Time (TAT) = Completion Time - Arrival Time
Waiting Time (WT) = Turnaround Time - Burst Time
Gantt Chart
Calculations:
Process | Completion Time | Turnaround Time (TAT) | Waiting Time (WT) |
---|---|---|---|
P1 | 8 | 8 | 2 |
P2 | 7 | 2 | 0 |
P3 | 21 | 13 | 8 |
P4 | 36 | 26 | 18 |
P5 | 30 | 16 | 12 |
P6 | 29 | 11 | 8 |
P7 | 24 | 2 | 0 |
P8 | 40 | 16 | 6 |
Average Turnaround Time:
(8 + 2 + 13 + 26 + 16 + 11 + 2 + 16) / 8 = 11.75
Average Waiting Time:
(2 + 0 + 8 + 18 + 12 + 8 + 0 + 6) / 8 = 6.75
Previous Year Questions (PYQs) Of Multilevel Feedback Queue Scheduling (MLFQ)
Below is a scanned image of a question on multilevel queue Scheduling (MLQ) in operating system

