This set of MCQ(multiple choice questions) focuses on the NPTEL Operating System Fundamentals Week 8 Assignment Solutions.
You should practice these questions to improve Operating System Fundamentals needed for various interviews (like company interview, campus interview, walk-in interview), entrance exams, placements and other competitive exams. All the questions in this particular section are based on only “NPTEL Operating System Fundamentals Week 8 Assignment Solutions“.
Week 1:Â Â Introduction
Week 2:  Processes and Threads – Part I
Week 3:  Processes and Threads – Part II
Week 4:Â Â Inter-process Communication
Week 5:  Concurrency and Synchronization – Part I
Week 6:  Concurrency and Synchronization – Part II
Week 7:Â Â Deadlock
Week 8:Â Â CPU SchedulingÂ
Week 9:Â Â Memory ManagementÂ
Week 10: Virtual Memory – Part I
Week 11: Virtual Memory – Part IIÂ
Week 12: File System Processes and Threads – Part I
Operating System Fundamentals NPTEL 2022 Week 8 Assignment Solutions
Q1. Which of the following measures can be taken as a solution to Dining-Philosophers problem?
a) Provided that fork can be picked while in critical section, allow the philosophers to pick forks only when both are available.
b) At most 4 philosophers are allowed to sit at the table simultaneously
c) Making the odd numbered philosophers to pick the left chopstick first, then the right chopstick and vice-versa for the even numbered
d) All of the above
Answer: d) All of the above
Q2. Consider the resource allocation graphs G1 and G2. What can be said about deadlock condition?
a) Both are deadlocked
b) G1 deadlocked, G2 not
c) G1 not, G2 deadlocked
d) None is deadlocked
Answer: a) Both are deadlocked
Q3. Which of the following problem we might face if we invoke deadlock detection algorithm at arbitrary interval?
a) There may be many cycles in the graph and it will not be possible to rollback the deadlocked processes anymore
b) There may be many cycles in the graph and we would not be able to tell which of the many deadlocked processes caused the deadlock
c) There may be no cycles in the graph and thus it will not be possible to know if any deadlock has happened
d) All of the above
Answer: b)
Q4. Consider the resource allocation graphs G1 and G2. What can be said about deadlock condition?
a) Both are deadlocked
b) G1 deadlocked, G2 not
c) G1 not, G2 deadlocked
d) None is deadlocked
Answer: b) G1 deadlocked, G2 not
Q5. Which of the following is incorrect about resource allocation graph?
a) If there is only one instance per resource and the graph contains a cycle, then deadlock exists
b) If there are multiple instances per resource and the graph contains a cycle, then there is no possibility of deadlock
c) If graph contains no cycle, then there is no deadlock
d) None of the above
Answer: b) If there are multiple instances per resource and the graph contains a cycle, then there is no possibility of deadlock
Q6. Which of the following phenomena are responsible for deadlock?
a) A process holding at least one resource is waiting to acquire additional resources held by other processes
b) Only one process at a time can use a resource
c) A resource can be released only voluntarily by the process holding it, after that process has completed its task
d) All of the above
Answer: d) All of the above
Q7. Match the following columns while considering the case of deadlock prevention.
a) I ->s, II -> q, III -> p
b) I -> q, II -> s, III -> p
c) I -> s, II -> p, III -> q
d) None of the above
Answer: c) I -> s, II -> p, III -> q
Q8. Which of the following is incorrect about Banker’s algorithm?
a) Each process must a priori claim maximum use
b) When a process requests a resource it may have to wait
c) When a process gets all its resources it must return them in a finite amount of time.
d) None of the above
Answer: d) None of the above
Q9. Which of the following is incorrect?
a) Simplest and most useful model requires that each process declare the maximum number of resources of each type that it may need
b) The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that there can be at least one circular-wait condition
c) Resource-allocation state is defined by the number of available and allocated resources, and the maximum demands of the processes
d) None of the above
Answer: b)
Q10. In resource allocation graph algorithm, when a process Pi request a resource Rj –
a) the request can be granted only if at least one cycle is formed in the resource allocation graph while converting the request edge to an assignment edge
b) The request can be granted only if the conversion of request edge to assignment edge, no cycle is generated in the resource allocation graph
c) The request can be granted only if no cycle is formed in the resource allocation graph while converting the request edge to an assignment edge
d) The request can be granted only if the conversion of request edge to assignment edge, at least one cycle is generated in the resource allocation graph
Answer: c)
Previous Course – Week 8 Assignment Solutions
Q1. If {P0, P1, P2, P3, P4} are a set of waiting processes, under which of the following circumstances a deadlock will arise considering the mutual exclusion, hold and wait, no pre- emption conditions hold as well?
a. P0 is waiting for resource held by P2, P2 is waiting for resource held by P3 and P3 is waiting for resource held by P1
b. P0 is waiting for resource held by P1, P1 is waiting for resource held by P2 and P2 is waiting for resource held by P3
c. P0 is waiting for resource held by P2, P2 is waiting for resource held by P4 and P4 is waiting for resource held by P0
d. P0 is waiting for resource held by P1, P1 is wating for resource held by P3, and P3 is waiting for resource held by P4
Ans. c
Q2. Consider the following resource allocation graph (Pi -> processes; Ri -> resources).
Determine whether there is a deadlock or not.
a. There is no deadlock
b. There may be a deadlock
c. There is a deadlock
d. Can’t be determined
Ans. c
Q3.
Consider the following resource allocation graph (Pi -> processes; Ri -> resources).
Determine whether there is a deadlock or not.
a. Deadlock exists
b. Deadlock does not exist
c. Deadlock status cannot be determined
d. Deadlock may exist
Ans. b
Q4. Select the incorrect statement
a. If a system is in safe state, there cannot be any deadlocks
b. If a system is in unsafe state, it implies that there exists at least one deadlock
c. If a system is in unsafe state, there may or may not be deadlocks
d. None of the above
Ans. b
Q5. {Pa, Pb, Pc} is a set of processes which follows the sequence of a = 23, b = 12, c = 75. All the three processes require same resource to execute. To ensure safe state –
a. Pc has to wait until Pb terminates and Pb has to wait until Pa terminates
b. Pa has to wait until Pb terminates and Pb has to wait until Pc terminates
c. Pb has to wait until Pa terminates and Pa has to wait until Pc terminates
d. Pc has to wait until Pa terminates and Pa has to wait until Pb terminates
Ans. d
Q6. Banker’s algorithm is used in
a. Deadlock prevention
b. Deadlock avoidance with resources allowing single instance
c. Deadlock avoidance with resources allowing multiple instances
d. Recovering from deadlock
Ans. c
Q7.
Select the correct wait-for graph that has been derived from the following resource allocation graph.
Ans. b
Q8. Consider a set of 5 processes {P0, P1, P2, P3, P4} and a set of 7 resources {R0, R1, R2, R3, R4, R5, R6}. The Allocation_matrix has the size of 5×7. If Allocation_matrix[3,2] = 6, it implies that-
a. Process-P3 has been allocated 6 instances of resource-R2
b. Process-P2 has been allocated 6 instances of resource-R3
c. Process-P3 is requesting 6 instances of resource-R2
d. Process-P2 is requesting 6 instances of resource-R3
Ans. a
Q9. Deadlock detection algorithm is invoked-
a. Depending on how often the deadlock occurs
b. How many processes are need to be aborted
c. Arbitrarily at any point of time
d. Both a & b
Ans. d
Q10. How should we choose the order of process termination to recover from deadlock?
a. How many processes are needed to be terminated
b. Priorities of the processes to be terminated
c. How much longer time to completion for the process
d. All of the above
Ans. d)
<< Prev- Operating System Fundamentals Week 7 Assignment Solutions
<< Next- Operating System Fundamentals Week 10 Assignment Solutions
Introduction To Internet Of Things | NPTEL | Assignment Solutions
Java Programming: Coursera quiz answers
Online Web development Test for Hiring and Recruitment
The above question set contains all the correct answers. But in any case, you find any typographical, grammatical or any other error in our site then kindly inform us. Don’t forget to provide the appropriate URL along with error description. So that we can easily correct it.
Thanks in advance.
For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.