Interview Q&A / Operating Systems

BeginnerQuick answer1 min readUpdated 3 Oct 2026

Three processes with burst times 24, 3 and 3 arrive together. What is the average waiting time under FCFS?

SHORT ANSWER

Run in arrival order P1, P2, P3. Waiting times are 0, 24 and 27, so the average is (0 + 24 + 27) / 3 = 17 ms. Waiting time is the time a process spends in the ready queue before it gets the CPU.

Explain it simply

FCFS (first come, first served) is a queue at a chai stall: whoever came first is served first, and nobody can jump ahead. A process keeps the CPU until it finishes.

Since all three arrive at time 0, the order is P1, P2, P3. Waiting time = start time - arrival time.

Example

Gantt chart:

text
| P1 (24)                  | P2 (3) | P3 (3) |
0                          24       27       30
ProcessBurstStartWaiting
P12400
P232424
P332727

Average waiting time = (0 + 24 + 27) / 3 = 51 / 3 = 17 ms.

Average turnaround time = (24 + 27 + 30) / 3 = 81 / 3 = 27 ms.

The two short jobs are stuck behind the long one. If the order were P2, P3, P1, the average waiting time would drop to (0 + 3 + 6) / 3 = 3 ms. Same work, very different waiting.

What to say in the interview

"Under FCFS the Gantt chart is P1 to 24, P2 to 27, P3 to 30. Waiting times are 0, 24 and 27, average 17 ms. I'd also point out that arrival order matters a lot: put the short jobs first and the average falls to 3 ms."

Common mistakes

  • Dividing by the total burst time (30) instead of the number of processes.
  • Using completion time as waiting time.

#scheduling#fcfs#worked-example

Related questions

Practise more Operating Systems questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Operating Systems quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.