Operating System MCQ (Multiple Choice Questions) - SchoolingAxis

Operating System MCQ (Multiple Choice Questions)

 Que- Semaphore is a/an _______ to solve the critical section problem. 

a. hardware for a system 

b. special program for a system 

c. integer variable 

d. none of the mentioned 


Answer- integer variable        


Que- The two atomic operations permissible on semaphores are : 

a. wait 

b. stop 

c. hold 

d. none of the mentioned 


Answer- wait        


Que- Spinlocks are : 

a. CPU cycles wasting locks over critical sections of programs 

b. Locks that avoid time wastage in context switches 

c. Locks that work better on multiprocessor systems 

d. All of the mentioned 


Answer- All of the mentioned        


Que- The main disadvantage of spinlocks is that : 

a. they are not sufficient for many process 

b. they require busy waiting 

c. they are unreliable sometimes 

d. they are too complex for programmers 


Answer- they require busy waiting        


Que- The wait operation of the semaphore basically works on the basic _______ system call. 

a. stop() 

b. block() 

c. hold() 

d. wait() 


Answer- block()        


Que- The signal operation of the semaphore basically works on the basic _______ system call. 

a. continue() 

b. wakeup() 

c. getup() 

d. start() 


Answer- wakeup()        


Que- If the semaphore value is negative : 

a. its magnitude is the number of processes waiting on that semaphore 

b. it is invalid 

c. no operation can be further performed on it until the signal operation is performed on it 

d. none of the mentioned 


Answer- its magnitude is the number of processes waiting on that semaphore        


Que- The code that changes the value of the semaphore is : 

a. remainder section code 

b. non - critical section code 

c. critical section code 

d. none of the mentioned 


Answer- critical section code        


Que- What will happen if a non-recursive mutex is locked more than once ? 

a. Starvation 

b. Deadlock 

c. Aging 

d. Signaling 


Answer- Deadlock        


Que- A semaphore : 

a. is a binary mutex 

b. must be accessed from only one process 

c. can be accessed from multiple processes 

d. none of the mentioned 


Answer- can be accessed from multiple processes        


Que- The two kinds of semaphores are : 

a. mutex & counting 

b. binary & counting 

c. counting & decimal 

d. decimal & binary 


Answer- binary & counting        


Que- A mutex : 

a. is a binary mutex 

b. must be accessed from only one process 

c. can be accessed from multiple processes 

d. None of the mentioned 


Answer- must be accessed from only one process        


Que- 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 : (GATE 1987) 

a. 42 

b. 2 

c. 7 

d. 12 


Answer- 2        


Que- A binary semaphore is a semaphore with integer values : 

a. 1 

b. -1 

c. 0.8 

d. 0.5 


Answer- 1        


Que- Semaphores are mostly used to implement : 

a. System calls 

b. IPC mechanisms 

c. System protection 

d. None of the mentioned 


Answer- IPC mechanisms        


Que- Spinlocks are intended to provide __________ only. 

a. Mutual Exclusion 

b. Bounded Waiting 

c. Aging 

d. Progress 


Answer- Bounded Waiting        


Que- The bounded buffer problem is also known as : 

a. Readers - Writers problem 

b. Dining - Philosophers problem 

c. Producer - Consumer problem 

d. None of the mentioned 


Answer- Producer - Consumer problem        


Que- In the bounded buffer problem, there are the empty and full semaphores that : 

a. count the number of empty and full buffers 

b. count the number of empty and full memory spaces 

c. count the number of empty and full queues 

d. none of the mentioned 


Answer- count the number of empty and full buffers        


Que- In the bounded buffer problem : 

a. there is only one buffer 

b. there are n buffers ( n being greater than one but finite) 

c. there are infinite buffers 

d. the buffer size is bounded 


Answer- there are n buffers ( n being greater than one but finite)        


Que- To ensure difficulties do not arise in the readers - writers problem, _______ are given exclusive access to the shared object. 

a. readers 

b. writers 

c. readers and writers 

d. none of the mentioned 


Answer- writers        


Que- The dining - philosophers problem will occur in case of : 

a. 5 philosophers and 5 chopsticks 

b. 4 philosophers and 5 chopsticks 

c. 3 philosophers and 5 chopsticks 

d. 6 philosophers and 5 chopsticks 


Answer- 5 philosophers and 5 chopsticks        


Que- A deadlock free solution to the dining philosophers problem : 

a. necessarily eliminates the possibility of starvation 

b. does not necessarily eliminate the possibility of starvation 

c. eliminates any possibility of any kind of problem further 

d. none of the mentioned 


Answer- does not necessarily eliminate the possibility of starvation        


Que- A monitor is a type of : 

a. semaphore 

b. low level synchronization construct 

c. high level synchronization construct 

d. none of the mentioned 


