Interview Q&A / Operating Systems

INTERVIEW Q&A · 42 QUESTIONS

Operating Systems interview questions

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

  1. How do you solve the producer-consumer problem using semaphores?

    Use three semaphores: empty (counts free slots, starts at N), full (counts filled slots, starts at 0) and mutex (starts at 1). Producers wait on empty, consumers wait on full, and mutex guards the buffer.

    IntermediateQuick answer1 min read