Question 1
Which of the following statements are correct?
Mutual exclusion is guaranteed.
The solution satisfies the progress condition.
Bounded waiting is guaranteed.
Deadlock can occur if one process is slow.

The IIT Madras BS Operating Systems (Operating Systems) Quiz 2 paper sat on 12 Apr 2026, in the January 2026 term: 17 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
Which of the following statements are correct?
Mutual exclusion is guaranteed.
The solution satisfies the progress condition.
Bounded waiting is guaranteed.
Deadlock can occur if one process is slow.
Correct answers
Mutual exclusion is guaranteed.
Bounded waiting is guaranteed.
Select all the correct statements.
Mutexes use busy wait while trying to acquire the lock.
Mutexes can be also implemented with spinlocks
A blocking semaphore with S initialized to 1 is similar to a mutex.
The Thundering herd problem of the mutexes can be solved using a queue.
Correct answers
A blocking semaphore with S initialized to 1 is similar to a mutex.
The Thundering herd problem of the mutexes can be solved using a queue.
Choose all the correct statements regarding compiling and linking multiple C source files using gcc
The command gcc file1.c file2.c -o output produces an executable named output.
The command gcc -c file1.c file2.c -o output produces an executable named output.
The command gcc -c file1.c file2.c produces file1.o and file2.o.
The command gcc file1.o file2.o -c -o output produces an executable named output.
The command gcc file1.o file2.o -o output links the object files into an executable named output.
Correct answers
The command gcc file1.c file2.c -o output produces an executable named output.
The command gcc -c file1.c file2.c produces file1.o and file2.o.
The command gcc file1.o file2.o -o output links the object files into an executable named output.
Two processes P1 and P2 are competing for two shared R1 and R2.
• P1 holds R1 and waits for R2. • P2 holds R2 and waits for R1.
Both processes wait indefinitely and none of them can proceed. Which of the following problem(s) is/are illustrated in the above scenario?
Starvation
Deadlock
Mutual exclusion
Busy waiting
Correct answer
Deadlock
Given the hexadecimal representation of the first few bytes of different files, identify the executable file (ELF file) from the options below. (Hint: The ASCII value of ’E’ = 69, ’L’ = 76, and ’F’ = 70)(Hint: ELF → 45 4C 46)
7F 41 42 43 01 01 01 00
7F 45 58 45 02 01 01 00
7F 50 4C 54 02 01 01 00
7F 45 4C 46 01 01 01 00
Correct answer
7F 45 4C 46 01 01 01 00
0x0000000000000005
0x0000000000000009
0x8000000000000005
0x8000000000000009
Correct answer
0x8000000000000005
State True or False: In inter-process communication (IPC) using shared memory, the commonly used system calls are send and receive.
True
False
Correct answer
False
If the exec system call is invoked as exec("/analyze", "data.txt", "config.json", "log.txt", "result.out");, then what are the values of the argc and argv[3] respectively?
4, "config.json"
5, "data.txt"
5, "log.txt"
4, "result.out"
Correct answer
5, "log.txt"
In the following code snippet, a child process is created to execute the ls -l /home command. Identify the correct system call that should be used at LINE-1.
execlp
execl
execv
execvp
Correct answer
execlp
Match the following
a - 1, b - 2, c - 3
a - 2, b - 1, c - 3
a - 2, b - 3, c - 1
a - 1, b - 3, c - 2
Correct answer
a - 1, b - 3, c - 2
What is a major disadvantage of the First Come First Serve (FCFS) scheduling algorithm in operating systems?
Starvation of process
Convoy effect caused by long processes
Requires knowledge of burst time in advance
Frequent context switching
Correct answer
Convoy effect caused by long processes
Which of the following statements correctly describes a key difference between the First-Come-First-Serve (FCFS) and Round Robin (RR) CPU scheduling algorithms?
FCFS uses a fixed time quantum, while Round Robin does not.
FCFS is non-preemptive, while Round Robin is preemptive.
Round Robin always selects the process with the shortest burst time.
Both FCFS and Round Robin are non-preemptive scheduling algorithms.
Correct answer
FCFS is non-preemptive, while Round Robin is preemptive.
Assume that context switches can occur at any time during the execution of the following code snippet. The variable counter is shared between two programs. Which of the following can be the possible final values of counter? Initial value of counter = 200
185
160
225
200
240
175
Correct answers
185
160
225
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.
Correct answer: 0
Consider a set of 5 processes with the following arrival and burst times.
If the CPU scheduling policy used is Round Robin with a time quantum of 3 units, what will be the average response time?
Note: Enter your answer in decimal.
Correct answer: 6
Consider a system with four processes, P1, P2, P3, and P4, arriving at different times and requiring the following CPU burst times to complete.
Assuming that the system employs the First-Come-First-Served (FCFS) scheduling algorithm, what will be the average waiting time?
Note: Enter your answer in decimal.
Correct answer: 5.75
Consider a system with four processes, P1, P2, P3, and P4, arriving at different times and requiring the following CPU burst times:
Assuming that the system employs the Shortest Job First (SJF) scheduling algorithm, calculate the average response time.
Note: Enter your answer in decimal.
Correct answer: 3.25