thecodingcompany
Technical MCQ

Operating Systems

Processes, threads, scheduling, memory management and deadlocks.

Questions6
FormatMCQ + explanation

6 questions

Answer each one before scrolling to the solution. The explanation names the mechanism, not just the choice.

01Which scheduling algorithm can cause starvation of long jobs?
  1. A.First Come First Served
  2. B.Shortest Job First
  3. C.Round Robin
  4. D.FIFO with aging
Answer. Shortest Job First always prefers shorter bursts, so a long job can be postponed indefinitely if short jobs keep arriving.
02Thrashing in a virtual memory system is caused by:
  1. A.Too much free RAM
  2. B.Excessive page faults from an over-committed working set
  3. C.A large page size
  4. D.Too few processes
Answer. When the sum of process working sets exceeds physical memory, the system spends more time paging than executing — that is thrashing.
03A race condition occurs when:
  1. A.Two processes run on different CPUs
  2. B.Multiple threads access shared data without synchronisation
  3. C.A program loops forever
  4. D.Memory is exhausted
Answer. A race condition arises when the outcome depends on the unpredictable interleaving of unsynchronised access to shared state.
04The main advantage of a thread over a process is:
  1. A.Better isolation
  2. B.Cheaper creation and context switching
  3. C.Safer memory access
  4. D.Guaranteed parallelism
Answer. Threads share the address space, so creation and context switching are far cheaper than for processes, which need their own memory maps.
05Which page replacement algorithm suffers Belady’s anomaly?
  1. A.LRU
  2. B.Optimal
  3. C.FIFO
  4. D.LFU
Answer. FIFO can produce more page faults with more frames — Belady’s anomaly. LRU and Optimal are stack algorithms and do not.
06A semaphore with an initial value of 1 behaves like:
  1. A.A counting semaphore for N processes
  2. B.A mutex for one process at a time
  3. C.A deadlock
  4. D.A busy-wait loop
Answer. A binary semaphore initialised to 1 permits exactly one holder, which is the definition of a mutex.

Practise here. Get placed there.

Prep+ is unlimited practice. When you are ready to turn it into an offer, TCC Placement Partner handles portfolio, resume and interviews.