adplus-dvertising

Welcome to the Operating System MCQs Page

Dive deep into the fascinating world of Operating System with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Operating System, a crucial aspect of GATE CSE Exam. In this section, you will encounter a diverse range of MCQs that cover various aspects of Operating System, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within GATE CSE Exam.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Operating System. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of GATE CSE Exam.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Operating System. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Operating System MCQs | Page 14 of 16

Q131.
Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below.

Process P:
while (1) {
W:
print '0';
print '0';
X:
}

Process Q:
while (1) {
Y:
print '1';
print '1';
Z:
}

Synchronization statements can be inserted only at points W, X, Y and Z. Which of the following will always lead to an output staring with '001100110011' ?
Discuss
Answer: (b).P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S initially 1, and T initially 0
Q132.
Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below.

Process P:
while (1) {
W:
print '0';
print '0';
X:
}

Process Q:
while (1) {
Y:
print '1';
print '1';
Z:
}

Synchronization statements can be inserted only at points W, X, Y and Z Which of the following will ensure that the output string never contains a substring of the form 01n0 or 10n1 where n is odd?
Discuss
Answer: (c).P(S) at W, V(S) at X, P(S) at Y, V(S) at Z, S initially 1
Q133.
Which of the following does not interrupt a running process?
Discuss
Answer: (c).Scheduler process
Q134.
Which of the following need not necessarily be saved on a context switch between processes?
Discuss
Answer: (b).Translation look aside buffer
Q135.
The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.

P1()
{
C = B – 1;
B = 2*C;
}

P2()
{
D = 2 * B;
B = D - 1;
}

The number of distinct values that B can possibly take after the execution is

a.

3

b.

2

c.

5

d.

4

Discuss
Answer: (a).3
Q136.
In a certain operating system, deadlock prevention is attempted using the following scheme. Each process is assigned a unique timestamp, and is restarted with the same timestamp if killed. Let Ph be the process holding a resource R, Pr be a process requesting for the same resource R, and T(Ph) and T(Pr) be their timestamps respectively. The decision to wait or preempt one of the processes is based on the following algorithm.
if T(Pr) < T(Ph)

then kill Pr

else wait
Which one of the following is TRUE?
Discuss
Answer: (a).The scheme is deadlock-free, but not starvation-free
Q137.
A process executes the following segment of code :
for(i = 1; i < = n; i++)

fork ();
The number of new processes created is  
Discuss
Answer: (c).2^n - 1
Q138.
The semaphore variables full, empty and mutex are initialized to 0, n and 1, respectively. Process P1 repeatedly adds one item at a time to a buffer of size n, and process P2 repeatedly removes one item at a time from the same buffer using the programs given below. In the programs, K, L, M and N are unspecified statements.

 P1
while (1) {     K; P(mutex); Add an item to the buffer; V(mutex);     L; } P2 while (1) {    M; P(mutex); Remove an item from the buffer; V(mutex);     N; }

The statements K, L, M and N are respectively
Discuss
Answer: (d).P(empty), V(full), P(full), V(empty)
Q139.
Consider a non-negative counting semaphore S. The operation P(S) decrements S, and V(S) increments S. During an execution, 20 P(S) operations and 12 V(S) operations are issued in some order. The largest initial value of S for which at least one P(S) operation will remain blocked is ________.

a.

7

b.

8

c.

9

d.

10

Discuss
Answer: (a).7
Q140.
In the working-set strategy, which of the following is done by the operating system to prevent thrashing?

1.It initiates another process if there are enough extra frames.
2.It selects a process to suspend if the sum of the sizes of the working-sets exceeds the total number of available frames.
Discuss
Answer: (d).Both I and II

Suggested Topics

Are you eager to expand your knowledge beyond Operating System? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!