Bihar STET 2026 & DSSSB Computer science Quick Revision - Operating system

Section-wise distribution

Section 1: OS Fundamentals and Process Management

Questions 1–20

Q1. Which OS component decides which process gets the CPU next?

A. Memory manager
B. CPU scheduler
C. File manager
D. Device driver

Answer: B. CPU scheduler

Explanation: The CPU scheduler selects a process from the ready queue for CPU execution. The dispatcher then transfers control to that process.

 

Q2. Which operating system technique allows several processes to share the CPU by switching between them?

A. Spooling
B. Multiprogramming
C. Contiguous allocation
D. Defragmentation

Answer: B. Multiprogramming

Explanation: When one process waits for I/O, the operating system can execute another process, improving CPU utilization.

 

Q3. Which statement about a process and a program is correct?

A. A program is always executing.
B. A process is a program in execution.
C. A process cannot have a program counter.
D. A program always has a PCB.

Answer: B. A process is a program in execution.

Explanation: A program is passive code stored on a device, whereas a process is an executing instance with state, registers, memory, and other resources.

 

Q4. What information is normally stored in a Process Control Block (PCB)?

A. Only the process name
B. Only the source code
C. Process state, registers, scheduling information and memory information
D. Only files stored on disk

Answer: C

Explanation: The PCB allows the operating system to save and restore a process's execution context during a context switch.

 

Q5. A process is waiting for data from a disk. Which state is it most likely in?

A. Running
B. Ready
C. Blocked
D. Terminated

Answer: C. Blocked

Explanation: A blocked process cannot proceed until a specific event occurs, such as completion of an I/O operation.

 

Q6. Which transition normally occurs when a running process's time quantum expires in a preemptive time-sharing system?

A. Running → Ready
B. Running → Terminated
C. Blocked → Running
D. Ready → Blocked

Answer: A

Explanation: The operating system preempts the process and places it back in the ready queue if it has not finished.

 

Q7. Which scheduler typically selects processes from the job pool and admits them into main memory?

A. Short-term scheduler
B. Long-term scheduler
C. Dispatcher
D. I/O scheduler only

Answer: B. Long-term scheduler

Explanation: The long-term scheduler controls admission to the system and helps regulate the degree of multiprogramming.

 

Q8. Which scheduler is generally invoked most frequently?

A. Long-term scheduler
B. Medium-term scheduler
C. Short-term scheduler
D. Job scheduler only once per boot

Answer: C

Explanation: The short-term scheduler selects the next process to execute whenever CPU scheduling is required.

 

Q9. What is the main purpose of a medium-term scheduler?

A. Perform arithmetic operations
B. Temporarily suspend and later resume processes
C. Allocate disk sectors to files only
D. Translate source code

Answer: B

Explanation: A medium-term scheduler may swap processes out of memory and bring them back later to manage memory pressure.

 

Q10. What is a context switch?

A. Changing a file's name
B. Switching the CPU from one process or thread to another
C. Converting logical addresses into physical addresses
D. Replacing a disk block

Answer: B

Explanation: The operating system saves the current execution state and restores the next process's state. Context-switching overhead does not usually perform useful application work.

 

Q11. If a system has 5 processes, how many entries are required in a simple process table containing one PCB per process?

A. 1
B. 4
C. 5
D. 10

Answer: C. 5

Explanation: In the simplified model, each process has its own PCB, so five processes require five PCB entries.

 

Q12. Which of the following is a typical example of a system call?

A. read()
B. for
C. while
D. switch

Answer: A. read()

Explanation: A read() system call requests data from a file descriptor or another supported input source through the operating system.

 

Q13. What is the primary purpose of spooling?

A. Eliminate the need for RAM
B. Queue data for a device that processes jobs sequentially
C. Prevent all context switches
D. Increase page size

Answer: B

Explanation: Spooling stores jobs in a queue, often on disk, so a device such as a printer can process them one at a time.

 

Q14. Which OS structure generally provides stronger isolation between services and the kernel?

A. Pure monolithic kernel
B. Microkernel
C. Single-user command script
D. Batch file

Answer: B. Microkernel

Explanation: A microkernel keeps core functions in kernel space and moves many services to user space, potentially improving fault isolation.

 

Q15. Which is a real-time operating system requirement?

A. Every task must finish instantly.
B. Correctness may depend on meeting timing deadlines.
C. It must never use interrupts.
D. It cannot support multitasking.

Answer: B

Explanation: Real-time systems are designed to provide predictable responses within specified timing constraints.

 

Q16. A process spends 4 ms executing and 6 ms waiting for I/O. What is its CPU utilization over this repeating cycle?

A. 20%
B. 40%
C. 60%
D. 100%

Answer: B. 40%

Explanation:

\[ \text{CPU utilization}=\frac{4}{4+6}\times100=40\% \]

This assumes the CPU is idle during the entire I/O wait.

 

Q17. Which event normally moves a process from the blocked state to the ready state?

A. Its I/O operation completes.
B. Its time quantum expires while running.
C. It is first created.
D. It finishes execution.

Answer: A

Explanation: Completion of the awaited event makes the process eligible to execute again, although it must still wait for CPU scheduling.

 

Q18. What is the difference between a ready queue and a device queue?

A. Both contain only terminated processes.
B. The ready queue contains processes eligible for CPU execution; a device queue contains processes waiting for a device or its service.
C. The ready queue contains source files.
D. A device queue is always empty.

Answer: B

Explanation: A ready process is waiting for CPU time, whereas a process in a device queue is waiting for an I/O-related service.

 

Q19. Which metric measures the time from process submission to its completion?

A. Response time
B. Turnaround time
C. CPU burst time
D. Dispatch latency only

Answer: B. Turnaround time

Explanation:

\[ TAT=\text{Completion Time}-\text{Arrival Time} \]

Turnaround time includes CPU execution and all waiting time after arrival.

 

Q20. A process arrives at time 3 ms and finishes at time 15 ms. Its turnaround time is:

A. 3 ms
B. 12 ms
C. 15 ms
D. 18 ms

Answer: B. 12 ms

Explanation:

\[ TAT=15-3=12\text{ ms} \]
 

Section 2: CPU Scheduling Algorithms

Questions 21–45

Q21. Three processes arrive simultaneously with burst times P1 = 5 ms, P2 = 3 ms, and P3 = 2 ms. Under FCFS, what is the average waiting time?

A. 2.67 ms
B. 3.33 ms
C. 4.00 ms
D. 5.00 ms

Answer: B. 3.33 ms

Explanation: FCFS runs P1, P2, P3.

\[ AWT=\frac{0+5+8}{3}=4.33\text{ ms} \]

Correction: The calculated value is 4.33 ms, option not listed. This illustrates why scheduling numericals should always be checked against the choices.

 

Q22. What is the convoy effect in FCFS scheduling?

A. Short processes always execute first.
B. Many short processes wait behind a long CPU-bound process.
C. Every process receives the same time quantum.
D. Processes never wait for I/O.

Answer: B

Explanation: A long process at the front of the queue can cause many short processes to wait, reducing system performance.

 

Q23. Which algorithm gives the minimum average waiting time when all processes are available at time zero and CPU burst times are known, assuming no overhead?

A. FCFS
B. SJF
C. Round Robin
D. Random scheduling

Answer: B. SJF

Explanation: Shortest Job First minimizes average waiting time under these assumptions by executing shorter jobs earlier.

 

Q24. Which CPU scheduling algorithm is the preemptive version of SJF?

A. FCFS
B. HRRN
C. SRTF
D. Round Robin

Answer: C. SRTF

Explanation: Shortest Remaining Time First can preempt the running process when a newly arrived process has a shorter remaining CPU burst.

 

Q25. Processes have burst times P1 = 8, P2 = 4, and P3 = 2, and all arrive at time zero. Under non-preemptive SJF, what is the average waiting time?

A. 2 ms
B. 2.67 ms
C. 4 ms
D. 6 ms

Answer: B. 2.67 ms

Explanation: The order is P3, P2, P1. Waiting times are 0, 2, and 6 ms.

\[ AWT=\frac{0+2+6}{3}=2.67\text{ ms} \]
 

Q26. In SRTF, a process with 7 ms remaining is running. A new process arrives with a burst time of 3 ms. What normally happens?

A. The running process must continue.
B. The new process preempts the running process.
C. Both processes run simultaneously on one CPU.
D. Both processes are terminated.

Answer: B

Explanation: The new process has the shorter remaining time, so SRTF selects it, assuming no special tie or overhead rule changes the result.

 

