1What is the primary role of an Operating System as a resource manager?
A.To provide a graphical user interface for applications
B.To arbitrate conflicting requests for resources and allocate them efficiently
C.To compile source code into machine code
D.To perform high-speed mathematical calculations
Correct Answer: To arbitrate conflicting requests for resources and allocate them efficiently
Explanation:The OS acts as a resource manager that manages the CPU, memory, and I/O devices, arbitrating conflicting requests to ensure efficient system operation.
Incorrect! Try again.
2Which component of the Operating System resides in the main memory and interacts directly with the hardware?
A.Shell
B.Compiler
C.Kernel
D.Command Interpreter
Correct Answer: Kernel
Explanation:The kernel is the core component of the OS that remains in memory and handles low-level hardware interactions.
Incorrect! Try again.
3In a Time-Sharing System, what is the primary mechanism used to switch the CPU between users?
A.First-Come, First-Served
B.Context Switching
C.Virtual Memory
D.Deadlock Avoidance
Correct Answer: Context Switching
Explanation:Time-sharing systems use rapid context switching to create the illusion that multiple users are using the CPU simultaneously.
Incorrect! Try again.
4Which of the following characterizes a Hard Real-Time System?
A.Deadlines are desirable but not mandatory
B.Missing a deadline results in total system failure
C.Throughput is the only metric of importance
D.It is used primarily for batch processing
Correct Answer: Missing a deadline results in total system failure
Explanation:In Hard Real-Time Systems (e.g., pacemaker, flight control), strict deadlines must be met; failure to do so is catastrophic.
Incorrect! Try again.
5What is the mode bit used for in modern processors?
A.To distinguish between User Mode and Kernel Mode
B.To indicate if the printer is ready
C.To switch between 32-bit and 64-bit processing
D.To flag a page fault
Correct Answer: To distinguish between User Mode and Kernel Mode
Explanation:The hardware uses a mode bit (0 for kernel, 1 for user) to distinguish between executing sensitive OS instructions and standard user applications.
Incorrect! Try again.
6Which system call is used in UNIX/Linux to create a new process?
A.create()
B.new()
C.fork()
D.init()
Correct Answer: fork()
Explanation:The fork() system call is used to create a new process, which is an exact copy of the calling process.
Incorrect! Try again.
7What information is stored in the Process Control Block (PCB)?
A.The source code of the program
B.Process state, Program Counter, CPU registers, and scheduling info
C.The list of all users on the system
D.The file system directory structure
Correct Answer: Process state, Program Counter, CPU registers, and scheduling info
Explanation:The PCB is a data structure used by the OS to store all information specific to a process.
Incorrect! Try again.
8In the context of Process State transitions, when does a process move from Running to Ready?
A.When it finishes execution
B.When it requests I/O
C.When an interrupt (like a timer expiry) occurs
D.When it creates a child process
Correct Answer: When an interrupt (like a timer expiry) occurs
Explanation:A process moves from Running to Ready when it is interrupted (preempted), usually due to a time quantum expiry in scheduling.
Incorrect! Try again.
9What is long-term scheduling responsible for?
A.Selecting which process should be executed next by the CPU
B.Selecting which processes are brought into the ready queue from the job pool
C.Swapping processes in and out of memory
D.Handling interrupts
Correct Answer: Selecting which processes are brought into the ready queue from the job pool
Explanation:Long-term scheduling (Job Scheduler) controls the degree of multiprogramming by selecting jobs to enter the system.
Incorrect! Try again.
10If the Degree of Multiprogramming is too high, what phenomenon might occur?
A.Deadlock
B.Thrashing
C.Starvation
D.Fragmentation
Correct Answer: Thrashing
Explanation:Thrashing occurs when the system spends more time paging (swapping pages in and out) than executing processes because too many processes are competing for limited memory.
Incorrect! Try again.
11Calculate the Turnaround Time () if the Completion Time () is 15ms and the Arrival Time () is 3ms.
A.5ms
B.12ms
C.18ms
D.45ms
Correct Answer: 12ms
Explanation:Turnaround Time is calculated as . Therefore, .
Incorrect! Try again.
12Which scheduling algorithm suffers from the Convoy Effect?
A.Round Robin (RR)
B.Shortest Job First (SJF)
C.First-Come, First-Served (FCFS)
D.Priority Scheduling
Correct Answer: First-Come, First-Served (FCFS)
Explanation:The Convoy Effect happens in FCFS when short processes get stuck waiting behind a long CPU-bound process.
Incorrect! Try again.
13In Shortest Job First (SJF) scheduling, what is the main difficulty in implementation?
A.It leads to frequent context switches
B.It is impossible to know the length of the next CPU burst in advance
C.It requires complex data structures
D.It does not support multiprogramming
Correct Answer: It is impossible to know the length of the next CPU burst in advance
Explanation:SJF is optimal but difficult to implement because the OS cannot precisely predict the length of the next CPU burst for a process.
Incorrect! Try again.
14Which scheduling algorithm is designed specifically for Time-Sharing Systems?
A.First-Come, First-Served
B.Shortest Job First
C.Round Robin
D.Multilevel Queue
Correct Answer: Round Robin
Explanation:Round Robin uses a time quantum to switch between processes, ensuring responsiveness for time-sharing systems.
Incorrect! Try again.
15In Priority Scheduling, what technique is used to solve the problem of Starvation?
A.Paging
B.Aging
C.Swapping
D.Context Switching
Correct Answer: Aging
Explanation:Aging involves gradually increasing the priority of processes that wait in the system for a long time.
Incorrect! Try again.
16Consider three processes P1, P2, P3 with burst times 10, 5, and 8 respectively. In FCFS, if they arrive in order P1, P2, P3, what is the waiting time for P3?
A.10
B.15
C.23
D.0
Correct Answer: 15
Explanation:P1 runs for 10 (0-10). P2 runs for 5 (10-15). P3 starts at 15. Since P3 arrived at 0, its waiting time is 15.
Incorrect! Try again.
17What is the definition of Throughput in CPU scheduling?
A.The amount of time a process spends waiting in the ready queue
B.The number of processes that complete their execution per time unit
C.The time from submission to completion
D.The percentage of time the CPU is busy
Correct Answer: The number of processes that complete their execution per time unit
Explanation:Throughput measures the rate at which processes are completed.
Incorrect! Try again.
18In a Multilevel Feedback Queue, a process that uses too much CPU time is usually:
A.Moved to a higher priority queue
B.Moved to a lower priority queue
C.Terminated immediately
D.Left in the same queue
Correct Answer: Moved to a lower priority queue
Explanation:Multilevel Feedback Queues punish CPU-bound processes by moving them to lower priority queues to allow interactive (I/O bound) processes to run.
Incorrect! Try again.
19Which type of memory fragmentation occurs when there is enough total free space to satisfy a request, but the available spaces are not contiguous?
A.Internal Fragmentation
B.External Fragmentation
C.Page Fault
D.Segmentation Fault
Correct Answer: External Fragmentation
Explanation:External fragmentation happens when free memory is scattered in small blocks, making it impossible to allocate a large contiguous block.
Incorrect! Try again.
20In Paging, the physical memory is divided into fixed-sized blocks called:
A.Pages
B.Frames
C.Segments
D.Sectors
Correct Answer: Frames
Explanation:Physical memory is divided into Frames, while logical memory is divided into Pages of the same size.
Incorrect! Try again.
21The mapping of a logical address to a physical address is done in hardware by the:
A.Memory Management Unit (MMU)
B.Arithmetic Logic Unit (ALU)
C.Direct Memory Access (DMA)
D.Translation Lookaside Buffer (TLB)
Correct Answer: Memory Management Unit (MMU)
Explanation:The MMU is the hardware device responsible for run-time mapping from virtual to physical addresses.
Incorrect! Try again.
22If a logical address consists of a page number and an offset , the physical address is generated by:
A.Adding to the base register
B.Using as an index into the page table to find frame , then combining with
C.Multiplying by the frame size
D.Subtracting from the limit register
Correct Answer: Using as an index into the page table to find frame , then combining with
Explanation:The page table maps page number to frame number . The offset is not changed, resulting in physical address .
Incorrect! Try again.
23What is the purpose of the Translation Lookaside Buffer (TLB)?
A.To store the entire page table
B.To cache recently used page-table entries to speed up address translation
C.To handle page faults
D.To store dirty pages before writing to disk
Correct Answer: To cache recently used page-table entries to speed up address translation
Explanation:The TLB is a fast associative memory cache used to reduce the effective memory access time by storing recent translations.
Incorrect! Try again.
24What is Internal Fragmentation?
A.When memory is allocated in fixed-sized blocks and the process needs less than the allocated block size
B.When memory is scattered in non-contiguous blocks
C.When the hard disk is fragmented
D.When the page table becomes too large
Correct Answer: When memory is allocated in fixed-sized blocks and the process needs less than the allocated block size
Explanation:Internal fragmentation occurs inside an allocated partition (like the last page of a process) when the data is smaller than the partition size.
Incorrect! Try again.
25Which page replacement algorithm suffers from Belady's Anomaly?
A.LRU (Least Recently Used)
B.Optimal
C.FIFO (First-In, First-Out)
D.LFU (Least Frequently Used)
Correct Answer: FIFO (First-In, First-Out)
Explanation:Belady's Anomaly is the phenomenon where increasing the number of page frames results in an increase in page faults, occurring in FIFO.
Incorrect! Try again.
26What is the Optimal Page Replacement algorithm?
A.Replace the page that has been in memory the longest
B.Replace the page that will not be used for the longest period of time
C.Replace the page that was used least recently
D.Replace the page with the lowest frequency count
Correct Answer: Replace the page that will not be used for the longest period of time
Explanation:The Optimal algorithm replaces the page that will not be used for the longest duration in the future. It requires future knowledge, so it is used mainly for comparison.
Incorrect! Try again.
27In Segmentation, a logical address consists of:
A.Page number, Offset
B.Segment number, Offset
C.Frame number, Key
D.Base, Limit
Correct Answer: Segment number, Offset
Explanation:Segmentation views memory as a collection of segments, addressed by a tuple: .
Incorrect! Try again.
28Which bit in a page table entry indicates whether the page has been modified (written to)?
A.Valid/Invalid bit
B.Dirty (Modify) bit
C.Reference bit
D.Protection bit
Correct Answer: Dirty (Modify) bit
Explanation:The Dirty bit is set when a page is written to. If set, the page must be written back to disk (swapped out) before being replaced.
Incorrect! Try again.
29What is a Race Condition?
A.A situation where multiple processes read and write shared data concurrently and the outcome depends on the order of execution
B.A condition where a process runs faster than the CPU clock
C.A scheduling algorithm for real-time systems
D.When two processes try to print at the same time
Correct Answer: A situation where multiple processes read and write shared data concurrently and the outcome depends on the order of execution
Explanation:A race condition occurs when the final state of shared data depends on the specific timing or ordering of concurrent process execution.
Incorrect! Try again.
30The segment of code where a process accesses shared resources is called the:
A.Entry Section
B.Critical Section
C.Remainder Section
D.Exit Section
Correct Answer: Critical Section
Explanation:The Critical Section is the part of the code where shared resources (variables, files, etc.) are accessed.
Incorrect! Try again.
31Which of the following is NOT a requirement for a solution to the Critical Section Problem?
A.Mutual Exclusion
B.Progress
C.Bounded Waiting
D.First-Come First-Served
Correct Answer: First-Come First-Served
Explanation:The three requirements are Mutual Exclusion, Progress, and Bounded Waiting. FCFS is a scheduling policy, not a synchronization requirement.
Incorrect! Try again.
32What is a Semaphore?
A.A hardware interrupt
B.A distinct memory segment
C.An integer variable accessed only through two atomic operations: wait() and signal()
D.A type of system call for I/O
Correct Answer: An integer variable accessed only through two atomic operations: wait() and signal()
Explanation:A semaphore is a synchronization tool (integer variable) used to manage concurrent processes via atomic operations.
Incorrect! Try again.
33If a semaphore is initialized to 1, and process P1 executes wait(S), what is the new value of ?
A.0
B.1
C.2
D.-1
Correct Answer: 0
Explanation:The wait(S) operation decrements the value of the semaphore. If , it becomes 0 and the process enters the critical section.
Incorrect! Try again.
34What is a Binary Semaphore often called?
A.Spinlock
B.Mutex Lock
C.Monitor
D.Counter
Correct Answer: Mutex Lock
Explanation:A binary semaphore takes values 0 and 1, providing Mutual Exclusion, hence the name Mutex.
Incorrect! Try again.
35In the Producer-Consumer problem using a bounded buffer, what happens if the buffer is full?
A.The Consumer blocks
B.The Producer blocks
C.The system crashes
D.Data is overwritten
Correct Answer: The Producer blocks
Explanation:If the buffer is full, the Producer must wait (block) until the Consumer removes an item and creates space.
Incorrect! Try again.
36Which of the following is NOT a necessary condition for Deadlock to occur (Coffman conditions)?
A.Mutual Exclusion
B.Hold and Wait
C.Preemption
D.Circular Wait
Correct Answer: Preemption
Explanation:The condition is No Preemption. If resources can be preempted (taken away), deadlocks can be broken.
Incorrect! Try again.
37The Banker's Algorithm is used for:
A.Deadlock Prevention
B.Deadlock Avoidance
C.Deadlock Detection
D.Deadlock Recovery
Correct Answer: Deadlock Avoidance
Explanation:The Banker's Algorithm avoids deadlock by simulating resource allocation and checking if the system remains in a 'Safe State'.
Incorrect! Try again.
38What does the Circular Wait condition imply?
A.Processes are waiting in a circle for CPU time
B.A set of processes exists such that waits for , waits for , ..., waits for
C.Memory is allocated in a circular buffer
D.The scheduler uses Round Robin
Correct Answer: A set of processes exists such that waits for , waits for , ..., waits for
Explanation:Circular wait describes a closed chain of processes where each process holds a resource that the next process in the chain needs.
Incorrect! Try again.
39Which Inter-process Communication (IPC) mechanism allows data to flow in only one direction?
A.Shared Memory
B.Socket
C.Ordinary Pipe (Anonymous Pipe)
D.Message Queue
Correct Answer: Ordinary Pipe (Anonymous Pipe)
Explanation:Standard ordinary pipes are unidirectional (half-duplex). Data flows from the write-end to the read-end.
Incorrect! Try again.
40What is the Dining Philosophers Problem an example of?
A.Memory Management issues
B.Synchronization and Deadlock issues
C.CPU Scheduling efficiency
D.File System corruption
Correct Answer: Synchronization and Deadlock issues
Explanation:It is a classic synchronization problem illustrating the challenges of allocating limited resources (forks) among concurrent processes (philosophers) without causing deadlock or starvation.
Incorrect! Try again.
41In a system with instances of a resource and processes, if , what can be said about Deadlock?
A.Deadlock is inevitable
B.Deadlock will never occur
C.Deadlock might occur depending on timing
D.The system is in an unsafe state
Correct Answer: Deadlock will never occur
Explanation:This is a derived formula. If the total resources cover the worst-case scenario where every process holds resources plus one extra to finish one process, deadlock is impossible.
Incorrect! Try again.
42What is a Spinlock?
A.A lock where a thread loops (spins) while waiting for the lock to become available
B.A hard disk mechanism
C.A type of deadlock
D.A scheduling queue
Correct Answer: A lock where a thread loops (spins) while waiting for the lock to become available
Explanation:Spinlocks cause the waiting process to busy-wait (loop) checking the lock condition, which wastes CPU cycles but avoids context switch overhead.
Incorrect! Try again.
43In the context of IPC, what does Message Passing involve?
A.Two processes sharing a variable in memory
B.Using send() and receive() primitives
C.Writing to a hard disk file
D.Using CPU registers directly
Correct Answer: Using send() and receive() primitives
Explanation:Message passing allows processes to communicate without shared memory by explicitly sending and receiving messages.
Incorrect! Try again.
44What is the main advantage of Threads over Processes?
A.Threads are more secure
B.Threads have their own memory space
C.Context switching between threads is faster and they share resources
D.Threads cannot deadlock
Correct Answer: Context switching between threads is faster and they share resources
Explanation:Threads within the same process share code and data sections, making creation and context switching significantly lighter/faster than full processes.
Incorrect! Try again.
45Which variable in a Semaphore implementation must be protected by a critical section?
A.The process ID
B.The integer value of the semaphore
C.The system clock
D.The name of the semaphore
Correct Answer: The integer value of the semaphore
Explanation:The integer value determines the state of the resource. Modifications to it (increments/decrements) must be atomic to prevent race conditions.
Incorrect! Try again.
46What is the Resource Allocation Graph (RAG) used for?
A.Scheduling CPUs
B.Visualizing memory allocation
C.Detecting Deadlocks
D.Managing file permissions
Correct Answer: Detecting Deadlocks
Explanation:A RAG is a directed graph where cycles can indicate the presence of a deadlock (if there is only one instance of each resource type).
Incorrect! Try again.
47In Demand Paging, when is a page brought into memory?
A.When the process starts
B.Only when it is explicitly requested/accessed during execution
C.Before the CPU schedules the process
D.Every 5 milliseconds
Correct Answer: Only when it is explicitly requested/accessed during execution
Explanation:Demand paging loads pages only when a page fault occurs (i.e., the page is needed), reducing I/O and memory usage.
Incorrect! Try again.
48If the Time Quantum in Round Robin scheduling is extremely large, the algorithm behaves like:
A.Shortest Job First (SJF)
B.First-Come, First-Served (FCFS)
C.Priority Scheduling
D.Multilevel Queue
Correct Answer: First-Come, First-Served (FCFS)
Explanation:If the quantum is larger than the longest burst time, the process finishes without interruption, making it identical to FCFS.
Incorrect! Try again.
49Which memory placement strategy allocates the smallest hole that is big enough?
A.First-Fit
B.Best-Fit
C.Worst-Fit
D.Next-Fit
Correct Answer: Best-Fit
Explanation:Best-Fit searches the entire list for the smallest hole that fits the process. This produces the smallest leftover hole.
Incorrect! Try again.
50What distinguishes User-Level Threads from Kernel-Level Threads?
A.User threads are managed by the kernel
B.Kernel threads are faster to create
C.User threads are managed by a library without kernel support
D.User threads can run on different processors simultaneously
Correct Answer: User threads are managed by a library without kernel support
Explanation:User-level threads are managed in user space. The kernel is unaware of them, so if one blocks, the entire process blocks (in Many-to-One models).