BCS Operating Systems 1 — Questions and Answers
Question 1: What is a deadlock in operating systems?
- When a process uses 100% CPU
- When two or more processes wait indefinitely for resources held by each other (Correct answer)
- When the OS runs out of virtual memory
- When a process terminates unexpectedly
Correct answer: When two or more processes wait indefinitely for resources held by each other
A deadlock occurs when two or more processes are each waiting for a resource held by another, creating a circular wait with no progress possible.
Question 2: Which CPU scheduling algorithm may cause starvation for low-priority processes?
- Round Robin
- First-Come First-Served
- Priority Scheduling (Correct answer)
- Shortest Job First
Correct answer: Priority Scheduling
Priority Scheduling can cause starvation when high-priority processes continuously arrive and prevent low-priority processes from ever executing.
Question 3: What is virtual memory?
- RAM that has been overclocked
- A technique that uses disk space to extend the apparent available RAM (Correct answer)
- Memory used exclusively by the OS kernel
- Cache memory on the CPU
Correct answer: A technique that uses disk space to extend the apparent available RAM
Virtual memory uses a portion of the hard disk (swap space or page file) to simulate additional RAM, allowing processes to use more memory than physically available.
Question 4: In the context of OS, what is a semaphore?
- A hardware interrupt signal
- A synchronization primitive used to control access to shared resources (Correct answer)
- A memory management unit
- A type of file system
Correct answer: A synchronization primitive used to control access to shared resources
A semaphore is a synchronization tool that uses wait() and signal() operations to coordinate access to shared resources and prevent race conditions.
Question 5: What does the term 'thrashing' refer to in operating systems?
- Excessive context switching with no useful work
- Excessive paging activity where the OS spends more time swapping pages than executing processes (Correct answer)
- CPU overheating under heavy load
- Hard disk fragmentation
Correct answer: Excessive paging activity where the OS spends more time swapping pages than executing processes
Thrashing occurs when a system spends more time handling page faults and swapping pages than executing actual process instructions, severely degrading performance.
Question 6: Which process state transition occurs when a running process is preempted by a higher-priority process?
- Ready → Running
- Running → Blocked
- Running → Ready (Correct answer)
- Blocked → Ready
Correct answer: Running → Ready
When a running process is preempted, it transitions from Running back to Ready, waiting to regain CPU time.
What is a deadlock in operating systems?