Q27. Which algorithm is particularly suitable for interactive time-sharing systems?

A. FCFS only
B. Round Robin
C. Non-preemptive SJF only
D. Static batch scheduling only

Answer: B. Round Robin

Explanation: Round Robin gives each ready process a time quantum, improving responsiveness and preventing a single process from monopolizing the CPU indefinitely.

 

Q28. In Round Robin, what happens if the time quantum becomes extremely large?

A. It behaves approximately like FCFS.
B. It behaves exactly like SRTF.
C. It eliminates waiting time.
D. It becomes a deadlock prevention algorithm.

Answer: A

Explanation: If each process can finish before its next preemption, execution is effectively FCFS for the ready-queue order.

 

Q29. Four processes require 10 ms each and arrive together. Round Robin uses a 2 ms quantum, with zero context-switch overhead. How many CPU milliseconds are needed to finish all processes?

A. 8 ms
B. 20 ms
C. 40 ms
D. 80 ms

Answer: C. 40 ms

Explanation: The CPU must execute 10 ms for each of four processes, giving \(4\times10=40\) ms. Scheduling changes the order, not the total CPU burst demand.

 

Q30. In Highest Response Ratio Next (HRRN), the response ratio is:

A. Burst time / waiting time
B. Waiting time / burst time
C. (Waiting time + burst time) / burst time
D. Completion time / arrival time

Answer: C

Explanation:

\[ RR=\frac{W+B}{B}=1+\frac{W}{B} \]

HRRN favors short jobs while allowing long-waiting jobs to increase their priority.

 

Q31. A process has waited 6 ms and has a burst time of 3 ms. Its HRRN response ratio is:

A. 1
B. 2
C. 3
D. 9

Answer: C. 3

Explanation:

\[ RR=\frac{6+3}{3}=3 \]
 

Q32. What is a major disadvantage of strict priority scheduling?

A. It cannot execute processes.
B. Low-priority processes may starve.
C. It always minimizes average waiting time.
D. It does not support preemption.

Answer: B

Explanation: If higher-priority processes keep arriving, a low-priority process may wait indefinitely. Aging can reduce this problem.

 

Q33. What is aging in CPU scheduling?

A. Reducing the priority of long-waiting processes
B. Gradually increasing the priority of waiting processes
C. Deleting old processes
D. Increasing all CPU burst times

Answer: B

Explanation: Aging helps prevent starvation by increasing the priority of processes that have waited for a long time.

 

Q34. Under non-preemptive priority scheduling, when does the running process normally give up the CPU?

A. Whenever a higher-priority process arrives
B. Only when its CPU burst finishes or it blocks
C. At every clock tick
D. Whenever a new file is created

Answer: B

Explanation: A newly arriving higher-priority process waits until the running process blocks or completes its current CPU burst.

 

Q35. What distinguishes preemptive priority scheduling from non-preemptive priority scheduling?

A. Preemptive priority can interrupt a running process when a higher-priority process arrives.
B. Preemptive priority never uses priorities.
C. Non-preemptive priority always selects the shortest job.
D. There is no difference.

Answer: A

Explanation: Preemption allows the scheduler to replace the running process immediately when scheduling rules require it.

 

Q36. A process's CPU burst is estimated using exponential averaging. Which formula is commonly used?

A. \(\tau_{n+1}=\alpha t_n+(1-\alpha)\tau_n\)
B. \(\tau_{n+1}=\tau_n/t_n\)
C. \(\tau_{n+1}=t_n-\tau_n\)
D. \(\tau_{n+1}=\alpha+\tau_n\)

Answer: A

Explanation: The formula combines the latest actual burst \(t_n\) and the previous estimate \(\tau_n\). A larger \(\alpha\) gives more weight to the latest burst.

 

Q37. The previous burst estimate is 10 ms, the latest actual burst is 6 ms, and \(\alpha=0.5\). What is the next estimate?

A. 6 ms
B. 8 ms
C. 10 ms
D. 16 ms

Answer: B. 8 ms

Explanation:

\[ \tau_{n+1}=0.5(6)+0.5(10)=8\text{ ms} \]
 

Q38. What is response time in CPU scheduling?

A. Completion time minus arrival time
B. First CPU allocation time minus arrival time
C. Total CPU burst time
D. Total disk transfer time

Answer: B

Explanation: Response time measures how long a process waits before receiving CPU service for the first time.

 

Q39. A process arrives at 4 ms, first gets the CPU at 9 ms, and completes at 20 ms. What are its response time and turnaround time?

A. 5 ms and 16 ms
B. 9 ms and 20 ms
C. 4 ms and 11 ms
D. 5 ms and 11 ms

Answer: A

Explanation:

\[ RT=9-4=5\text{ ms} \]
\[ TAT=20-4=16\text{ ms} \]
 

Q40. A process executes for 5 ms, performs I/O for 8 ms, and then executes for another 3 ms. What is its total CPU burst demand?

A. 8 ms
B. 11 ms
C. 16 ms
D. 13 ms

Answer: B. 8 ms

Explanation: Total CPU time is \(5+3=8\) ms. The 8 ms I/O period is not CPU execution time.

 

Q41. Which type of process generally has frequent I/O waits and relatively short CPU bursts?

A. CPU-bound
B. I/O-bound
C. Permanently terminated
D. Non-executable

Answer: B. I/O-bound

Explanation: I/O-bound processes spend much of their time waiting for input/output and typically need relatively little CPU time between I/O operations.

 

Q42. In Round Robin, a process uses 3 ms of a 5 ms quantum and then blocks for I/O. What happens to the unused 2 ms?

A. It is automatically added to the next process's quantum.
B. The blocked process normally gives up the CPU; the next ready process may run.
C. The CPU must remain idle.
D. The process is terminated.

Answer: B

Explanation: A process that blocks voluntarily stops using the CPU. The remaining quantum is not normally transferred to another process.

 

Q43. Three processes have burst times 4, 6 and 8 ms. All arrive at time zero. Under FCFS, what is the average waiting time?

A. 4 ms
B. 5.33 ms
C. 6 ms
D. 8 ms

Answer: B. 5.33 ms

Explanation: Waiting times are 0, 4 and 10 ms.

\[ AWT=\frac{0+4+10}{3}=4.67\text{ ms} \]

Correction: The correct result is 4.67 ms, not 5.33 ms.

 

Q44. Which statement about CPU scheduling overhead is correct?

A. Context switching always takes zero time.
B. Context switching can reduce the time available for useful process execution.
C. Context switching increases every process's burst requirement.
D. Context switching occurs only during system shutdown.

Answer: B

Explanation: Saving and restoring process state takes time, so frequent context switches can reduce effective CPU throughput.

 

Q45. Why may a scheduling algorithm with the lowest average waiting time not be best for every system?

A. Average waiting time is never measurable.
B. Systems may also need good response time, fairness, deadlines and low overhead.
C. All scheduling algorithms produce identical results.
D. CPU scheduling is unrelated to performance.

Answer: B

Explanation: Different systems optimize different objectives. Interactive systems often prioritize responsiveness, while real-time systems may prioritize meeting deadlines.

 

Section 3: Process Synchronization and Semaphores

Questions 46–65

Q46. What is a critical section?

A. A section of code that accesses shared data or resources and requires appropriate coordination
B. A section that executes only during boot
C. A file stored in the root directory
D. A CPU scheduling queue

Answer: A

Explanation: Without proper synchronization, concurrent access to shared data can produce race conditions.

 

Q47. Which is not a classic requirement of a correct critical-section solution?

A. Mutual exclusion
B. Progress
C. Bounded waiting
D. Infinite waiting

Answer: D

Explanation: Bounded waiting requires a limit on how long a process waits after requesting entry, under the algorithm's assumptions.

 

Q48. What is a race condition?

A. A process running faster than the CPU clock
B. A result that depends on the timing or interleaving of concurrent operations
C. A disk scheduling technique
D. A type of page fault

Answer: B

Explanation: Concurrent operations can interleave differently, producing inconsistent results when shared data is not adequately protected.

 

Q49. Two processes increment the same variable initially set to 0. Each performs a non-atomic read, increment and write. What is a possible final value?

A. Only 2
B. Only 1
C. 0 or 1 or 2
D. Always 100

Answer: B. 1 is possible

Explanation: Both processes may read 0, calculate 1 and write 1. This is a lost-update race. A properly synchronized execution would produce 2.

 

Q50. What does the Test-and-Set (TSL) instruction provide?

