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 does fork() return, and how does a program use that value?

    fork() creates a copy of the calling process. It returns 0 in the child, the child's PID in the parent, and -1 if creation failed. Programs branch on that value to run different code in each.

    BeginnerQuick answer1 min read