Interview Q&A / Operating Systems

INTERVIEW Q&A · 42 QUESTIONS

Operating Systems interview questions

Processes, threads, scheduling, memory and deadlocks, in plain words.

  1. Burst times 24, 3 and 3, all arriving at time 0, with a time quantum of 4 ms. What is the average waiting time under Round Robin?

    P1 runs 0-4, P2 4-7, P3 7-10, then P1 alone finishes at 30. Waiting times are P1 6, P2 4, P3 7, so the average is 17 / 3, about 5.67 ms.

    IntermediateQuick answer1 min read
  2. Five processes arrive together with bursts 10, 1, 2, 1, 5 and priorities 3, 1, 4, 5, 2 (lower number is higher priority). What is the average waiting time under non-preemptive priority scheduling?

    The order is P2, P5, P1, P3, P4. Waiting times are 0, 1, 6, 16 and 18, a total of 41, so the average is 41 / 5 = 8.2 ms.

    IntermediateQuick answer1 min read
  3. Four processes arrive at 0, 1, 2 and 3 with bursts 8, 4, 9 and 5. What is the average waiting time under preemptive SJF (SRTF)?

    Run order by remaining time: P1 0-1, P2 1-5, P4 5-10, P1 10-17, P3 17-26. Waiting times are P1 9, P2 0, P3 15, P4 2, so the average is 26 / 4 = 6.5 ms.

    IntermediateQuick answer1 min read
  4. How does the time quantum affect Round Robin performance?

    A very large quantum makes Round Robin behave like FCFS. A very small one wastes time on context switches. A good quantum is longer than most CPU bursts, often cited as 80% of bursts finishing within one quantum.

    IntermediateQuick answer1 min read
  5. What is the convoy effect in FCFS scheduling?

    The convoy effect is when many short processes queue behind one long CPU-bound process, so the CPU and I/O devices sit idle in turns and average waiting time rises sharply.

    IntermediateQuick answer1 min read