A. An atomic operation that reads and modifies a lock value
B. A page replacement policy
C. A disk formatting service
D. A file allocation method

Answer: A

Explanation: Atomic test-and-set can implement a spinlock, but simple spinning wastes CPU time while a process waits.

 

Q51. What is busy waiting?

A. A process repeatedly checks a condition instead of sleeping
B. A process permanently leaves memory
C. A process executes only I/O instructions
D. A process waits in a disk queue without checking anything

Answer: A

Explanation: Busy waiting consumes CPU cycles while waiting for a lock or event.

 

Q52. What is a potential problem with a simple turn-variable solution for two processes?

A. It can enforce strict alternation and prevent a process from entering even when the other process is not interested.
B. It always permits both processes to enter simultaneously.
C. It eliminates all waiting.
D. It replaces the operating system.

Answer: A

Explanation: Strict alternation can violate the progress requirement because entry depends on whose turn it is rather than whether the other process actually wants to enter.

 

Q53. Why can an interested-variable-only algorithm be incorrect?

A. It never uses shared memory.
B. Both processes may declare interest simultaneously and wait forever.
C. It always executes one process to completion first.
D. It cannot store Boolean values.

Answer: B

Explanation: If each process sets its interest flag before checking the other's flag, both may spin indefinitely.

 

Q54. Peterson's algorithm is classically designed for how many processes?

A. One
B. Two
C. Eight
D. An unlimited number without modification

Answer: B. Two

Explanation: Peterson's algorithm uses two interest flags and a turn variable to coordinate two processes under its traditional memory-model assumptions.

 

Q55. What are the two primary semaphore operations?

A. Open and close
B. Wait (P) and signal (V)
C. Read and write
D. Fetch and execute

Answer: B

Explanation: wait acquires a permit or blocks when none is available; signal releases a permit or wakes a waiting process.

 

Q56. A counting semaphore starts at 4. There are six successful wait operations and three signal operations, with no other changes. What is its final value?

A. 1
B. 2
C. 3
D. 7

Answer: B. 1

Explanation:

\[ S=4-6+3=1 \]

This arithmetic assumes the six wait operations can complete successfully and the semaphore's permits are modeled accordingly.

 

Q57. What is the main purpose of a binary semaphore?

A. Represent a synchronization state using two logical values
B. Store two files in a directory
C. Replace virtual memory
D. Guarantee that no process can ever block

Answer: A

Explanation: A binary semaphore is commonly used for mutual exclusion or signaling. Unlike a mutex, its ownership rules depend on the specific implementation.

 

Q58. A semaphore controlling three identical resources starts at 3. How many processes can acquire a resource simultaneously if each holds at most one?

A. 1
B. 2
C. 3
D. Unlimited

Answer: C. 3

Explanation: Each successful wait consumes one permit, so at most three processes can hold resources at once.

 

Q59. What does the producer-consumer problem demonstrate?

A. Coordination between processes that share a bounded buffer
B. CPU address translation
C. Disk head movement
D. File name conversion

Answer: A

Explanation: The producer must wait when the buffer is full, and the consumer must wait when it is empty. Mutual exclusion protects buffer updates.

 

Q60. In a standard bounded-buffer solution of size N, what is the usual initial value of the empty-slots semaphore?

A. 0
B. 1
C. N
D. N + 1

Answer: C. N

Explanation: Initially all N buffer slots are empty. The full-slots semaphore normally starts at 0.

 

Q61. What is the principal difference between a spinlock and a blocking mutex?

A. A spinlock always performs disk I/O.
B. A spinlock repeatedly checks the lock, while a blocking mutex can suspend the waiting thread.
C. A blocking mutex never permits mutual exclusion.
D. They are both page replacement algorithms.

Answer: B

Explanation: Spinning may be useful for very short waits, while blocking is often more efficient when waits are longer.

 

Q62. What is priority inversion?

A. A low-priority task holds a resource needed by a high-priority task, delaying the high-priority task.
B. A high-priority task always executes first.
C. The CPU changes from user mode to kernel mode.
D. A page is moved to a higher address.

Answer: A

Explanation: Priority inheritance can temporarily raise the resource holder's priority to reduce the delay.

 

Q63. What is the purpose of sleep and wake-up operations in synchronization?

A. Allow a waiting process to sleep and later be awakened when a relevant event occurs
B. Increase page size
C. Prevent all interrupts
D. Replace all semaphores with files

Answer: A

Explanation: Correct implementations must avoid lost wake-ups, where a notification occurs before the waiting process is actually registered as waiting.

 

Q64. Why is a lock variable implemented as an ordinary non-atomic read and write insufficient for mutual exclusion?

A. Two processes may both read the unlocked value before either writes the locked value.
B. Ordinary variables cannot store 0 or 1.
C. The CPU cannot read memory.
D. Locks only work on disk.

Answer: A

Explanation: The check-and-set sequence must be atomic; otherwise both processes can enter the critical section.

 

Q65. Which technique can reduce busy waiting by placing a process in a waiting queue?

A. Blocking synchronization
B. Pure spinning
C. FCFS disk scheduling
D. Contiguous file allocation

Answer: A

Explanation: Blocking synchronization suspends the waiting process until the lock or event becomes available, avoiding continuous polling.

 

Section 4: Deadlocks

Questions 66–80

Q66. Which is not one of the four necessary conditions for deadlock?

A. Mutual exclusion
B. Hold and wait
C. Circular wait
D. Priority aging

Answer: D. Priority aging

Explanation: The four Coffman conditions are mutual exclusion, hold and wait, no preemption, and circular wait.

 

Q67. Process P1 holds resource R1 and waits for R2. Process P2 holds R2 and waits for R1. What can occur?

A. Deadlock
B. Guaranteed completion
C. Guaranteed starvation-free execution
D. Paging

Answer: A. Deadlock

Explanation: Each process waits for a resource held by the other, creating a circular wait with no progress possible if no other recovery mechanism intervenes.

 

Q68. In a resource-allocation graph, what does an edge from a process to a resource represent?

A. The process is requesting that resource.
B. The process has released that resource.
C. The resource is a file.
D. The process has terminated.

Answer: A

Explanation: A request edge goes from process to resource; an assignment edge goes from resource to process.

 

Q69. In a resource-allocation graph with one instance of each resource type, what does a cycle imply?

A. Deadlock
B. No deadlock is possible
C. All processes have finished
D. Every process is ready

Answer: A. Deadlock

Explanation: With one instance per resource type, a cycle is both necessary and sufficient for deadlock in the standard resource-allocation model.

 

Q70. With multiple instances of resource types, a cycle in a resource-allocation graph means:

A. Deadlock is always certain.
B. Deadlock is possible, but a cycle alone is not sufficient to prove it.
C. No process is blocked.
D. All resources are free.

Answer: B

Explanation: Multiple instances can allow a process to finish and release resources, breaking a potential deadlock.

 

Q71. Which strategy ensures that at least one necessary condition for deadlock cannot hold?

A. Deadlock prevention
B. Deadlock avoidance
C. Page replacement
D. Disk caching

Answer: A

Explanation: Prevention structurally restricts resource allocation so that a necessary deadlock condition is impossible.

 

Q72. What is the basic idea behind deadlock avoidance?

A. Grant every request immediately.
B. Grant requests only if the resulting state remains safe.
C. Terminate every process that requests a resource.
D. Prevent all resource sharing.

Answer: B

Explanation: Avoidance requires information about resource needs and checks whether the system can still complete all processes in some safe order.

 

Q73. What is a safe state?

A. A state where no process has started
B. A state with at least one safe sequence in which all processes can finish
C. A state where every process is blocked
D. A state where all resources are allocated permanently

Answer: B

Explanation: A safe sequence demonstrates an order in which each process can obtain its remaining needs, complete, and release its resources.

 

Q74. A system has 10 instances of a resource. Currently, 4 are allocated and 6 are available. If a process requests 3 more instances, how many will remain available after granting the request?

A. 1
B. 3
C. 6
D. 7

Answer: A. 3

Explanation: If the request is valid and granted, availability becomes \(6-3=3\), not 1.

 

Q75. Which algorithm is commonly used for deadlock avoidance with multiple instances of resource types?

A. Banker’s algorithm
B. FIFO page replacement
C. Round Robin
D. SCAN

Answer: A. Banker’s algorithm

Explanation: The algorithm tests whether a tentative allocation leaves the system in a safe state.

 

Q76. What does the Banker's algorithm's Need matrix represent?