Answer- high level synchronization construct        


Que- A monitor is characterized by : 

a. a set of programmer defined operators 

b. an identifier 

c. the number of variables in it 

d. all of the mentioned 


Answer- a set of programmer defined operators        


Que- A procedure defined within a ________ can access only those variables declared locally within the _______ and its formal parameters. 

a. process, semaphore 

b. process, monitor 

c. semaphore, semaphore 

d. monitor, monitor 


Answer- monitor, monitor        


Que- The monitor construct ensures that : 

a. only one process can be active at a time within the monitor 

b. n number of processes can be active at a time within the monitor (n being greater than 1) 

c. the queue has only one process in it at a time 

d. all of the mentioned 


Answer- only one process can be active at a time within the monitor        


Que- The operations that can be invoked on a condition variable are : 

a. wait & signal 

b. hold & wait 

c. signal & hold 

d. continue & signal 


Answer- wait & signal        


Que- The process invoking the wait operation is : 

a. suspended until another process invokes the signal operation 

b. waiting for another process to complete before it can itself call the signal operation 

c. stopped until the next process in the queue finishes execution 

d. none of the mentioned 


Answer- suspended until another process invokes the signal operation        


Que- If no process is suspended, the signal operation : 

a. puts the system into a deadlock state 

b. suspends some default process' execution 

c. nothing happens 

d. the output is unpredictable 


Answer- nothing happens        


Que- A collection of instructions that performs a single logical function is called : 

a. transaction 

b. operation 

c. function 

d. all of the mentioned 


Answer- transaction        


Que- A terminated transaction that has completed its execution successfully is ____________ otherwise it is __________ 

a. committed, destroyed 

b. aborted, destroyed 

c. committed, aborted 

d. none of the mentioned 


Answer- committed, aborted        


Que- The state of the data accessed by an aborted transaction must be restored to what it was just before the transaction started executing. This restoration is known as ________ of transaction. 

a. safety 

b. protection 

c. roll - back 

d. revert - back 


Answer- roll - back        


Que- Write ahead logging is a way : 

a. to ensure atomicity 

b. to keep data consistent 

c. that records data on stable storage 

d. all of the mentioned 


Answer- all of the mentioned        


Que- In the write ahead logging a _____ is maintained. 

a. a memory 

b. a system 

c. a disk 

d. a log record 


Answer- a log record        


Que- An actual update is not allowed to a data item : 

a. before the corresponding log record is written out to stable storage 

b. after the corresponding log record is written out to stable storage 

c. until the whole log record has been checked for inconsistencies 

d. all of the mentioned 


Answer- before the corresponding log record is written out to stable storage        


Que- The undo and redo operations must be _________ to guarantee correct behaviour, even if a failure occurs during recovery process. 

a. idempotent 

b. easy 

c. protected 

d. all of the mentioned 


Answer- idempotent        


Que- The system periodically performs checkpoints that consists of the following operation(s) : 

a. Putting all the log records currently in main memory onto stable storage 

b. putting all modified data residing in main memory onto stable storage 

c. putting a log record  onto stable storage 

d. all of the mentioned 


Answer- all of the mentioned        


Que- Consider a transaction T1 that committed prior to checkpoint. The <T1 commits> record appears in the log before the <checkpoint> record. Any modifications made by T1 must have been written to the stable storage either with the checkpoint or prior to it. Thus at recovery time: 

a. There is a need to perform an undo operation on T1 

b. There is a need to perform a redo operation on T1 

c. There is no need to perform an undo and redo operation on T1 

d. All of the mentioned 


Answer- There is no need to perform an undo and redo operation on T1        


Que- Serializable schedules are ones where : 

a. concurrent execution of transactions is equivalent to the transactions executed serially 

b. the transactions can be carried out one after the other 

c. a valid result occurs after execution transactions 

d. none of the mentioned 


Answer- concurrent execution of transactions is equivalent to the transactions executed serially        


Que- A locking protocol is one that : 

a. governs how locks are acquired 

b. governs how locks are released 

c. governs how locks are acquired and released 

d. none of the mentioned 


Answer- governs how locks are acquired and released        


Que- The two phase locking protocol consists of : 

a. growing & shrinking phase 

b. shrinking & creation phase 

c. creation & growing phase 

d. destruction & creation phase 


Answer- growing & shrinking phase        


Que- The growing phase is a phase in which : 

a. A transaction may obtain locks, but does not release any 

b. A transaction may obtain locks, and releases a few or all of them 

c. A transaction may release locks, but does not obtain any new locks 

d. A transaction may release locks, and does obtain new locks 


Answer- A transaction may obtain locks, but does not release any        


Que- The shrinking phase is a phase in which : 

a. A transaction may obtain locks, but does not release any 

b. A transaction may obtain locks, and releases a few or all of them 

