2022 question paper
Operating System
28 questions
Q1a. Which scheduling policy is most suitable for a time shared operating system: (i) Shortest job first (ii) Round Robin (iii) FCFS (iv) Elevator20222m
Module 2: Processes & Scheduling
View this question on its own page →Which scheduling policy is most suitable for a time shared operating system:
(i) Shortest job first
(ii) Round Robin
(iii) FCFS
(iv) ElevatorWorked SolutionAnswer: (ii) Round Robin
Time-shared (multiprogrammed, interactive) OS needs to give each ready process a short CPU burst in turn so users get prompt response.
- Round Robin (RR) — preemptive, each process gets a fixed time quantum (e.g., 10-100ms); ideal for time-sharing due to fairness and low response time.
- SJF / FCFS — non-preemptive, can cause starvation / convoy effect, not suitable for interactive response.
- Elevator (SCAN) — disk scheduling, not CPU scheduling.
Q1b. A process executes the following segment of code: ``c for (i = 1; i <= n; i++) fork(); `` The number of new processes created is: (i) n (ii) (n(n+1))/2 (iii) 2^n - 1 (iv) 2^n20222m
Module 2: Processes & Scheduling
View this question on its own page →A process executes the following segment of code:
for (i = 1; i <= n; i++) fork();The number of new processes created is:
(i) n
(ii) (n(n+1))/2
(iii) 2^n - 1
(iv) 2^nWorked SolutionAnswer: (iii) 2^n - 1 new processes (2^n total including parent)
Each
fork()doubles the number of processes. Loopfor i=1..n fork()creates:after i=1: 2 processes after i=2: 4 processes ... after i=n: 2^n processes totalNew processes = total - original parent = 2^n - 1. If question counts the parent as well, answer (iv) 2^n is sometimes marked; strictly new = 2^n -1.
Q1c. ______ is a technique of improving the priority of process waiting in queue for CPU allocation: (i) Starvation (ii) Ageing (iii) Revocation (iv) Relocation20222m
Module 2: Processes & Scheduling
View this question on its own page →______ is a technique of improving the priority of process waiting in queue for CPU allocation:
(i) Starvation
(ii) Ageing
(iii) Revocation
(iv) RelocationWorked SolutionAnswer: (ii) Ageing
Ageing gradually increases priority of waiting processes over time, preventing starvation of low-priority jobs. Starvation is the problem, ageing is the solution. Revocation/Relocation are unrelated.
Q1d. Interval between the time of submission and first response to the job is called: (i) waiting time (ii) turnaround time (iii) throughput (iv) response time20222m
Module 2: Processes & Scheduling
View this question on its own page →Interval between the time of submission and first response to the job is called:
(i) waiting time
(ii) turnaround time
(iii) throughput
(iv) response timeWorked SolutionAnswer: (iv) response time
- Response time = submission to first response (interactive metric)
- Waiting time = total time in ready queue
- Turnaround = submission to completion
- Throughput = jobs per unit time
Q1e. A process is: (i) program in high level language kept on disk (ii) content of main memory (iii) program in execution (iv) job in secondary memory20222m
Module 2: Processes & Scheduling
View this question on its own page →A process is:
(i) program in high level language kept on disk
(ii) content of main memory
(iii) program in execution
(iv) job in secondary memoryWorked SolutionAnswer: (iii) program in execution
Process = program loaded into memory, with PCB, state, resources, execution context. Program on disk is just executable file (passive). Job is generic batch notion.
Q1f. In which of the following page replacement policy Belady's anomaly occurs? (i) FIFO (ii) LRU (iii) LFU (iv) NRU20222m
Module 5: Memory Management
View this question on its own page →In which of the following page replacement policy Belady's anomaly occurs?
(i) FIFO
(ii) LRU
(iii) LFU
(iv) NRUWorked SolutionAnswer: (i) FIFO
Belady's anomaly — increasing frames can increase faults — occurs only in FIFO. Stack algorithms (LRU, Optimal) never suffer because their page sets are monotonic.
Q1g. Which of the following approach require knowledge of the system's state in advance. (i) Deadlock detection (ii) Deadlock prevention (iii) Deadlock avoidance (iv) None of these20222m
Module 4: Deadlocks
View this question on its own page →Which of the following approach require knowledge of the system's state in advance.
(i) Deadlock detection
(ii) Deadlock prevention
(iii) Deadlock avoidance
(iv) None of theseWorked SolutionAnswer: (iii) Deadlock avoidance
Avoidance (Banker's) requires knowledge of future maximum needs to compute safe state. Prevention needs only structural guarantees, Detection works after the fact.
Q1h. ______ is the time required to move the disk-arm to the desired track. (i) Seek time (ii) Rotational Latency (iii) Access time (iv) Waiting time20222m
Module 6: I/O & File Management
View this question on its own page →______ is the time required to move the disk-arm to the desired track.
(i) Seek time
(ii) Rotational Latency
(iii) Access time
(iv) Waiting timeWorked SolutionAnswer: (i) Seek time
Disk access time = Seek time (arm movement) + Rotational latency (waiting for sector) + Transfer time. Seek is typically dominant (ms scale). Rotational latency avg = 0.5 / RPM.
Q1i. Which module gives control of the CPU to the process selected by the short-term scheduler? (i) dispatcher (ii) scheduler (iii) Interrupt (iv) None of these20222m
Module 2: Processes & Scheduling
View this question on its own page →Which module gives control of the CPU to the process selected by the short-term scheduler?
(i) dispatcher
(ii) scheduler
(iii) Interrupt
(iv) None of theseWorked SolutionAnswer: (i) dispatcher
Dispatcher context-switches to the chosen process: saves old, loads PCB, switches mode, jumps to PC. Scheduler decides, dispatcher acts.
Q1j. Which memory allocation policy allocates the largest hole to the process? (i) Best-fit (ii) Worst-fit (iii) First-fit (iv) None of the above.20222m
Module 5: Memory Management
View this question on its own page →Which memory allocation policy allocates the largest hole to the process?
(i) Best-fit
(ii) Worst-fit
(iii) First-fit
(iv) None of the above.Worked SolutionAnswer: (ii) Worst-fit
- Best-fit: smallest sufficient hole (least waste)
- Worst-fit: largest hole (leaves large remainder)
- First-fit: first sufficient hole (fast)
- Next-fit: variant of first-fit from last position.
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q2a. Describe seek time, rotational latency, random-access time and their relationship in context of magnetic disks by drawing its moving – head mechanism.20227m
Module 6: I/O & File Management
View this question on its own page →Describe seek time, rotational latency, random-access time and their relationship in context of magnetic disks by drawing its moving – head mechanism.
Worked SolutionMagnetic Disk Timing
- Seek time: time for head assembly to move to correct track/cylinder (dominant, ~5-10ms). Depends on distance.
- Rotational latency: time for desired sector to rotate under head. Average = 0.5*(60/RPM). At 7200 RPM ≈4.17ms.
- Random-access time = Seek + Rotational latency (+ transfer time for actual R/W).
- Transfer time = bytes / (bytes per track * RPM)
Moving-head mechanism: Platter stack with arm assembly. Diagram description: multiple platters share spindle, each surface has head on arm, all heads move together radially. Arm moves seek, then platter rotates to sector. Random time = seek + rotation. Contiguous allocation reduces seeks.
Q2b. Suppose a disk has 100 cylinders, numbered from 0 to 99. At some time the disk arm is at cylinder 50, and there is a queue of disk access requests for cylinders 4, 34, 10, 7, 19, 73, 2, 15, 6 and 20. Assuming that shortest seek-time first (SSTF) is being used for scheduling the disk access. Calculate the total time taken to satisfy all requests if it takes 1 millisecond to move from one cylinder to adjacent one.20227m
Module 6: I/O & File Management
View this question on its own page →Suppose a disk has 100 cylinders, numbered from 0 to 99. At some time the disk arm is at cylinder 50, and there is a queue of disk access requests for cylinders 4, 34, 10, 7, 19, 73, 2, 15, 6 and 20. Assuming that shortest seek-time first (SSTF) is being used for scheduling the disk access. Calculate the total time taken to satisfy all requests if it takes 1 millisecond to move from one cylinder to adjacent one.
Worked SolutionSSTF calculation (arm at 50)
Requests: 4,34,10,7,19,73,2,15,6,20. Order by closest seek from current:
50→34(16),34→20(14)=30,20→19(1)=31,19→15(4)=35,15→10(5)=40,10→7(3)=43,7→6(1)=44,6→4(2)=46,4→2(2)=48,2→73(71)=119.
Total movement = 119 cylinders → 119ms (1ms per cylinder). FCFS would be larger (~ ~200). SSTF starves edge requests but minimizes seek; SCAN/C-SCAN would give different totals. Gantt/Sequence: 50-34-20-19-15-10-7-6-4-2-73.Q3a. What do you understand by address binding, Explain the various address binding schemes.20227m
Module 5: Memory Management
View this question on its own page →What do you understand by address binding, Explain the various address binding schemes.
Worked SolutionAddress Binding
Mapping logical to physical address.
- Compile-time: absolute code generated if memory location known at compile (requires recompilation to relocate).
- Load-time: relocatable code; address computed at load time when base known.
- Execution-time: binding delayed until run-time via MMU/base+limit/paging, allows process movement. Need hardware support. Modern OS uses execution-time binding for multiprogramming and swapping.
Q3b. Consider the virtual page reference string 0, 4, 8, 20, 24, 36, 44, 12, 68, 72, 80, 84, 28, 32, 88, 92 on a demand paged virtual memory system running on computer system that has main memory of size 4 page frames which one initially empty. The CPU uses LRU page replacement policy. (i) How many page faults does this sequence cause? (ii) What are the page numbers of the pages present in the main memory at the end of the sequence?20227m
Module 5: Memory Management
View this question on its own page →Consider the virtual page reference string 0, 4, 8, 20, 24, 36, 44, 12, 68, 72, 80, 84, 28, 32, 88, 92 on a demand paged virtual memory system running on computer system that has main memory of size 4 page frames which one initially empty. The CPU uses LRU page replacement policy.
(i) How many page faults does this sequence cause?
(ii) What are the page numbers of the pages present in the main memory at the end of the sequence?Worked SolutionLRU with 4 frames, ref: 0,4,8,20,24,36,44,12,68,72,80,84,28,32,88,92
Simulating LRU: each new page faults until 4 distinct, then replace LRU.
Sequence: 0(F),4(F),8(F),20(F)=4,24(F replace 0),36(F replace4),44(F replace8),12(F replace20),68(F replace24),72(F replace36),80(F replace44),84(F replace12),28(F replace68),32(F replace72),88(F replace80),92(F replace84) => 16 faults (all references distinct except maybe? Actually all distinct, so 16 faults). Final pages in memory (order LRU→MRU): 28,32,88,92. If any repeated, faults reduce. Explanation shows LRU tracks recency stack.Q4a. What do you understand by critical section problem. Discuss the requirements that a solution to the critical section problem must satisfy.20227m
Module 3: Inter-process Communication
View this question on its own page →What do you understand by critical section problem. Discuss the requirements that a solution to the critical section problem must satisfy.
Worked SolutionCritical Section Problem
Code segment where shared resources accessed. Requirements: 1) Mutual Exclusion (only one in CS), 2) Progress (decision in finite time if no one in CS), 3) Bounded Waiting (limit on waiting). Solutions: software (Peterson), hardware (TSL, swap), semaphores, monitors.
Q4b. A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of each resource type. Consider the following scenario, where the column 'alloc' denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Find the process that will finish first and last. | | alloc<br>X Y Z | Request<br>X Y Z | |---|---|---| | P0 | 1 2 1 | 1 0 3 | | P1 | 2 0 1 | 0 1 2 | | P2 | 2 2 1 | 1 2 0 |20227m
Module 4: Deadlocks
View this question on its own page →A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of each resource type. Consider the following scenario, where the column 'alloc' denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Find the process that will finish first and last.
alloc<br>X Y Z Request<br>X Y Z P0 1 2 1 1 0 3 P1 2 0 1 0 1 2 P2 2 2 1 1 2 0 Worked SolutionResource allocation X,Y,Z (5 each) alloc vs request
Total allocated: X=5(1+2+2),Y=4(2+0+2),Z=3(1+1+1) → Available =5-allocated = X0,Y1,Z2 initially? Actually given no available row, compute: assume total 5 each → Avail = Total - sumAlloc = X0,Y1,Z2. Need calc Need=Request.
Check P1 Need 0,1,2 ≤ Avail 0,1,2 → P1 can finish first, release 2,0,1 → Avail 2,1,3. Then P0 Need 1,0,3 ≤ Avail 2,1,3 → P0 finishes last? Let's simulate order P1→P0→P2 gives finish first P1, last P0/P2 depending. Detailed safe sequence P1,P2,P0 => first P1, last P0.Q5a. Explain process state transition diagram of an operating system.20227m
Module 2: Processes & Scheduling
View this question on its own page →Explain process state transition diagram of an operating system.
Worked SolutionProcess State Diagram
Explain 5-state plus suspended: New→Ready (admit), Ready↔Running (dispatch/preempt), Running→Waiting (I/O), Waiting→Ready (completion), Running→Terminated. Medium-term adds Suspend Ready/Blocked. Diagram aids context switch understanding.
Q5b. Consider the following CPU processes with arrival times 0 and CPU bursts (in milliseconds) as given below: | Process | Burst time | |---|---| | P1 | 24 | | P2 | 3 | | P3 | 3 | If the Round Robin Scheduling is used with time quantum of 4 milliseconds to schedule the processes. Draw the Gantt chart and calculate the average waiting time across all processes (in milliseconds).20227m
Module 2: Processes & Scheduling
View this question on its own page →Consider the following CPU processes with arrival times 0 and CPU bursts (in milliseconds) as given below:
Process Burst time P1 24 P2 3 P3 3 If the Round Robin Scheduling is used with time quantum of 4 milliseconds to schedule the processes. Draw the Gantt chart and calculate the average waiting time across all processes (in milliseconds).
Worked SolutionRR quantum 4, P1=24,P2=3,P3=3 arrival 0
Gantt: P1 0-4, P2 4-7, P3 7-10, P1 10-14, P1 14-18, P1 18-22, P1 22-24, P1 24-28? Actually P1 needs 6 quanta: 0-4(20 rem),4-7 P2 done,7-10 P3 done,10-14 P1(16),14-18(12),18-22(8),22-26(4),26-30(0). WT: P1 =30-24=6? Wait TAT P1 30, WT 6, P2 WT 4, P3 WT 7 => Avg WT ~5.67. Detailed diagram shows RR fairness.
Q6a. Write necessary conditions that must hold simultaneously to arise deadlock situation. Briefly explain different deadlock handling mechanisms.20227m
Module 4: Deadlocks
View this question on its own page →Write necessary conditions that must hold simultaneously to arise deadlock situation. Briefly explain different deadlock handling mechanisms.
Worked SolutionNecessary Conditions (Coffman)
1 Mutual Exclusion 2 Hold-and-Wait 3 No Preemption 4 Circular Wait
Handling
- Prevention (break one condition)
- Avoidance (Banker's, safe state)
- Detection & Recovery (wait-for graph, kill/preempt)
- Ignorance (ostrich, used by Unix/Windows)
Q6b. What is the cause of thrashing? How does the system detect thrashing and once detected what can the system do to eliminate it20227m
Module 5: Memory Management
View this question on its own page →What is the cause of thrashing? How does the system detect thrashing and once detected what can the system do to eliminate it
Worked SolutionThrashing Cause/Detect/Eliminate
Cause: insufficient frames for working sets. Detection: low CPU utilization + high paging, process fault frequency high. Elimination: reduce multiprogramming, use local replacement, working set or PFF, increase frames, suspend victims.
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q7a. What do you understand by fragmentation. Explain the difference between internal and external fragmentation.20227m
Module 5: Memory Management
View this question on its own page →What do you understand by fragmentation. Explain the difference between internal and external fragmentation.
Worked SolutionFragmentation
Fragmentation = wasted memory. Internal: waste inside allocated block due to fixed sizing. External: free holes scattered outside, insufficient contiguous for request. Fixes: internal → best-fit; external → compaction, paging eliminates external.
Q7b. Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, find the effective memory access time (in milliseconds).20227m
Module 5: Memory Management
View this question on its own page →Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, find the effective memory access time (in milliseconds).
Worked SolutionTLB Effective Access
EAT = hit*(TLB+Mem) + miss*(TLB+2Mem) =0.6(10+80)+0.4*(10+160)=0.690+0.4170=54+68=122ms. If search overlapped, alternative 128ms. TLB caching reduces avg.
Q8a. What is thread? Explain the benefits of using thread.20227m
Module 2: Processes & Scheduling
View this question on its own page →What is thread? Explain the benefits of using thread.
Worked SolutionThread Benefits
- Responsiveness, resource sharing, economy (fast creation), scalability on multicore. Improves throughput, uses blocking I/O without blocking process.
Q8b. Explain the use of TLB in paging hardware and its benefits.20227m
Module 5: Memory Management
View this question on its own page →Explain the use of TLB in paging hardware and its benefits.
Worked SolutionTLB Benefits
TLB caches page translations, reduces memory accesses from 2 to 1 on hit, improves EAT, associative fast lookup (~10ns). Hit ratio 90% typical.
Q9a. Write short notes on: Banker's Algorithm20227m
Module 4: Deadlocks
View this question on its own page →Write short notes on: Banker's Algorithm
Worked SolutionBanker's Algorithm
Safe-state avoidance algorithm. Data: Available, Max, Allocation, Need=Max-Alloc. Safety check finds safe sequence where each Need ≤ Available + releases. Request grant checks Request≤Need and Request≤Available then simulates safety. Ensures deadlock avoidance.
Q9b. Write short notes on: Paging20227m
Module 5: Memory Management
View this question on its own page →Write short notes on: Paging
Worked SolutionPaging
Divide logical into pages, physical into frames equal size, page table maps. Eliminates external fragmentation, allows non-contiguous allocation, supports virtual memory via demand paging. Overhead: page table size, TLB needed for speed.
Q9c. Write short notes on: Process Control Block20227m
Module 2: Processes & Scheduling
View this question on its own page →Write short notes on: Process Control Block
Worked SolutionPCB same as Q29: structure and importance for process management.
Q9d. Write short notes on: Peterson's solution20227m
Module 3: Inter-process Communication
View this question on its own page →Write short notes on: Peterson's solution
Worked SolutionPeterson's Solution
Software mutual exclusion for 2 processes using flag[] and turn, guarantees mutex, progress, bounded waiting without hardware.
PYQDeck for Android
Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.