Explore topic-wise MCQs in Operating System.

This section includes 67 Mcqs, each offering curated multiple-choice questions to sharpen your Operating System knowledge and support exam preparation. Choose a topic below to get started.

1.

To enable a process to wait within the monitor __________

A. a condition variable must be declared as condition
B. condition variables must be used as boolean objects
C. semaphore must be used
D. all of the mentioned
Answer» B. condition variables must be used as boolean objects
2.

A monitor is a module that encapsulates __________

A. shared data structures
B. procedures that operate on shared data structure
C. synchronization between concurrent procedure invocation
D. all of the mentioned
Answer» E.
3.

Process synchronization can be done on __________

A. hardware level
B. software level
C. both hardware and software level
D. none of the mentioned
Answer» D. none of the mentioned
4.

When high priority task is indirectly preempted by medium priority task effectively inverting the relative priority of the two tasks, the scenario is called __________

A. priority inversion
B. priority removal
C. priority exchange
D. priority modification
Answer» B. priority removal
5.

Mutual exclusion can be provided by the __________

A. mutex locks
B. binary semaphores
C. both mutex locks and binary semaphores
D. none of the mentioned
Answer» D. none of the mentioned
6.

A semaphore is a shared integer variable __________

A. that can not drop below zero
B. that can not be more than zero
C. that can not drop below one
D. that can not be more than one
Answer» B. that can not be more than zero
7.

If a process is executing in its critical section, then no other processes can be executing in their critical section. What is this condition called?

A. mutual exclusion
B. critical exclusion
C. synchronous exclusion
D. asynchronous exclusion
Answer» B. critical exclusion
8.

When several processes access the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place is called ________

A. dynamic condition
B. race condition
C. essential condition
D. critical condition
Answer» C. essential condition
9.

In monitor, the local data variables accessible only by

A. Procedures
B. Monitor's Procedures
C. Monitor
D. None
Answer» C. Monitor
10.

The program follows to use a shared binary semaphore T :Process A int Y; A1: Y = X*2; A2: X = Y; signal(T); Process Bint Z;B1: wait(T);B2: Z = X+1;X = Z;T is set to 0 before either process begins execution and, as before, X is set to 5.Now, how many different values of X are possible after both processes finish executing ?

A. one
B. two
C. three
D. four
Answer» B. two
11.

For procedure, the system prevent the overlap of buffer

A. Procedure
B. Programs
C. Operations
D. Information
Answer» D. Information
12.

In a uniprocessor system concurrent processes cannot have overlapped

A. Access
B. Termination
C. Completion
D. Execution
Answer» E.
13.

All processes share a semaphore variable mutex, initialized to 1. Each process must execute wait(mutex) before entering the critical section and signal(mutex) afterward.Suppose a process executes in the following manner :wait(mutex);.....critical section.....wait(mutex);In this situation :

A. a deadlock will occur
B. processes will starve to enter critical section
C. several processes maybe executing in their critical section
D. all of the mentioned
Answer» B. processes will starve to enter critical section
14.

Requirement for mutual exclusions a process remains inside its critical section for a

A. Infinite Time
B. Finite Time
C. Time
D. None
Answer» C. Time
15.

The controller process services writes a

A. Write Message
B. Read Message
C. Request Message
D. Message
Answer» D. Message
16.

A deadlock state is an

A. Safe State
B. Correct State
C. Effective state
D. Unsafe state
Answer» E.
17.

During process interaction concurrent processes come into conflict with each other when they are

A. Executing
B. Completed
C. Competing
D. Terminating
Answer» C. Competing
18.

…………………. Techniques can be used to resolve conflicts, such as competition for resources, and to synchronize processes so that they can cooperate.

A. Mutual Exclusion
B. Busy Waiting
C. Deadlock
D. Starvation
Answer» B. Busy Waiting
19.

Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes :Process P1 :while(true){w1 = true;while(w2 == true);Critical sectionw1 = false;}Remainder Section Process P2 :while(true){w2 = true;while(w1 == true);Critical sectionw2 = false;}Here, w1 and w2 are shared variables, which are initialized to false. Which one of the following statements is TRUE about the above construct?

A. It does not ensure mutual exclusion
B. It does not ensure bounded waiting
C. It requires that processes enter the critical section in strict alternation
D. It does not prevent deadlocks, but ensures mutual exclusion
Answer» E.
20.

In readers/writers problems, Readers are processes that are not required to

A. Include
B. Exclude
C. Describe
D. None
Answer» C. Describe
21.

Main function of shared memory is:

A. to use primary memory efficently
B. to do intra process communication
C. to do inter process communication
D. none of above
Answer» D. none of above
22.

Using Semaphores, each process has a critical section used to access the

A. Computers
B. Processors
C. Resources
D. Users
Answer» D. Users
23.

Consider a counting semaphore which was initialized to 10 and then 6P (wait) operations and 4v(signal) operations were completed on this semaphore. What is the resulting value of semaphore?

A. 10
B. 9
C. 8
D. 0
Answer» D. 0
24.

A counting semaphore was initialized to 10. Then 6 P (wait) operations and 4V (signal) operations were completed on this semaphore. The resulting value of the semaphore is

A. 0
B. 8
C. 10
D. 12
Answer» C. 10
25.

For synchronization, the communication of a message between two processes implies some level of

A. Descriptive
B. Synchronized
C. Synchronization
D. Inscriptive
Answer» D. Inscriptive
26.

A race condition occurs when multiple processes or threads read and write

A. Input
B. Information
C. Data Items
D. Programs
Answer» D. Programs
27.

…………… is a condition in which there is a set of concurrent processes, only one of which is able to access a given resource or perform a given function at any time.

A. Mutual Exclusion
B. Busy Waiting
C. Deadlock
D. Starvation
Answer» B. Busy Waiting
28.

