โš™๏ธ Placement

OS Interview Basics โ€” Process vs Thread, Deadlock, Paging

๐Ÿ“… Jul 2, 2026 โฑ 4 min read

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)

  1. Mutual exclusion โ€” resource used by one at a time
  2. Hold and wait โ€” holding one, wanting another
  3. No preemption โ€” can't snatch resources back
  4. 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).

โ† All Articles