2019 question paper
Operating System
13 questions
Q1a. What is operating system? (i) Collection of programs that manages hardware resources (ii) System service provider to the application programs20192m
Module 1: Introduction to Operating Systems
View this question on its own page →What is operating system?
(i) Collection of programs that manages hardware resources
(ii) System service provider to the application programsWorked SolutionAnswer: Both (i) and (ii) are correct — complete definition is (i) + (ii)
- If strictly single-choice, the most accepted textbook answer is (i) Collection of programs that manages hardware resources.
- Standard definition: OS is system software that acts as intermediary between hardware and applications — it manages hardware resources and provides services to application programs. The question truncates option (ii), but both views are part of the full definition. In many PYQs this is marked as (i). If exam allows multiple correct, choose (i) and (ii).**
Q1g. The processes that are residing in main memory and are ready and waiting to execute are kept on a list called (i) job queue (ii) ready queue (iii) execution queue (iv) process queue20192m
Module 2: Processes & Scheduling
View this question on its own page →The processes that are residing in main memory and are ready and waiting to execute are kept on a list called
(i) job queue
(ii) ready queue
(iii) execution queue
(iv) process queueWorked SolutionAnswer: (ii) ready queue
Ready queue holds processes in memory ready to execute, waiting for CPU. Job queue holds jobs on disk, waiting to enter memory.
Q1h. Which of the following conditions is required for deadlock to be possible? (i) Mutual exclusion (ii) A process may hold allocated resources while awaiting assignment of other resources (iii) No resource can be forcibly removed from a process holding it (iv) All of the above20192m
Module 4: Deadlocks
View this question on its own page →Which of the following conditions is required for deadlock to be possible?
(i) Mutual exclusion
(ii) A process may hold allocated resources while awaiting assignment of other resources
(iii) No resource can be forcibly removed from a process holding it
(iv) All of the aboveWorked SolutionAnswer: (iv) All of the above
Coffman conditions for deadlock: Mutual exclusion, Hold-and-wait, No preemption, Circular wait. All four must hold simultaneously.
Q1i. Which one of the following is the deadlock avoidance algorithm? (i) Banker's algorithm (ii) Round-robin algorithm (iii) Elevator algorithm (iv) Karn's algorithm20192m
Module 4: Deadlocks
View this question on its own page →Which one of the following is the deadlock avoidance algorithm?
(i) Banker's algorithm
(ii) Round-robin algorithm
(iii) Elevator algorithm
(iv) Karn's algorithmWorked SolutionAnswer: (i) Banker's algorithm
Banker's (Dijkstra) is avoidance — checks safe state before grant. Round-robin is CPU scheduling, Elevator is SCAN disk scheduling.
Q1j. Physical memory is broken into fixed-sized blocks called (i) frames (ii) pages (iii) backing store (iv) None of the above20192m
Module 5: Memory Management
View this question on its own page →Physical memory is broken into fixed-sized blocks called
(i) frames
(ii) pages
(iii) backing store
(iv) None of the aboveWorked SolutionAnswer: (i) frames
Physical memory = frames, logical pages map to frames via page table. Backing store is swap area on disk.
Q2. What is process control block? Explain it. Discuss the difference among short-term, medium-term and long-term scheduling.201914m
Module 2: Processes & Scheduling
View this question on its own page →What is process control block? Explain it.
Discuss the difference among short-term, medium-term and long-term scheduling.
Worked Solution(a) Process Control Block (PCB)
PCB is data structure per process maintained by kernel. Contents: Process ID, State (new/ready/running/waiting/terminated), Program Counter, CPU registers, Scheduling info (priority, queue pointers), Memory info (page tables, limits), I/O status (open files, devices), Accounting (CPU time, limits). Kernel uses PCB for context switch.
(b) Schedulers
- Long-term (Job scheduler): selects processes from job pool on disk to ready queue in memory. Controls degree of multiprogramming. Infrequent, slow. Absent in time-sharing.
- Medium-term: swapping — suspends/resumes processes to balance load, moves between memory/disk.
- Short-term (CPU scheduler): selects from ready queue to CPU frequently (ms). Must be fast; dispatcher then context-switches.
Tradeoff: LT controls admission, MT handles memory pressure, ST ensures responsiveness.
Q3. Consider the following process : | Process | Arrival Time | Burst Time | | :--- | :--- | :--- | | P1 | 0.0 | 7 | | P2 | 2.0 | 4 | | P3 | 4.0 | 1 | | P4 | 5.0 | 4 | Considering non-preemptive and preemptive SJF algorithm, find out average waiting time and average turnaround time in both cases.201914m
Module 2: Processes & Scheduling
View this question on its own page →Consider the following process :
Process Arrival Time Burst Time P1 0.0 7 P2 2.0 4 P3 4.0 1 P4 5.0 4 Considering non-preemptive and preemptive SJF algorithm, find out average waiting time and average turnaround time in both cases.
Worked SolutionSJF calculations (Arrival+ Burst)
P1 AT0 BT7, P2 AT2 BT4, P3 AT4 BT1, P4 AT5 BT4.
Non-preemptive SJF: At 0: P1 runs 0-7. At 7, ready P2(4),P3(1),P4(4) → P3 7-8, then P2 8-12, P4 12-16. WT: P1 0, P2 6, P3 3, P4 7 → Avg WT=4. Avg TAT = (7+10+4+11)/4=8.
Preemptive SJF (SRTF): 0-2 P1 (rem5), at2 P2 (4 vs5) → P2? Actually P1 rem5 vs P2 4 → preempt to P2 2-4 (rem2), at4 P3(1) arrives shortest → P3 4-5, back to P2 5-7, P4 arrives 5 (4) vs P1(5) → P4 7-11, P1 11-16. WT: P1 9, P2 1, P3 0, P4 2 → Avg WT=3. Avg TAT=7. Details with Gantt: Non-preemptive Gantt P1|P3|P2|P4, Preemptive P1(0-2)|P2(2-4)|P3(4-5)|P2(5-7)|P4(7-11)|P1(11-16).Q4. What do you understand by race condition? Give few example of arising of race condition in concurrent processing.201914m
Module 3: Inter-process Communication
View this question on its own page →What do you understand by race condition?
Give few example of arising of race condition in concurrent processing.
Worked SolutionRace Condition
Occurs when multiple processes/threads access shared data concurrently and outcome depends on order of execution.
Example: shared counterx=5, P1:x=x+1, P2:x=x-1interleaved without sync can give wrong result. Other examples: lost update in database, inconsistent file write, printer spooler with two producers updating buffer indices.
Requires mutual exclusion, atomic operations.Q5. (a) Define semaphore. Give a scheme for implementation of semaphore primitives. (b) What do you mean by critical section problem? What is the solution to the critical section problem?201914m
Module 3: Inter-process Communication
View this question on its own page →(a) Define semaphore. Give a scheme for implementation of semaphore primitives.
(b) What do you mean by critical section problem? What is the solution to the critical section problem?
Worked Solution(a) Semaphore & Primitives
Integer variable with atomic wait(S)/signal(V). Binary (0/1) vs counting. wait: while s≤0 wait, s-- ; signal: s++ and wake. Implementation via blocking queue, disable interrupts for atomicity.
(b) Critical Section
Segment accessing shared data. Requirements as before; solutions: mutex, semaphore (wait before CS, signal after), monitors.
Q6. (a) What is a thread? (b) How is thread different from a process? (c) What resources are used when a thread is created?201914m
Module 2: Processes & Scheduling
View this question on its own page →(a) What is a thread?
(b) How is thread different from a process?
(c) What resources are used when a thread is created?
Worked SolutionThreads (a) Lightweight process sharing address space
(b) Process has separate memory/files, heavy; thread shares, fast context, communication via shared memory
(c) Resources: TCB, stack, registers, priority, scheduling info, shared code/data/files with parent process.- 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.
Q7. How many page faults would occur for the following reference string for four page frames and three page frames using LRU and FIFO algorithms: 1, 2, 3, 4, 5, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2.201914m
Module 5: Memory Management
View this question on its own page →How many page faults would occur for the following reference string for four page frames and three page frames using LRU and FIFO algorithms:
1, 2, 3, 4, 5, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2.Worked SolutionRef 1,2,3,4,5,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2
With 3 frames: FIFO ~15 faults, LRU ~13. With 4 frames: FIFO ~12 (Belady: increase may not reduce), LRU ~10. Shows LRU generally better, FIFO anomaly. Count method per policy.
Q8. Define deadlock. List four necessary conditions for occurrence of deadlock. A system contains six units of resource, and *n* processes that use the resource. What is the maximum value of *n* for which the system will be deadlock free if the maximum requirement of each process is 3?201914m
Module 4: Deadlocks
View this question on its own page →Define deadlock. List four necessary conditions for occurrence of deadlock.
A system contains six units of resource, and n processes that use the resource. What is the maximum value of n for which the system will be deadlock free if the maximum requirement of each process is 3?
Worked SolutionDeadlock Definition & Conditions
Deadlock = set of processes blocked each waiting for resource held by another, circular wait.
Four Coffman conditions: Mutual Exclusion, Hold-and-Wait, No Preemption, Circular Wait.
Max n for 6 units, need 3 per process: For deadlock-free, n*(need-1)+1 ≤6 → n*2+1≤6 → n≤2 (integer). So n=2 deadlock-free, n=3 may deadlock. Some texts give n=2.Q9. Explain shortest-seek-time-first (SSTF) disk scheduling. Why SSTF scheduling tends to favour middle cylinders over the innermost and outer-most cylinders?201914m
Module 6: I/O & File Management
View this question on its own page →Explain shortest-seek-time-first (SSTF) disk scheduling.
Why SSTF scheduling tends to favour middle cylinders over the innermost and outer-most cylinders?
Worked SolutionSSTF Explanation & Middle Bias
SSTF picks nearest request, minimizing seek but not optimal. Middle cylinders favored because random requests distribution makes distance to middle average smallest, head lingers central, edge requests starve. Requires aging or SCAN to fix.
Coursify — Personal AI Course Generator
Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.