A. Maximum demand plus allocation
B. Maximum demand minus current allocation
C. Available resources minus maximum demand
D. Current allocation only

Answer: B

Explanation:

\[ Need=Max-Allocation \]

It represents each process's remaining declared resource requirement.

 

Q77. A process has a maximum requirement of 9 units and currently holds 4 units. What is its remaining declared need?

A. 4
B. 5
C. 9
D. 13

Answer: B. 5

Explanation:

\[ Need=9-4=5 \]
 

Q78. Which is a common deadlock recovery technique?

A. Terminate one or more processes
B. Increase all page sizes
C. Convert all files to directories
D. Disable the CPU scheduler permanently

Answer: A

Explanation: Other recovery methods include resource preemption and rollback where supported. Recovery can involve loss of work.

 

Q79. Which deadlock prevention strategy directly attacks the circular-wait condition?

A. Impose a total ordering on resource types and require requests in that order
B. Increase CPU frequency
C. Use larger time quanta
D. Replace FCFS with SJF

Answer: A

Explanation: A strict ordering prevents a circular chain of processes requesting resources in inconsistent orders.

 

Q80. What is the difference between deadlock and starvation?

A. They are identical.
B. Deadlock involves a set of processes unable to progress due to resource dependencies; starvation is indefinite postponement of a process.
C. Starvation only occurs on disks.
D. Deadlock only occurs in batch systems.

Answer: B

Explanation: A starving process may still be able to proceed if scheduling or allocation changes; deadlocked processes cannot progress without an external intervention or change in the resource situation.

 

Section 5: Memory Management and Partitioning

Questions 81–100

Q81. What is internal fragmentation?

A. Unused space inside an allocated memory block
B. Free memory scattered between allocated blocks
C. A process waiting for I/O
D. A disk head moving between tracks

Answer: A

Explanation: Internal fragmentation occurs when the allocated block is larger than the memory actually requested.

 

Q82. What is external fragmentation?

A. Wasted space inside a fixed-size allocation
B. Free memory split into separate holes that may not satisfy a large contiguous request
C. A page table entry
D. An interrupt handler

Answer: B

Explanation: The total free memory may be sufficient, but no single contiguous hole is large enough for the request.

 

Q83. Which memory-management technique can reduce external fragmentation by relocating allocated blocks?

A. Compaction
B. Spooling
C. Round Robin
D. Aging

Answer: A. Compaction

Explanation: Compaction moves allocated blocks together to create a larger contiguous free region, but relocation is costly and requires appropriate support.

 

Q84. In fixed partitioning, what is a common limitation?

A. It can produce internal fragmentation and limit the number of resident processes.
B. It never wastes memory.
C. Every process receives unlimited memory.
D. It automatically eliminates external fragmentation in every memory system.

Answer: A

Explanation: A process typically occupies a fixed partition, and unused space within that partition may be wasted.

 

Q85. Which algorithm allocates the first free hole large enough for a process?

A. Best Fit
B. Worst Fit
C. First Fit
D. LRU

Answer: C. First Fit

Explanation: First Fit scans the free-list and uses the first suitable hole it encounters.

 

Q86. Which algorithm selects the smallest hole that can accommodate the request?

A. First Fit
B. Best Fit
C. Worst Fit
D. FCFS

Answer: B. Best Fit

Explanation: Best Fit attempts to minimize the leftover space for each individual allocation, though it can create many small unusable holes.

 

Q87. Which algorithm chooses the largest available hole?

A. Worst Fit
B. Best Fit
C. SRTF
D. FIFO

Answer: A. Worst Fit

Explanation: Worst Fit allocates from the largest hole, leaving a remainder that may be useful for future requests.

 

Q88. Free holes are 100 KB, 500 KB, 200 KB and 300 KB. A process requests 180 KB. Which hole does Best Fit choose?

A. 100 KB
B. 500 KB
C. 200 KB
D. 300 KB

Answer: C. 200 KB

Explanation: The 100 KB hole is too small. Of the suitable holes, 200 KB is the smallest.

 

Q89. Using the same holes—100 KB, 500 KB, 200 KB and 300 KB—in that order, which hole does First Fit choose for a 180 KB request?

A. 100 KB
B. 500 KB
C. 200 KB
D. 300 KB

Answer: B. 500 KB

Explanation: First Fit scans in order and skips 100 KB because it is too small. The next hole, 500 KB, is suitable.

 

Q90. A system has a logical address space of \(2^{16}\) bytes and a page size of \(2^{10}\) bytes. How many virtual pages are there?

A. 16
B. 32
C. 64
D. 1024

Answer: C. 64

Explanation:

\[ \text{Pages}=\frac{2^{16}}{2^{10}}=2^6=64 \]
 

Q91. What is the main benefit of paging?

A. It requires each process to occupy one contiguous physical region.
B. It allows a process's pages to occupy non-contiguous physical frames.
C. It eliminates all page faults.
D. It eliminates the need for address translation.

Answer: B

Explanation: Paging divides virtual memory into fixed-size pages and physical memory into same-sized frames.

 

Q92. In paging, the page size is 4 KB. What is the size of the page offset in bits?

A. 10
B. 11
C. 12
D. 16

Answer: C. 12 bits

Explanation:

\[ 4\text{ KB}=4096=2^{12}\text{ bytes} \]

Twelve bits are needed to identify a byte within the page.

 

Q93. A process requires 10 KB of memory and uses 4 KB pages. How much memory is allocated to its pages?

A. 10 KB
B. 12 KB
C. 14 KB
D. 16 KB

Answer: B. 12 KB

Explanation: Three pages are needed, giving \(3\times4=12\) KB. The last page has 2 KB of unused space.

 

Q94. A logical address consists of a page number and offset. Which component is used to index the page table?

A. Offset
B. Page number
C. Disk sector number
D. Process burst time

Answer: B. Page number

Explanation: The page number identifies the virtual page; the corresponding page-table entry identifies its physical frame and protection information.

 

Q95. A physical memory system has 32-bit byte addresses and a 4 KB page size. How many bits are used for the frame number in a full 32-bit physical address?

A. 10
B. 12
C. 20
D. 32

Answer: C. 20 bits

Explanation: The offset uses 12 bits, leaving \(32-12=20\) bits for the physical frame number.

 

Q96. What is the main purpose of a page table?

A. Map virtual page numbers to physical frame numbers and store associated status information
B. Store CPU scheduling priorities only
C. Store file names only
D. Control printer queues

Answer: A

Explanation: The memory management unit uses page-table information to translate virtual addresses and enforce access permissions.

 

Q97. What is the purpose of a valid/present bit in a page-table entry?

A. Identify whether a page is currently available in physical memory or whether the entry is valid under the architecture's rules
B. Record a process's CPU burst time
C. Store the file's extension
D. Set the CPU time quantum

Answer: A

Explanation: Exact meanings vary by architecture. A non-present page may require a page fault when accessed.

 

Q98. What is a major drawback of using a single-level page table for a very large sparse virtual address space?

A. It may require substantial page-table memory even when few pages are used.
B. It cannot map virtual addresses.
C. It eliminates fragmentation.
D. It makes all accesses sequential.

Answer: A

Explanation: Multilevel page tables can allocate lower-level tables only for portions of the address space that are actually needed.

 

Q99. What is the primary purpose of an inverted page table?

A. Maintain an entry associated with each physical frame rather than one entry for every virtual page
B. Replace all physical memory with disk storage
C. Schedule CPU bursts
D. Store directories as linked lists

Answer: A

Explanation: Inverted page tables can reduce table size for large virtual address spaces, although lookup and shared-address-space handling can become more complex.

 

Q100. What is the primary purpose of segmentation?

A. Divide a program's logical address space into meaningful variable-sized units
B. Divide every file into equal-sized CPU bursts
C. Schedule processes by arrival time
D. Remove all memory protection

Answer: A

Explanation: Segments may represent code, data, or stack. Segmentation naturally supports logical protection and sharing, but variable-sized allocation can create external fragmentation.

 

Section 6: Paging, TLB and Virtual Memory

Questions 101–125

Q101. What is virtual memory?

A. A technique that allows processes to use an address space larger than the currently allocated physical memory
B. A type of CPU register only
C. A disk scheduling algorithm
D. A replacement for the operating system

Answer: A

Explanation: Virtual memory provides an abstraction of memory and can keep only the needed portions of a process in physical memory.

 

Q102. What is demand paging?

A. Load every possible page at process creation
B. Load a page when it is needed and is not already resident
C. Replace every page after one instruction
D. Disable page tables

