Quiz Space

Operating Systems · Quiz 2 · 12 Apr 2026 · January 2026 term

Question 14: Consider the following code snippet from Bakery Algorith…

Question 14

+4 marksNumerical answer

Consider the following code snippet from Bakery Algorithm.

Considering that there are 5 processes, and initially num[0]=3, num[1]=0, num[2]=5,num[3]=2, num[4]=4, If Process 3 (num[2]) starts executing its critical section and then unlocks, what will be the new value of num[2] after P3 finishes execution?
Note: Enter your answer in decimal.

Show answer

Correct answer: 0

Question 14 of 17 in the IIT Madras BS Operating Systems (Operating Systems) Quiz 2 paper sat on 12 Apr 2026, in the January 2026 term (OS 06 Apr 26). It carries 4 marks.

More questions from this paper

  1. Q1Which of the following statements are correct?
  2. Q2Select all the correct statements.
  3. Q3Choose all the correct statements regarding compiling and linking multiple C source files using gcc
  4. Q4Two processes P1 and P2 are competing for two shared R1 and R2.\ P1 holds R1 and waits for R2. • P2 holds R2 and waits …
  5. Q5Given the hexadecimal representation of the first few bytes of different files, identify the executable file (ELF file)…
  6. Q6Figure question
  7. Q7State True or False: In inter-process communication (IPC) using shared memory, the commonly used system calls are send …
  8. Q8If the exec system call is invoked as exec("/analyze", "data.txt", "config.json", "log.txt", "result.out");, then what …
  9. Q9In the following code snippet, a child process is created to execute the ls -l /home command. Identify the correct syst…
  10. Q10Match the following
  11. Q11What is a major disadvantage of the First Come First Serve (FCFS) scheduling algorithm in operating systems?
  12. Q12Which of the following statements correctly describes a key difference between the First-Come-First-Serve (FCFS) and Ro…
  13. Q13Assume that context switches can occur at any time during the execution of the following code snippet. The variable cou…
  14. Q15Consider a set of 5 processes with the following arrival and burst times. If the CPU scheduling policy used is Round Ro…
  15. Q16Consider a system with four processes, P1, P2, P3, and P4, arriving at different times and requiring the following CPU …
  16. Q17Consider a system with four processes, P1, P2, P3, and P4, arriving at different times and requiring the following CPU …