Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Chapter: 20
Q481:
Mutual exclusion is preserved in Algorithm 3 because only one process can have _______.
A. flag=true
B. turn equal to its ID
C. both flag and turn at same value
D. access to memory
Correct Answer:
B
Chapter: 20
Q482:
Bounded waiting in Algorithm 3 means that a process will eventually enter its critical section after at most ___________ entries by the other process.
A. two
B. one
C. three
D. infinite
Correct Answer:
B
Chapter: 20
Q483:
In the critical section problem, processes must request permission to enter _______.
A. common memory
B. critical section
C. CPU
D. hard disk
Correct Answer:
B
Chapter: 20
Q484:
What is the main idea behind the Bakery Algorithm?
A. Processes choose a random number
B. Processes wait for administrator's approval
C. Processes take a ticket number
D. Processes compete for CPU time
Correct Answer:
C
Chapter: 20
Q485:
The Bakery Algorithm is named after what real-life scenario?
A. Ticketed service at bakeries
B. Computer repair shop
C. Supermarket checkout
D. Train station
Correct Answer:
A
Chapter: 20
Q486:
In the Bakery Algorithm, if two processes get the same number, the one with _________ gets priority.
A. lower ID
B. higher ID
C. lower memory address
D. higher CPU usage
Correct Answer:
A
Chapter: 20
Q487:
In Bakery Algorithm, the ticket numbers are assigned using the ______ function.
A. random()
B. min()
C. max()
D. sum()
Correct Answer:
C
Chapter: 20
Q488:
(a,b) < (c,d) if _______.
A. a<c or (a==c and b<d)
B. a>d or (a==d and b>d)
C. a>b
D. b<d
Correct Answer:
A
Chapter: 20
Q489:
In the Bakery Algorithm, when can a process Pi enter its critical section?
A. When number[i]=0
B. When number[i] is the smallest among all
C. When number[i] is maximum
D. When choosing[i]=true
Correct Answer:
B
Chapter: 20
Q490:
In the Bakery Algorithm, if P2 and P4 have ticket numbers 7 and 8 respectively, who enters critical section first?
A. P2
B. P4
C. Both together
D. Depends on process ID
Correct Answer:
A
Chapter: 20
Q491:
The maximum number is chosen among _______ to assign a new ticket number in Bakery Algorithm.
A. choosing array
B. number array
C. flag array
D. turn variable
Correct Answer:
B
Chapter: 20
Q492:
The bakery algorithm was proposed by ___________.
A. Edsger Dijkstra
B. Leslie Lamport
C. Donald Knuth
D. John von Neumann
Correct Answer:
B
Chapter: 20
Q493:
Pakistan won the cricket world cup in ___________.
A. 1987
B. 1992
C. 1999
D. 2003
Correct Answer:
B
Chapter: 20
Q494:
In the critical section problem, processes must avoid _______.
A. memory loss
B. deadlock
C. random execution
D. CPU halt
Correct Answer:
B
Chapter: 20
Q495:
If both flag[j]=true and turn=j, the process Pi will _______.
A. enter critical section immediately
B. be stuck in while loop
C. reset its flag
D. jump to remainder section
Correct Answer:
B
Chapter: 20
Q496:
In Algorithm 3, if flag[j]=false, what happens?
A. Pi can enter critical section
B. Pi must wait
C. Pi resets its flag
D. Pi leaves CPU
Correct Answer:
A
Chapter: 20
Q497:
In the Bakery Algorithm, 'choosing[i]=true' indicates that _______.
A. Process is exiting
B. Process is choosing a number
C. Process is in critical section
D. Process is inactive
Correct Answer:
B
Chapter: 20
Q498:
When two processes have the same ticket number, priority is decided based on _______.
A. CPU speed
B. process ID
C. memory usage
D. arrival time
Correct Answer:
B
Chapter: 20
Q499:
The Bakery Algorithm ensures _________ wait among processes.
A. unbounded
B. random
C. bounded
D. infinite
Correct Answer:
C
Chapter: 20
Q500:
Bakery Algorithm is based on the scheduling algorithm used in _________.
A. CPU scheduling
B. bakeries
C. parking lots
D. airports
Correct Answer:
B