2019 question paper

Operating System

13 questions

  1. 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

    What is operating system?

    (i) Collection of programs that manages hardware resources
    (ii) System service provider to the application programs

    View this question on its own page →
    Worked Solution

    Answer: 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).**
  2. 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

    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 queue

    View this question on its own page →
    Worked Solution

    Answer: (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.

  3. 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

    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 above

    View this question on its own page →
    Worked Solution

    Answer: (iv) All of the above

    Coffman conditions for deadlock: Mutual exclusion, Hold-and-wait, No preemption, Circular wait. All four must hold simultaneously.

  4. 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

    Which one of the following is the deadlock avoidance algorithm?

    (i) Banker's algorithm
    (ii) Round-robin algorithm
    (iii) Elevator algorithm
    (iv) Karn's algorithm

    View this question on its own page →
    Worked Solution

    Answer: (i) Banker's algorithm

    Banker's (Dijkstra) is avoidance — checks safe state before grant. Round-robin is CPU scheduling, Elevator is SCAN disk scheduling.

  5. 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

    Physical memory is broken into fixed-sized blocks called

    (i) frames
    (ii) pages
    (iii) backing store
    (iv) None of the above

    View this question on its own page →
    Worked Solution

    Answer: (i) frames

    Physical memory = frames, logical pages map to frames via page table. Backing store is swap area on disk.

  6. 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

    What is process control block? Explain it.

    Discuss the difference among short-term, medium-term and long-term scheduling.

    View this question on its own page →
    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.
  7. 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

    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.

    View this question on its own page →
    Worked Solution

    SJF 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).

  8. 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

    What do you understand by race condition?

    Give few example of arising of race condition in concurrent processing.

    View this question on its own page →
    Worked Solution

    Race Condition

    Occurs when multiple processes/threads access shared data concurrently and outcome depends on order of execution.
    Example: shared counter x=5, P1: x=x+1, P2: x=x-1 interleaved 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.

  9. 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

    (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?

    View this question on its own page →
    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.

  10. 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

    (a) What is a thread?

    (b) How is thread different from a process?

    (c) What resources are used when a thread is created?

    View this question on its own page →
    Worked Solution

    Threads (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.

  11. Budget 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.

    Install Pocketly
  12. 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

    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.

    View this question on its own page →
    Worked Solution

    Ref 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.

  13. 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

    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?

    View this question on its own page →
    Worked Solution

    Deadlock 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.

  14. 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

    Explain shortest-seek-time-first (SSTF) disk scheduling.

    Why SSTF scheduling tends to favour middle cylinders over the innermost and outer-most cylinders?

    View this question on its own page →
    Worked Solution

    SSTF 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.

AI LearningWeb Platform

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.