c. A transaction may release locks, but does not obtain any new locks 

d. A transaction may release locks, and does obtain new locks 


Answer- A transaction may release locks, but does not obtain any new locks        


Que- Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock ? (I) 2-phase locking (II) Timestamp ordering 

a. I only 

b. II only 

c. Both I and II 

d. Neither I nor II 


Answer- II only        


Que- What is the reusable resource? 

a. that can be used by one process at a time and is not depleted by that use 

b. that can be used by more than one process at a time 

c. that can be shared between various threads 

d. none of the mentioned  


Answer- that can be used by one process at a time and is not depleted by that use        


Que- Which of the following condition is required for deadlock to be possible? 

a. mutual exclusion 

b. a process may hold allocated resources while awaiting assignment of other resources 

c. no resource can be forcibly removed from a process holding it 

d. all of the mentioned  


Answer- all of the mentioned         


Que- A system is in the safe state if 

a. the system can allocate resources to each process in some order and still avoid a deadlock 

b. there exist a safe sequence 

c. all of the mentioned 

d. none of the mentioned  


Answer- the system can allocate resources to each process in some order and still avoid a deadlock        


Que- The circular wait condition can be prevented by 

a. defining a linear ordering of resource types 

b. using thread 

c. using pipes 

d. all of the mentioned  


Answer- defining a linear ordering of resource types        


Que- Which one of the following is the deadlock avoidance algorithm? 

a. banker's algorithm 

b. round-robin algorithm 

c. elevator algorithm 

d. karn's algorithm  


Answer- banker's algorithm        


Que- What is the drawback of banker's algorithm? 

a. in advance processes rarely know that how much resource they will need 

b. the number of processes changes as time progresses 

c. resource once available can disappear 

d. all of the mentioned  


Answer- all of the mentioned         


Que- For effective operating system, when to check for deadlock? 

a. every time a resource request is made 

b. at fixed time intervals 

c. every time a resource request is made at fixed time intervals 

d. none of the mentioned  


Answer- every time a resource request is made at fixed time intervals        


Que- A problem encountered in multitasking when a process is perpetually denied necessary resources is called 

a. deadlock 

b. starvation 

c. inversion 

d. aging  


Answer- starvation        


Que- Which one of the following is a visual ( mathematical ) way to determine the deadlock occurrence? 

a. resource allocation graph 

b. starvation graph 

c. inversion graph 

d. none of the mentioned  


Answer- resource allocation graph        


Que- To avoid deadlock 

a. there must be a fixed number of resources to allocate 

b. resource allocation must be done only once 

c. all deadlocked processes must be aborted 

d. inversion technique can be used  


Answer- there must be a fixed number of resources to allocate        


Que- The number of resources requested by a process : 

a. must always be less than the total number of resources available in the system 

b. must always be equal to the total number of resources available in the system 

c. must not exceed the total number of resources available in the system 

d. must exceed the total number of resources available in the system 


Answer- must not exceed the total number of resources available in the system        


Que- The request and release of resources are ___________ 

a. command line statements 

b. interrupts 

c. system calls 

d. special programs 


Answer- system calls        


Que- Multithreaded programs are : 

a. lesser prone to deadlocks 

b. more prone to deadlocks 

c. not at all prone to deadlocks 

d. none of the mentioned 


Answer- more prone to deadlocks        


Que- For a deadlock to arise, which of the following conditions must hold simultaneously ? 

a. Mutual exclusion 

b. No preemption 

c. Hold and wait 

d. All of the mentioned 


Answer- All of the mentioned        


Que- For Mutual exclusion to prevail in the system : 

a. at least one resource must be held in a non sharable mode 

b. the processor must be a uniprocessor rather than a multiprocessor 

c. there must be at least one resource in a sharable mode 

d. all of the mentioned 


Answer- at least one resource must be held in a non sharable mode        


Que- For a Hold and wait condition to prevail : 

a. A process must be not be holding a resource, but waiting for one to be freed, and then request to acquire it 

b. A process must be holding at least one resource and waiting to acquire additional resources that are being held by other processes 

c. A process must hold at least one resource and not be waiting to acquire additional resources 

d. None of the mentioned 


Answer- A process must be holding at least one resource and waiting to acquire additional resources that are being held by other processes        


Que- Deadlock prevention is a set of methods : 

a. to ensure that at least one of the necessary conditions cannot hold 

b. to ensure that all of the necessary conditions do not hold 

c. to decide if the requested resources for a process have to be given or not 

d. to recover from a deadlock 


Answer- to ensure that at least one of the necessary conditions cannot hold        


Que- For non sharable resources like a printer, mutual exclusion : 

a. must exist 

b. must not exist 

c. may exist 

d. none of the mentioned 


Answer- must exist        


Previous Post Next Post

Responsive Ad