Answer: B

Explanation: Demand paging avoids loading unused pages, but page faults may delay execution when needed pages are absent.

 

Q103. What happens during a page fault when the referenced page is valid but not resident?

A. The OS may locate the page, load it into a frame, update mappings and resume the instruction.
B. The process must always be terminated.
C. The CPU is permanently disabled.
D. The page table is deleted.

Answer: A

Explanation: A page fault is an exception, not necessarily an error. An invalid address or protection violation may instead cause the OS to signal an error.

 

Q104. What does the Translation Lookaside Buffer (TLB) store?

A. Recent address-translation entries
B. Entire executable files
C. CPU burst histories only
D. Printer jobs

Answer: A

Explanation: A TLB caches page-table translations so that many memory accesses can avoid a separate page-table lookup.

 

Q105. A memory access takes 100 ns. A TLB lookup takes 10 ns. The TLB hit ratio is 90%. Assume one memory access on a hit and two memory accesses after a miss, with serial TLB lookup and no page faults. What is the effective access time?

A. 100 ns
B. 110 ns
C. 120 ns
D. 210 ns

Answer: C. 120 ns

Explanation:

\[ EAT=0.9(10+100)+0.1(10+200) \]
\[ EAT=99+21=120\text{ ns} \]
 

Q106. What is a TLB miss?

A. A translation is not found in the TLB
B. A process has terminated
C. The disk has no free sectors
D. The CPU cannot execute instructions

Answer: A

Explanation: A TLB miss normally triggers a page-table lookup. It is not automatically a page fault because the page may still be resident in physical memory.

 

Q107. A logical address is 16 bits, and the page size is 1 KB. How many bits represent the page number?

A. 6
B. 10
C. 16
D. 26

Answer: A. 6 bits

Explanation: The offset uses 10 bits because \(1\text{ KB}=2^{10}\) bytes. The page number uses \(16-10=6\) bits.

 

Q108. A system has 8 KB pages and a 24-bit logical address space. How many virtual pages are possible?

A. 256
B. 512
C. 2048
D. 8192

Answer: B. 512

Explanation: Page size is \(2^{13}\) bytes, so the page number has \(24-13=11\) bits. Therefore there are \(2^{11}=2048\) pages.

Correction: The correct answer is C. 2048.

 

Q109. A process accesses virtual address 10,000 in a system with 4 KB pages. What are the virtual page number and offset, using zero-based addressing?

A. Page 1, offset 1808
B. Page 2, offset 1808
C. Page 2, offset 1000
D. Page 3, offset 1808

Answer: A. Page 2?

Explanation: \(10000=2(4096)+1808\). The correct page number is 2, and the offset is 1808 bytes. Therefore option B is correct.

 

Q110. What is the main advantage of a multilevel page table?

A. It can avoid allocating page-table structures for unused portions of a virtual address space.
B. It eliminates all address translation.
C. It prevents all page faults.
D. It ensures that every process uses one physical frame.

Answer: A

Explanation: Multilevel tables trade additional lookup complexity on a TLB miss for more efficient page-table storage in sparse address spaces.

 

Q111. What is a page-table entry's dirty bit used for?

A. Indicate that the page has been modified
B. Record the process's arrival time
C. Identify the next CPU scheduler
D. Store the disk head's direction

Answer: A

Explanation: A dirty page generally needs to be written back to backing storage before its frame can be reused if the modifications must be preserved.

 

Q112. What is the reference/use bit used for in page replacement?

A. Indicate recent access to a page
B. Count file names
C. Store the CPU time quantum
D. Identify a directory's parent

Answer: A

Explanation: Algorithms such as Clock use reference bits to approximate recency without maintaining a complete access history.

 

Q113. What is the primary purpose of a frame table?

A. Track physical memory frames and their allocation status
B. Store the source code of all processes
C. Schedule disk head movement
D. Keep track of file extensions

Answer: A

Explanation: The OS can use frame metadata to identify free frames, owning processes, and other frame-related information.

 

Q114. What is a major disadvantage of increasing page size?

A. It can increase internal fragmentation and may increase unnecessary data transfer.
B. It always increases the number of page-table entries.
C. It removes the offset field.
D. It guarantees fewer total memory accesses in every workload.

Answer: A

Explanation: Larger pages reduce the number of page-table entries for a fixed address space, but they can waste more memory and increase I/O when large pages are not fully used.

 

Q115. What is the main role of the memory management unit (MMU)?

A. Translate addresses and enforce supported memory access protections
B. Decide which file should print first
C. Store all processes permanently
D. Replace the CPU scheduler

Answer: A

Explanation: The MMU works with hardware translation structures and permissions to implement virtual memory and memory protection.

 

Q116. What is thrashing?

A. Excessive paging activity that leaves little time for useful execution
B. A process finishing unusually quickly
C. A CPU instruction executing in one cycle
D. A file being renamed repeatedly

Answer: A

Explanation: Thrashing often occurs when the active working sets of processes do not fit adequately in physical memory.

 

Q117. What is the working-set model intended to estimate?

A. The pages a process has actively used within a recent time window
B. The process's maximum CPU priority
C. The number of files in a directory
D. The distance between disk cylinders

Answer: A

Explanation: Keeping a process's working set resident can reduce page faults, although the appropriate window and implementation depend on the system.

 

Q118. Which is a benefit of copy-on-write?

A. Processes can initially share memory pages until one attempts to modify a shared page.
B. Every process immediately receives a complete physical copy of all memory.
C. It prevents all page faults.
D. It eliminates access permissions.

Answer: A

Explanation: Copy-on-write can make operations such as process creation more memory-efficient by copying only modified pages.

 

Q119. What is the purpose of a page-fault handler?

A. Handle faults by determining whether access is valid and arranging the required memory or error response
B. Calculate disk scheduling priorities only
C. Rename files
D. Select a CPU time quantum

Answer: A

Explanation: The handler validates the access, obtains the page if appropriate, updates state, and either resumes execution or reports an error.

 

Q120. What is the main difference between paging and segmentation?

A. Paging uses fixed-size units; segmentation uses logical variable-sized units.
B. Paging uses variable-sized units; segmentation uses fixed-sized units.
C. Both require physically contiguous allocation for every process.
D. Segmentation does not use addresses.

Answer: A

Explanation: Paging avoids external fragmentation in physical page-frame allocation, whereas variable-sized segments can suffer external fragmentation.

 

Q121. What is segmented paging?

A. A combination in which segments are divided into pages
B. A method that replaces every file with a process
C. A CPU scheduling algorithm
D. A disk head optimization method

Answer: A

Explanation: A logical address can identify a segment, a page within that segment, and an offset within the page.

 

Q122. Why can an inverted page table require a hash lookup?

A. Its entries are organized around physical frames, so a virtual page's matching entry may need to be located by searching or hashing.
B. It stores no address information.
C. It only maps disk sectors.
D. It is a replacement for all CPU registers.

Answer: A

Explanation: Hashing can accelerate the search for the entry associated with a particular process and virtual page.

 

Q123. Which condition is most likely to produce a protection fault rather than an ordinary demand page fault?

A. A process attempts a prohibited write to a read-only page
B. A valid page is absent from physical memory
C. The TLB does not contain a translation
D. The process's time quantum expires

Answer: A

Explanation: An absent but valid page can be loaded, while an unauthorized write violates the memory-protection rules.

 

Q124. What does locality of reference mean?

A. Programs tend to access recently used locations and nearby locations
B. Programs access every address equally often
C. The CPU accesses only disk addresses
D. The OS never reuses memory

Answer: A

Explanation: Temporal locality refers to reusing recently accessed items; spatial locality refers to accessing nearby items. These patterns help caches and virtual memory work efficiently.

 

Q125. What is the purpose of a swap area or backing store in a virtual-memory system?

A. Provide storage for pages or process memory that is not currently resident in RAM
B. Replace the need for a CPU
C. Store only directory names
D. Execute every instruction directly from a disk sector

Answer: A

Explanation: The operating system can move eligible pages between physical memory and backing storage as needed.

 

Section 7: Page Replacement Algorithms

Questions 126–145

For the following questions, unless stated otherwise, use the reference string:

\[ 1,\ 2,\ 3,\ 1,\ 4,\ 2,\ 5 \]

Assume initially empty frames and count a page fault whenever the referenced page is not resident.

Q126. What is the goal of a page-replacement algorithm?

A. Choose a resident page to evict when a page fault requires a frame and no free frame is available
B. Choose the next CPU process
C. Allocate file names
D. Eliminate virtual memory

