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 - For burst times 24, 3 and 3 (all arriving at time 0), what is the average waiting time under non-preemptive SJF?
SJF runs the shortest burst first: P2, P3, then P1. Waiting times are P2 0, P3 3, P1 6, so the average is (0 + 3 + 6) / 3 = 3 ms, which is the minimum possible.
BeginnerQuick answer1 min read