Interview Q&A / Operating Systems

INTERVIEW Q&A · 42 QUESTIONS

Operating Systems interview questions

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

  1. What is context switching in an operating system?

    Context switching is when the OS pauses the process or thread running on a CPU, saves its state (registers, program counter, stack pointer) in its control block, and loads the saved state of another one so it can continue. It lets many programs share one CPU, but each switch is pure overhead.

    BeginnerIn-depth3 min read
  2. What is the difference between a process and a thread?

    A process is a running program with its own memory. A thread is a unit of work inside a process; threads of the same process share that memory, so they are lighter to create but need care to avoid clashing.

    BeginnerIn-depth2 min read