Answer: A

Explanation: The replacement policy tries to reduce expensive page faults while respecting the system's memory-management rules.

 

Q127. Which algorithm replaces the page that has been in memory for the longest time?

A. LRU
B. FIFO
C. Optimal
D. SRTF

Answer: B. FIFO

Explanation: FIFO evicts the page that entered memory earliest, regardless of how recently it was used.

 

Q128. Which algorithm replaces the page that has not been used for the longest time in the past?

A. FIFO
B. LRU
C. FCFS
D. SCAN

Answer: B. LRU

Explanation: Least Recently Used uses past access history as a predictor of future reuse.

 

Q129. Which algorithm replaces the page whose next use is farthest in the future?

A. FIFO
B. LRU
C. Optimal
D. Clock

Answer: C. Optimal

Explanation: Optimal produces the minimum possible number of page faults for a known reference string, but exact future references are generally unavailable to an online operating system.

 

Q130. What is Belady's anomaly?

A. Increasing the number of frames can increase page faults under FIFO for some reference strings.
B. Increasing the number of frames always increases page faults.
C. LRU always produces more faults than FIFO.
D. Page faults cannot occur in virtual memory.

Answer: A

Explanation: FIFO does not have the stack property, so more frames can paradoxically result in more faults for certain workloads.

 

Q131. Which algorithms have the stack property in their standard forms?

A. FIFO only
B. LRU and Optimal
C. FCFS and Round Robin
D. SCAN and C-SCAN

Answer: B

Explanation: With stack algorithms, the set of pages resident with \(n\) frames is contained in the set resident with \(n+1\) frames at corresponding points in the reference string.

 

Q132. Three frames are empty. Under FIFO, the references are 1, 2, 3, 1. How many page faults occur?

A. 2
B. 3
C. 4
D. 1

Answer: B. 3

Explanation: References 1, 2 and 3 each fault and fill a frame. The second reference to 1 is a hit, so total faults are 3.

 

Q133. Three frames are empty. Under FIFO, the references are 1, 2, 3, 4. How many page faults occur?

A. 3
B. 4
C. 2
D. 1

Answer: B. 4

Explanation: The first three references fill the frames. Reference 4 faults and replaces page 1, the oldest resident page.

 

Q134. Three frames are empty. Under LRU, the references are 1, 2, 3, 1, 4. Which page is replaced when 4 is referenced?

A. 1
B. 2
C. 3
D. 4

Answer: B. 2

Explanation: Before reference 4, page 1 was used most recently, page 3 was used before that, and page 2 was used least recently.

 

Q135. Three frames are empty. Under Optimal replacement, the references are 1, 2, 3, 1, 4, 2, 5. Which page should be replaced when 4 is referenced?

A. 1
B. 2
C. 3
D. 4

Answer: C. 3

Explanation: At that point, pages 1, 2 and 3 are resident. Page 3 is never referenced again, so replacing it is optimal.

 

Q136. What does the Clock page-replacement algorithm use to approximate LRU?

A. A circular arrangement and reference bits
B. CPU priorities only
C. File access permissions
D. Disk cylinder numbers

Answer: A

Explanation: Clock scans frames in circular order, clearing reference bits and skipping recently referenced pages until it finds a candidate.

 

Q137. What is the main advantage of LRU over FIFO?

A. LRU considers recent usage, while FIFO considers arrival order
B. LRU always needs no metadata
C. FIFO always has more page faults
D. LRU uses future knowledge

Answer: A

Explanation: LRU often benefits from temporal locality, although its implementation can require more bookkeeping than FIFO.

 

Q138. Why is Optimal page replacement primarily a theoretical benchmark?

A. It requires knowledge of future memory references
B. It cannot replace pages
C. It uses only CPU scheduling
D. It always causes a page fault

Answer: A

Explanation: Actual systems cannot generally know the exact future reference string, but Optimal helps evaluate practical policies.

 

Q139. What happens when a process references a page already resident in physical memory?

A. A page fault must occur.
B. It is normally a page hit.
C. The process is terminated.
D. The page must be written to disk.

Answer: B

Explanation: If the page is resident and access is permitted, translation can proceed without a demand page fault.

 

Q140. Which policy is most directly based on the age of a page's most recent access?

A. LRU
B. FIFO
C. FCFS
D. Best Fit

Answer: A. LRU

Explanation: LRU evicts the page whose last access occurred farthest in the past.

 

Q141. A process has 4 frames and references the pages 1, 2, 3, 4, 1. Under FIFO, how many page faults occur?

A. 3
B. 4
C. 5
D. 2

Answer: B. 4

Explanation: The first four distinct pages fault and fill all frames. The final reference to page 1 is a hit.

 

Q142. Why can increasing the number of frames reduce page faults under LRU?

A. LRU has the stack property, so adding frames does not cause the resident set to lose a previously resident page at the corresponding point.
B. LRU uses no memory.
C. LRU knows all future references.
D. More frames eliminate every possible fault.

Answer: A

Explanation: For the same reference string, standard LRU cannot exhibit Belady's anomaly.

 

Q143. What is the purpose of a reference bit in the Clock algorithm?

A. Help distinguish pages that have been referenced recently from those that have not
B. Record process priority
C. Count files in a directory
D. Record disk head direction

Answer: A

Explanation: A set reference bit usually earns a page a second chance: the algorithm clears the bit and continues searching.

 

Q144. What is a major disadvantage of FIFO page replacement?

A. It ignores whether a page is frequently used
B. It always requires future knowledge
C. It cannot be implemented with a queue
D. It requires variable-sized pages

Answer: A

Explanation: A heavily used old page can be evicted simply because it entered memory early.

 

Q145. A system uses demand paging. If the working set of a process is much larger than its allocated frames, what is a likely consequence?

A. Thrashing or a high page-fault rate
B. Zero page faults
C. Guaranteed faster execution
D. Automatic elimination of virtual memory

Answer: A

Explanation: If frequently needed pages cannot remain resident, the process repeatedly faults and spends excessive time transferring pages.

 

Section 8: File Management and Directory Structures

Questions 146–160

Q146. Which is a file attribute?

A. File size
B. CPU time quantum
C. Page replacement count only
D. Disk head direction only

Answer: A. File size

Explanation: Common file attributes include name, type, size, location metadata, timestamps, ownership and permissions.

 

Q147. Which operation changes a file's contents?

A. Write
B. Rename
C. Change directory
D. List directory

Answer: A. Write

Explanation: A write operation stores data in a file. A rename operation changes its name without necessarily changing its contents.

 

Q148. Which file access method is best suited to directly accessing a record at a known position in a file?

A. Sequential access only
B. Direct or random access
C. Printing access
D. Spooling access

Answer: B

Explanation: Direct access lets a program seek to a specified offset or block, subject to the file system and storage device.

 

Q149. What is a major limitation of a single-level directory?

A. All files share one directory namespace, creating naming conflicts and organizational limitations.
B. It cannot store any files.
C. It requires every file to be executable.
D. It automatically supports unlimited directory hierarchy.

Answer: A

Explanation: A single directory is simple but becomes difficult to manage as the number of users and files grows.

 

Q150. What is an advantage of a two-level directory?

A. Each user can have a separate directory, reducing conflicts between users' file names.
B. Every file must have the same name.
C. It eliminates the need for file permissions.
D. It makes every file contiguous.

Answer: A

Explanation: Separate user directories improve namespace isolation, although more complex sharing may require additional mechanisms.

 

Q151. Which directory structure naturally represents parent-child relationships across multiple levels?

A. Single-level
B. Tree-structured
C. Flat queue
D. FIFO list

Answer: B. Tree-structured

Explanation: A tree directory supports nested directories and hierarchical paths.

 

Q152. What is a key feature of an acyclic-graph directory structure?

A. Files or directories may be shared through links, but directory relationships must not form cycles.
B. Every file must have exactly one name in the entire system.
C. No directory may contain files.
D. Every file is stored in RAM only.

Answer: A

Explanation: Acyclic sharing allows multiple paths to the same object while avoiding directory cycles that complicate traversal.

 

Q153. What is an absolute path?

A. A path interpreted relative to the current working directory
B. A path beginning from the file system's designated root
C. A file's memory address
D. A directory entry number only

Answer: B

Explanation: Absolute paths specify a location from the root of the relevant namespace, while relative paths depend on a current location.

 

Q154. What is a file descriptor in a typical Unix-like system?

