OS rounds recycle the same handful of concepts. Plain-words versions below โ interviewers prefer them to recited definitions.
Process vs thread (asked EVERY time)
A process is a running program with its own memory space. Threads are execution lanes inside a process sharing that memory. Sharing makes threads cheap to create and fast to communicate โ and gives them race conditions, which is why locks exist. Chrome: each tab โ a process (one crash doesn't kill the browser); within a tab, threads render and run JS.
Deadlock โ the 4 conditions (all must hold)
- Mutual exclusion โ resource used by one at a time
- Hold and wait โ holding one, wanting another
- No preemption โ can't snatch resources back
- Circular wait โ A waits on B waits on A
Break any one to prevent deadlock โ e.g., ordered lock acquisition kills circular wait.
Virtual memory + paging
Each process believes it has huge contiguous memory; the OS maps fixed-size pages to scattered physical frames. Rarely-used pages swap to disk. Benefit: isolation + more "memory" than RAM. Thrashing = too much swapping, everything crawls.
Scheduling in one breath
FCFS (simple, convoy problem) ยท SJF (optimal average wait, needs future knowledge) ยท Round Robin (time slices โ interactive systems) ยท Priority (starvation risk โ aging fixes it).