GateAI
CPU and I/O Scheduling

GATE CSE 2025 Set 2 · Q26

MCQ1 markMedium

Time

Processes P1P1, P2P2, P3P3, P4P4 arrive in that order at times 00, 11, 22, and 88 milliseconds respectively, and have execution times of 1010, 1313, 66, and 99 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times.

Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: D) 19

CPU and I/O Scheduling

We are given the following process information:

  • P1P1: Arrival Time (AT)=0(\text{AT}) = 0, Burst Time (BT)=10(\text{BT}) = 10

  • P2P2: AT=1\text{AT} = 1, BT=13\text{BT} = 13

  • P3P3: AT=2\text{AT} = 2, BT=6\text{BT} = 6

  • P4P4: AT=8\text{AT} = 8, BT=9\text{BT} = 9

Gantt Chart Execution (SRTF):

  • At t=0t = 0: P1P1 arrives with remaining time 1010. P1P1 runs from t=0t = 0 to t=1t = 1.

  • At t=1t = 1: P2P2 arrives with remaining time 1313. P1P1 has remaining time 99. Since 9<139 < 13, P1P1 continues to run until t=2t = 2.

  • At t=2t = 2: P3P3 arrives with remaining time 66. P1P1 has remaining time 88. Since 6<86 < 8, P1P1 is preempted and P3P3 starts executing.

  • P3P3 runs from t=2t = 2 to t=8t = 8 (duration 6 ms) and completes execution at t=8t = 8.

  • At t=8t = 8: P4P4 arrives with remaining time 99. The processes in the ready queue are:

    • P1P1 with remaining time 88

    • P4P4 with remaining time 99

    • P2P2 with remaining time 1313

  • The shortest remaining time is P1P1 (88 ms). P1P1 runs from t=8t = 8 to t=16t = 16 and completes execution at t=16t = 16.

  • At t=16t = 16: Remaining processes are P4P4 (99 ms) and P2P2 (1313 ms). P4P4 executes from t=16t = 16 to t=25t = 25 and completes at t=25t = 25.

  • At t=25t = 25: P2P2 executes from t=25t = 25 to t=38t = 38 and completes at t=38t = 38.

Completion Times (CT) and Turnaround Times (TAT = CT - AT):

  • P1P1: CT=16  ⟹  TAT=16−0=16\text{CT} = 16 \implies \text{TAT} = 16 - 0 = 16

  • P2P2: CT=38  ⟹  TAT=38−1=37\text{CT} = 38 \implies \text{TAT} = 38 - 1 = 37

  • P3P3: CT=8  ⟹  TAT=8−2=6\text{CT} = 8 \implies \text{TAT} = 8 - 2 = 6

  • P4P4: CT=25  ⟹  TAT=25−8=17\text{CT} = 25 \implies \text{TAT} = 25 - 8 = 17

Average Turnaround Time:

Average TAT=16+37+6+174=764=19 ms\text{Average TAT} = \frac{16 + 37 + 6 + 17}{4} = \frac{76}{4} = 19\text{ ms}

Thus, option D is correct.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This CPU and I/O Scheduling previous year question is Q26 of the GATE CSE 2025 Set 2 paper. Find more GATE CSE PYQs on CPU and I/O Scheduling in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related CPU and I/O Scheduling PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

CPU and I/O Scheduling in GATE CSE

CPU and I/O Scheduling has 25 GATE CSE PYQs across 22 papers from 2011 to 2026. 4 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2025 Set 2.

How GATE tests CPU and I/O Scheduling

More from GATE CSE 2025 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2025 Set 2 · Q26 · MCQ

Processes P1, P2, P3, P4 arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times. Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.