Monitor is a type of

A. semaphore
B. low level synchronization
C. high level synchronization
D. CRT
Answer» D. CRT
29.

Monitor is characterized by

A. a set of programmer defined operators
B. an identifier
C. the number of variables in it
D. collection of colors
Answer» B. an identifier
30.

In special machine instruction, compare and Swap instruction to memory location against a

A. Configuration
B. Test
C. Test Value
D. Memory
Answer» D. Memory
31.

The monitor is a programming language that provides equivalent

A. Functionality
B. Access
C. Control
D. Reliability
Answer» B. Access
32.

............... refers to the ability of multiple process (or threads) to share code, resources or data in such a way that only one process has access to shared object at a time.

A. Synchronization
B. Mutual Exclusion
C. Dead lock
D. Starvation
Answer» C. Dead lock
33.

Let P1 and P2 be the two processes and S1 and S2 be the two shared Boolean variables. The initial values of S1 and S2 are randomly assigned. For accessing the critical sections of P1 and P2 the methods used by them are given below:Method used by P1While ( S1 == S2 );Critical sectionS1 = S2;Method used by P2While ( S1! = S2 )Critical sectionS2 = not (S1);Which statement / s describes that the properties are achieved?

A. Progress but not mutual exclusion
B. Mutual exclusion but not progress
C. Both mutual exclusion and progress
D. Neither mutual exclusion nor progress
Answer» C. Both mutual exclusion and progress
34.

In message passing a process receives information by executing the

A. Send
B. Send Primitive
C. Receive
D. Receive Primitive
Answer» E.
35.

The following pair of processes share a common variable X :Process Aint Y;A1: Y = X*2;A2: X = Y; Process Bint Z;B1: Z = X+1;B2: X = Z;X is set to 5 before either process begins execution. As usual, statements within a process are executed sequentially, but statements in process A may execute in any order with respect to statements in process B.How many different values of X are possible after both processes finish executing ?

A. two
B. three
C. four
D. eight
Answer» D. eight
36.

All processes share a semaphore variable mutex, initialized to 1. Each process must execute wait(mutex) before entering the critical section and signal(mutex) afterward.Suppose a process executes in the following manner :signal(mutex);.....critical section.....wait(mutex);In this situation :

A. a deadlock will occur
B. processes will starve to enter critical section
C. several processes maybe executing in their critical section
D. all of the mentioned
Answer» D. all of the mentioned
37.

With ……………. only one process can execute at a time; meanwhile all other process are waiting for the processor. With ………….. more than one process can be running simultaneously each on a different processor.

A. Multiprocessing, Multiprogramming
B. Multiprogramming, Uniprocessing
C. Multiprogramming, Multiprocessing
D. Uniprogramming, Multiprocessing
Answer» E.
38.

Cascading termination refers to termination of all child processes before the parent terminates ______.

A. Normally
B. Abnormally
C. Normally or abnormally
D. None of these
Answer» B. Abnormally
39.

At a particular time of computation the value of a counting semaphore is 7.Then 20 P operations and 15 V operations were completed on this semaphore.The resulting value of the semaphore is :

A. 42
B. 2
C. 7
D. 12
Answer» C. 7
40.

In implementation of Semaphores, for a single processor system, it is possible to inhibited

A. Deadlock
B. Interrupts
C. Lock Step
D. None
Answer» C. Lock Step
41.

In Semaphores, two or more processors can cooperate by means of simple

A. Signals
B. Data
C. Registers
D. Buffers
Answer» B. Data
42.

Operations that can be invoked on a condition variable are

A. wait
B. signal
C. Both a and b
D. continue
Answer» D. continue
43.

Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock ?I) 2-phase lockingII) Time-stamp ordering

A. I only
B. II only
C. Both I and II
D. Neither I nor II
Answer» C. Both I and II
44.

What is the name of the state in which the system allocate resources to each process so that a deadlock cannot occur?

A. Reading state
B. Receiving state
C. Sending State
D. Safe State
Answer» E.
45.

The global variable read count is used to keep the track of the number of

A. Client
B. Server
C. Writers
D. Readers
Answer» E.
46.

Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned.Method Used by P1:while (S1 == S2) ;Critica1 SectionS1 = S2;Method Used by P2:while (S1 != S2) ;Critica1 SectionS2 = not (S1);Which one of the following statements describes the properties achieved?

A. Mutual exclusion but not progress
B. Progress but not mutual exclusion
C. Neither mutual exclusion nor progress
D. Both mutual exclusion and progress
Answer» B. Progress but not mutual exclusion
47.

A critical section is a program segment

A. which should run in a certain specified amount of time
B. which avoids deadlocks
C. where shared resources are accessed
D. which must be enclosed by a pair of semaphore operations, P and V
Answer» D. which must be enclosed by a pair of semaphore operations, P and V
48.

The operating system must allocate and deal various resources for each active

A. Process
B. Resource
C. Processor
D. I/O Device
Answer» B. Resource
49.

Each process Pi, i = 0,1,2,3,……,9 is coded as follows :repeat P(mutex) {Critical Section} V(mutex) foreverThe code for P10 is identical except that it uses V(mutex) instead of P(mutex). What is the largest number of processes that can be inside the critical section at any moment (the mutex being initialized to 1)?

A. 1
B. 2
C. 3
D. None of the mentioned
Answer» D. None of the mentioned
50.

The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores are initialized as S0=1, S1=0, S2=0.Process P0 :while (true) {wait (S0);print (0);release (S1);release (S2);}Process P1 :wait (S1);Release (S0);Process P2 :wait (S2);release (S0);How many times will process P0 print '0'?

A. At least twice
B. Exactly twice
C. Exactly thrice
D. Exactly once
Answer» B. Exactly twice