Operating Systems MCQs (Set-2)

What is a race condition?

A A process always wins
B A CPU scheduling algorithm
C Result depends on operation timing
D A fixed memory allocation

What is a critical section?

A A process waiting for CPU
B A file system block
C A program's entry point
D Code accessing shared state

What does mutual exclusion ensure?

A Every thread runs at once
B No thread can block
C All tasks have equal priority
D Single thread enters protected region

What does a mutex provide?

A A process identifier
B Mutual exclusion lock
C A page replacement rule
D A file allocation method

What is a semaphore?

A Synchronization counter with operations
B A processor scheduling list
C A disk partition label
D A compiled program image

What is a binary semaphore's value range?

A Any negative integer
B One through ten
C Zero or one
D Only two and three

What is a condition variable used for?

A Wait for a condition change
B Store process code
C Allocate memory pages
D Select a file name

What is a monitor in concurrency?

A A display device only
B Encapsulated shared state and synchronization
C A memory page table
D A process identifier format

What is a deadlock?

A Every process finishes immediately
B Maximum CPU speed
C Tasks wait in cycle
D Duplicate file names

Which is a necessary deadlock condition?

A Infinite CPU speed
B Circular wait
C Sorted processes
D Unique file names

What does hold and wait mean?

A Release all resources before waiting
B Wait without holding any resource
C Hold resources while requesting more
D Hold no locks ever

What is preemption in deadlock handling?

A Allow circular waiting
B Increase every priority
C Ignore unavailable resources
D Take resource from a process

What does deadlock avoidance require?

A No resource requests
B A single CPU only
C Every process identical
D Safe resource allocation decisions

What is the Banker's algorithm used for?

A Deadlock avoidance
B Page replacement
C File encryption
D CPU cache lookup

What is starvation in scheduling?

A Task waits indefinitely for service
B All tasks use equal time
C CPU has no ready work
D A process terminates normally

What is aging used to reduce?

A Page faults
B Disk fragmentation
C Priority starvation
D Context switch cost

What is priority inversion?

A Higher priority task finishes early
B Every task shares one priority
C A thread is permanently terminated
D Low task blocks higher task

What does priority inheritance do?

A Lower every task priority
B Temporarily raise lock holder priority
C Prevent all context switches
D Delete a blocked process

What does atomic operation mean?

A Always completes in zero time
B Runs only in kernel mode
C Indivisible from concurrent observers
D Cannot access shared memory

What does compare and swap do?

A Sort process identifiers
B Conditional atomic value update
C Copy a whole file
D Allocate a page table

What is a reader writer lock optimized to allow?

A Multiple readers or one writer
B Multiple writers always
C One reader only, no writer
D No concurrent access ever

What is a spinlock?

A Lock waits by polling
B Lock that writes to disk
C Condition variable with timeout
D A process scheduling class

Why can spinlocks waste CPU?

A They allocate too many files
B Waiting thread keeps polling
C They require disk seeks
D They disable every processor

What does a barrier synchronization do?

A Select next process
B Release all memory pages
C Move files between folders
D Wait until participants arrive

What is message passing in concurrent systems?

A Exchange data through messages
B Share every memory variable
C Use one global lock
D Queue stores processes