A. A process-local integer handle referring to an open file or another I/O object
B. A disk cylinder
C. A CPU scheduling policy
D. A page replacement bit

Answer: A

Explanation: The descriptor indexes a process's open-file table and is used with system calls such as read() and write().

 

Q155. What is the purpose of file permissions?

A. Control which operations users or processes are allowed to perform
B. Determine CPU burst duration
C. Set the physical page size
D. Determine disk head movement

Answer: A

Explanation: Permissions can control reading, writing, executing, or other operations depending on the file system.

 

Q156. Which file access method reads records in order from the beginning or current position?

A. Sequential access
B. Direct access only
C. Indexed allocation
D. Page replacement

Answer: A

Explanation: Sequential access is well suited to workloads such as log processing and reading a file from start to finish.

 

Q157. What is a directory entry generally used for?

A. Associate a file name with the metadata or identifier needed to locate the file
B. Store the CPU's program counter
C. Calculate process waiting time
D. Schedule disk requests by shortest seek time

Answer: A

Explanation: The exact structure varies by file system; some directory entries contain inode numbers or other object identifiers.

 

Q158. What is a hard link in a Unix-like file system?

A. Another directory entry referring to the same underlying file object, commonly the same inode
B. A copy that must contain different data
C. A shortcut that always crosses file systems
D. A CPU register

Answer: A

Explanation: Hard links typically refer to the same inode and data. Restrictions commonly prevent hard-linking directories and linking across file systems.

 

Q159. What is a symbolic link?

A. A separate file containing a path reference to another object
B. A physical memory frame
C. A page table
D. A disk scheduling queue

Answer: A

Explanation: A symbolic link can refer to a path that crosses file systems, and it can become dangling if its target no longer exists.

 

Q160. What is the main purpose of mounting a file system?

A. Make a file system accessible at a location within the operating system's directory namespace
B. Increase CPU burst time
C. Replace every file with a process
D. Remove all directory entries

Answer: A

Explanation: Mounting connects a file system to a mount point so that its files can be accessed through the resulting namespace.

 

Section 9: File Systems and Allocation Methods

Questions 161–180

Q161. What is the Master Boot Record (MBR) traditionally associated with?

A. A disk's initial sector containing boot code and partition-table information in the traditional MBR scheme
B. A process's PCB
C. A page replacement algorithm
D. A semaphore value

Answer: A

Explanation: Traditional MBR partitioning stores boot code and partition entries in the first sector. Modern systems may instead use GPT and UEFI.

 

Q162. Which is an on-disk file-system data structure?

A. Inode or equivalent file metadata structure
B. A CPU register's live contents
C. The current instruction pipeline only
D. A temporary local variable only

Answer: A

Explanation: On-disk structures persist file-system information, including file metadata, allocation information and directory contents.

 

Q163. Which is an example of an in-memory file-system data structure?

A. An in-memory cache of directory or inode metadata
B. A physical disk platter
C. A printed page
D. A file's source-code comment

Answer: A

Explanation: Operating systems cache file-system metadata in RAM to reduce storage accesses and speed up file operations.

 

Q164. What is contiguous file allocation?

A. Store a file's blocks in consecutive disk blocks
B. Store each block at an unrelated location with no mapping
C. Store the file only in CPU registers
D. Store every file in the same block

Answer: A

Explanation: Contiguous allocation supports efficient sequential and direct access but can suffer external fragmentation and make file growth difficult.

 

Q165. A file occupies 10 consecutive disk blocks starting at block 40. Which blocks belong to the file?

A. 40 through 49
B. 40 through 50
C. 41 through 50
D. 30 through 39

Answer: A

Explanation: Ten blocks starting at 40 are \(40,41,\ldots,49\).

 

Q166. What is a major advantage of linked allocation?

A. Files can grow without requiring consecutive free blocks.
B. Every file can be accessed instantly by block number without traversal.
C. It always reduces all disk seeks to zero.
D. It requires every file to have a fixed size.

Answer: A

Explanation: Each block points to the next block, allowing flexible growth, but sequential traversal can be costly for direct access.

 

Q167. What is the purpose of a File Allocation Table (FAT)?

A. Track file block chains through a table of allocation entries
B. Store CPU scheduling priorities
C. Record only printer jobs
D. Replace the page table

Answer: A

Explanation: FAT-based systems use table entries to identify the next cluster of a file or mark the end of a chain.

 

Q168. What is indexed allocation?

A. A file has an index structure that lists the locations of its data blocks
B. All file blocks must be consecutive
C. Every block points only to the next block with no index
D. File blocks are allocated according to CPU priority

Answer: A

Explanation: Indexed allocation supports direct block lookup, though the index consumes storage and may require multiple levels for large files.

 

Q169. What is an inode in a traditional Unix-like file system?

A. A metadata structure that describes a file and identifies its data blocks, typically excluding its name
B. A disk head
C. A CPU scheduler
D. A virtual page offset

Answer: A

Explanation: Directory entries commonly map names to inode numbers. The inode stores metadata such as ownership, permissions, size and block references.

 

Q170. What is the purpose of free-space management?

A. Track storage blocks or clusters available for future allocation
B. Determine which process receives CPU time
C. Convert all files into directories
D. Schedule the CPU cache

Answer: A

Explanation: Free-space structures can use bitmaps, free lists, grouping, or other methods to find available storage.

 

Q171. A bitmap uses one bit per disk block. How many bytes are needed to represent 8,192 blocks, ignoring metadata and alignment?

A. 128 bytes
B. 512 bytes
C. 1,024 bytes
D. 8,192 bytes

Answer: A. 1,024 bytes?

Explanation: There are 8,192 bits, so the bitmap requires \(8192/8=1024\) bytes. The correct option is C. 1,024 bytes.

 

Q172. Which allocation method typically provides efficient sequential access but can suffer from external fragmentation?

A. Contiguous allocation
B. Linked allocation
C. Indexed allocation only
D. File descriptor allocation

Answer: A

Explanation: Contiguous allocation places a file in adjacent blocks, making sequential reading efficient but complicating allocation and growth.

 

Q173. What is a major disadvantage of linked allocation for direct access?

A. Reaching a later block may require traversing earlier pointers.
B. Files can never grow.
C. It requires all blocks to be adjacent.
D. It cannot support sequential access.

Answer: A

Explanation: Linked allocation is flexible for growth but generally inefficient when an application needs to jump directly to an arbitrary block.

 

Q174. What is one advantage of indexed allocation over basic linked allocation?

A. The index can provide direct access to the location of a particular file block.
B. It never needs metadata.
C. It guarantees zero disk seeks.
D. It always uses less space than every other method.

Answer: A

Explanation: The index maps logical block numbers to physical blocks, although accessing the index may itself require storage I/O.

 

Q175. What is the main purpose of journaling in a file system?

A. Help recover file-system consistency after a crash by recording selected changes
B. Guarantee that hardware can never fail
C. Eliminate all write operations
D. Replace all directory structures

Answer: A

Explanation: Journaling records intended or completed metadata changes, depending on the mode. It improves crash recovery but does not guarantee that all user data is preserved.

 

Q176. What is a superblock or equivalent volume metadata structure used for?

A. Store important information about the file system, such as its layout and status
B. Store a process's remaining CPU burst
C. Store the CPU's instruction register
D. Schedule memory pages

Answer: A

Explanation: File systems use superblocks or equivalent metadata to identify and manage the structure of the volume.

 

Q177. Why can a large file exceed the capacity of a single indirect block pointer array?

A. The number of data-block pointers in the array is finite.
B. Disk blocks cannot contain addresses.
C. The CPU has no registers.
D. Directories cannot contain large files.

Answer: A

Explanation: Inode-based systems may use single, double and triple indirection or extent structures to address larger files.

 

Q178. What is the role of a directory implementation's hash table?

A. Speed up file-name lookup by mapping names to candidate entries
B. Determine the CPU time quantum
C. Translate virtual addresses
D. Prevent every storage failure

Answer: A

Explanation: Hashing can accelerate name searches, although collisions and updates still require appropriate handling.

 

Q179. What is a file extent?

A. A range of consecutive storage blocks allocated to a file
B. A CPU burst
C. A page-fault handler
D. A directory's access permission

Answer: A

Explanation: Extent-based allocation describes a file using ranges of blocks and can reduce metadata overhead for large sequential files.

 

Q180. Which statement about linked index allocation is most accurate?

A. Index information can be spread across multiple linked index blocks to support larger files.
B. Every file must fit into one disk block.
C. It eliminates all storage overhead.
D. It is identical to CPU Round Robin scheduling.

