PRACTICE • LEARN • GROW
Module 4 Final Quiz: Synchronization & Concurrency MCQs
Solve topic-wise placement questions and improve your skills.
Module 4 Final Quiz: Synchronization & Concurrency Progress
0 of 10 completed
0%
Topic Track
You are viewing MCQs in preview mode. Log in to select options, submit answers, and track your progress.
Log In to Answer
1
What is a Race Condition?
A.
A competition between processes to finish execution first
B.
A bug where multiple concurrent threads access and manipulate shared data, and the final outcome depends on the non-deterministic order of execution
C.
A fast context-switch performed by the CPU hardware
D.
A memory leak caused by unclosed sockets
Explanation & Key
Correct Answer:
2
Which three requirements MUST a valid critical section solution satisfy?
A.
Mutual Exclusion, Progress, and Bounded Waiting
B.
Atomicity, Consistency, and Durability
C.
Throughput, Latency, and Turnaround Time
D.
Preemption, Hold and Wait, and Circular Wait
Explanation & Key
Correct Answer:
3
Why does Peterson's Solution fail on modern multi-core superscalar processors without memory barriers?
A.
Because Peterson's solution only works for 3 or more processes
B.
Because modern CPUs and optimizing compilers perform out-of-order execution and memory store-reordering, breaking sequential consistency assumptions
C.
Because modern CPUs lack boolean flags
D.
Because Peterson's solution requires floating point hardware
Explanation & Key
Correct Answer:
4
What is the key difference between a Counting Semaphore and a Binary Semaphore?
A.
A binary semaphore takes values between -1 and 1; counting semaphore is positive only
B.
A binary semaphore is restricted to values 0 and 1 (acting like a mutex lock); a counting semaphore can take any non-negative integer representing available resource units
C.
A counting semaphore can only be used by threads, not processes
D.
A binary semaphore does not support wait() and signal()
Explanation & Key
Correct Answer:
5
What is a Spinlock, and when is it preferred over a sleeping mutex?
A.
A lock that encrypts data; used in web servers
B.
A lock that uses a busy-waiting loop (while loop); preferred in multi-core systems when the expected wait duration is shorter than the cost of two context switches
C.
A lock that resets the CPU upon contention
D.
A lock used exclusively on single-core uniprocessors
Explanation & Key
Correct Answer:
6
In the Producer-Consumer problem with a bounded buffer of size N, what initial value should the 'empty' counting semaphore have?
A.
0
B.
1
C.
N
D.
N - 1
Explanation & Key
Correct Answer:
7
In the Readers-Writers problem, what problem arises when priority is given strictly to readers?
A.
Readers cannot read concurrently
B.
Writers may suffer from starvation as long as a stream of overlapping readers continues to arrive
C.
Data gets corrupted by simultaneous reading
D.
Deadlock occurs between two readers
Explanation & Key
Correct Answer:
8
In the Dining Philosophers Problem, what happens if all five philosophers sit down and simultaneously pick up their left chopsticks?
A.
All philosophers eat together in harmony
B.
Deadlock occurs because every philosopher holds one chopstick and waits indefinitely for their right chopstick (circular wait)
C.
The philosopher on the right gets both chopsticks
D.
The table collapses
Explanation & Key
Correct Answer:
9
How does a Monitor solve the vulnerability of using raw semaphores in concurrent programming?
A.
Monitors run on an external hardware screen
B.
A monitor is a high-level language construct that encapsulates shared data and automatically enforces mutual exclusion on all its internal procedures, preventing misplaced wait/signal bugs
C.
Monitors eliminate the need for condition variables
D.
Monitors turn multi-threaded code into single-threaded code
Explanation & Key
Correct Answer:
10
What is the atomic CPU hardware instruction Test-and-Set?
A.
An instruction that compiles code and runs tests
B.
A hardware opcode executed atomically in a single clock cycle that reads a memory word, returns its old value, and sets it to true
C.
A software function that resets registers
D.
An interrupt service routine in the kernel
Explanation & Key
Correct Answer:
Question Palette
Answered
Current
Not Attempted
Wrong