Interview Q&A / Operating Systems

INTERVIEW Q&A · 42 QUESTIONS

Operating Systems interview questions

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

  1. A system has 4 KB pages. Translate logical address 20000 if page 4 is stored in frame 9.

    20000 = 4 x 4096 + 3616, so page number 4 and offset 3616. Frame 9 starts at 9 x 4096 = 36864, so the physical address is 36864 + 3616 = 40480.

    BeginnerQuick answer1 min read
  2. What do threads of the same process share, and what does each thread keep private?

    Threads in one process share code, global data, the heap and open files. Each thread has its own stack, program counter, registers and thread ID.

    BeginnerQuick answer1 min read
  3. What is the difference between a logical address and a physical address?

    A logical (virtual) address is what the program generates; a physical address is the real location in RAM. The Memory Management Unit translates one into the other at run time.

    BeginnerQuick answer1 min read
  4. What is the difference between paging and segmentation?

    Paging divides memory into fixed-size pages invisible to the programmer; segmentation divides it into variable-size logical units like code, stack and heap. Paging causes internal fragmentation, segmentation causes external.

    BeginnerQuick answer1 min read