Answer: A

Explanation: Chained index blocks extend the capacity of the indexing structure, but additional traversal and metadata accesses may be required.

 

Section 10: Disk Scheduling Algorithms

Questions 181–200

For the numerical questions, assume disk cylinders are numbered from 0 to 199 unless otherwise specified. Seek distance is measured in cylinders.

Q181. What is the primary goal of disk scheduling?

A. Reduce disk-head movement and improve storage I/O performance
B. Minimize CPU burst time
C. Prevent every page fault
D. Allocate process priorities

Answer: A

Explanation: Disk scheduling chooses the order in which pending requests are served to balance seek performance, throughput and fairness.

 

Q182. Which disk scheduling algorithm serves requests in the order they arrive?

A. SSTF
B. FCFS
C. SCAN
D. C-LOOK

Answer: B. FCFS

Explanation: FCFS is straightforward and fair by arrival order, but it can produce substantial head movement.

 

Q183. Which algorithm selects the pending request closest to the current disk-head position?

A. FCFS
B. SSTF
C. Round Robin
D. FIFO page replacement

Answer: B. SSTF

Explanation: Shortest Seek Time First chooses the nearest request, often reducing immediate movement but potentially starving distant requests.

 

Q184. What is the elevator algorithm in disk scheduling?

A. SCAN
B. FCFS
C. LRU
D. Best Fit

Answer: A. SCAN

Explanation: SCAN moves the head in one direction while servicing requests and then reverses direction, similar to an elevator.

 

Q185. What is the main difference between SCAN and C-SCAN?

A. SCAN reverses direction to service requests; C-SCAN services requests in one direction and returns to the beginning without servicing requests on the return trip.
B. SCAN never moves the head.
C. C-SCAN always uses FCFS.
D. They are page replacement algorithms.

Answer: A

Explanation: C-SCAN can provide more uniform waiting times by treating requests as if they are served during one-directional sweeps.

 

Q186. What is the difference between LOOK and SCAN?

A. LOOK reverses at the last pending request in the current direction instead of necessarily going to the disk's physical end.
B. LOOK always goes to cylinder 0 and 199.
C. SCAN uses a page table.
D. LOOK cannot service requests.

Answer: A

Explanation: LOOK avoids unnecessary travel to the physical end of the disk when there are no requests there.

 

Q187. What is the difference between C-LOOK and C-SCAN?

A. C-LOOK wraps between the extreme pending requests rather than necessarily visiting the physical disk boundaries.
B. C-LOOK always services requests in both directions.
C. C-SCAN never services requests.
D. They are identical to FIFO page replacement.

Answer: A

Explanation: C-LOOK is the circular counterpart of LOOK and can avoid unnecessary movement to the physical extremes.

 

Q188. The head is at cylinder 50. Requests are at 40, 55, 20 and 60. Under SSTF, which request is served first?

A. 40
B. 55
C. 20
D. 60

Answer: B. 55

Explanation: Distances from 50 are 10, 5, 30 and 10 cylinders, respectively. Cylinder 55 is nearest.

 

Q189. The head starts at 50. Requests arrive in the order 82, 170, 43, 140 and 24. What is the total head movement under FCFS?

A. 300 cylinders
B. 331 cylinders
C. 400 cylinders
D. 200 cylinders

Answer: B. 331 cylinders

Explanation:

\[ |50-82|+|82-170|+|170-43|+|43-140|+|140-24| \]
\[ =32+88+127+97+116=460 \]

Correction: The correct total is 460 cylinders, not 331.

 

Q190. The disk head is at 50 and the pending requests are 40, 60 and 45. Under SSTF, what is a possible service order?

A. 40, 45, 60
B. 45, 40, 60
C. 60, 40, 45
D. 40, 60, 45

Answer: B. 45, 40, 60

Explanation: The closest request to 50 is 45. From 45, cylinder 40 is 5 away and 60 is 15 away, so 40 is served next.

 

Q191. What is a major disadvantage of SSTF?

A. It may starve requests far from the current head position.
B. It always produces the maximum possible seek distance.
C. It cannot select a request.
D. It requires all requests to be sequential.

Answer: A

Explanation: Nearby requests can repeatedly take precedence over a distant request, causing long delays.

 

Q192. The head is at cylinder 50, moving toward higher-numbered cylinders. Requests are 20, 40, 60 and 80. Under LOOK, which order is followed?

A. 40, 20, 60, 80
B. 60, 80, 40, 20
C. 80, 60, 40, 20
D. 20, 40, 60, 80

Answer: B. 60, 80, 40, 20

Explanation: LOOK first services requests in the current direction, then reverses at the highest pending request, cylinder 80.

 

Q193. The head is at cylinder 50 and moves toward higher-numbered cylinders. Requests are 20, 40, 60 and 80. For SCAN, what extra movement may be needed compared with LOOK?

A. Movement to the physical end of the disk before reversing
B. No movement at all
C. A CPU context switch
D. A page-table lookup

Answer: A

Explanation: SCAN typically continues to the disk boundary before reversing, even when no request exists at that boundary. Exact movement depends on the convention used in the problem.

 

Q194. Why can C-SCAN provide more uniform waiting times than SCAN?

A. Requests are serviced during a sweep in one direction, creating more consistent treatment across the cylinder range.
B. It never moves the head.
C. It always services the closest request in either direction.
D. It eliminates all disk latency.

Answer: A

Explanation: The circular sweep reduces directional bias, although actual performance depends on the workload and device.

 

Q195. Under FCFS, the head starts at cylinder 100 and services requests 90, 110 and 150 in that order. What is the total head movement?

A. 60 cylinders
B. 80 cylinders
C. 100 cylinders
D. 120 cylinders

Answer: B. 80 cylinders

Explanation:

\[ |100-90|+|90-110|+|110-150| =10+20+40=70 \]

Correction: The correct total is 70 cylinders, not 80.

 

Q196. The head is at cylinder 50. Requests are 10, 30, 55 and 90. Under SSTF, which request is served first?

A. 10
B. 30
C. 55
D. 90

Answer: C. 55

Explanation: Cylinder 55 is only 5 cylinders away. The other distances are 40, 20 and 40 cylinders.

 

Q197. Which statement about disk seek time is correct?

A. It is the time required to move the disk head to the desired track or cylinder.
B. It is the time required to execute a CPU instruction.
C. It is always equal to page size.
D. It is the same as process turnaround time.

Answer: A

Explanation: Seek time measures head movement. Rotational latency and data-transfer time are separate contributors to total disk access time.

 

Q198. Which algorithm is generally more resistant to starvation than SSTF?

A. FCFS
B. SSTF
C. Shortest remaining time first
D. Best Fit

Answer: A. FCFS

Explanation: FCFS preserves arrival order, so a request is not repeatedly bypassed by closer requests. It may, however, have poor average seek performance.

 

Q199. A disk head moves from cylinder 25 to cylinder 75. What is the seek distance?

A. 25 cylinders
B. 50 cylinders
C. 75 cylinders
D. 100 cylinders

Answer: B. 50 cylinders

Explanation:

\[ \text{Seek distance}=|75-25|=50 \]
 

Q200. Which statement best summarizes the trade-off between FCFS and SSTF disk scheduling?

A. FCFS follows arrival order, while SSTF often reduces immediate seek distance but may cause starvation.
B. FCFS always minimizes seek distance.
C. SSTF always guarantees equal waiting times.
D. Both are CPU scheduling algorithms.

Answer: A

Explanation: FCFS is simple and preserves request order. SSTF often improves average seek performance, but requests far from the current head position can wait for a long time.

High-priority formulas to revise

CPU scheduling

\[ TAT=CT-AT \]

\[ WT=TAT-BT \]

\[ RT=\text{First CPU Start}-AT \]

\[ HRRN=\frac{WT+BT}{BT} \]

Paging

\[ \text{Pages}=\frac{\text{Logical address space}}{\text{Page size}} \]

\[ \text{Offset bits}=\log_2(\text{Page size in bytes}) \]

\[ \text{Page number}=\left\lfloor\frac{\text{Logical address}}{\text{Page size}}\right\rfloor \]

\[ \text{Offset}=\text{Logical address}\bmod\text{Page size} \]

Memory and deadlocks

\[ Need=Max-Allocation \]

\[ \text{Internal fragmentation} =\text{Allocated size}-\text{Requested size} \]

Disk scheduling

\[ \text{Total head movement} =\sum_{i=1}^{n}|H_i-H_{i-1}| \]