Interview Q&A / Operating Systems
Operating Systems interview questions
Processes, threads, scheduling, memory and deadlocks, in plain words.
Prefer rapid revision? Practise Operating Systems short interview answers →
- What are the FCFS, SJF, Round Robin and Priority CPU scheduling algorithms, and how do you calculate waiting time?
FCFS runs processes in arrival order, SJF picks the shortest job next and gives the lowest average waiting time, Round Robin gives each process a fixed time slice in turn for fair response, and Priority runs the most important process first but can starve low-priority ones unless aging is used.
IntermediateIn-depth4 min read - Three processes with burst times 24, 3 and 3 arrive together. What is the average waiting time under FCFS?
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.
BeginnerQuick answer1 min read - 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