2025 question paper

Operating System

28 questions

  1. Q1a. Which type of Operating System allows multiple users to access the system simultaneously? (i) Single-user OS (ii) Batch OS (iii) Multi-user OS (iv) Embedded OS20252m

    Module 1: Introduction to Operating Systems

    Which type of Operating System allows multiple users to access the system simultaneously?

    (i) Single-user OS
    (ii) Batch OS
    (iii) Multi-user OS
    (iv) Embedded OS

    View this question on its own page →
    Worked Solution

    Answer: (iii) Multi-user OS

    • Multi-user OS (e.g., UNIX, Linux, Windows Server) allows multiple users to access the system simultaneously via terminals/remote sessions, with isolation and access control.
    • Single-user OS allows only one user at a time.
    • Batch OS executes jobs without user interaction.
    • Embedded OS is specialized for devices, not multi-user access.
  2. Q1b. Which scheduler selects processes from the ready queue and allocates the CPU? (i) Long-term scheduler (ii) Medium-term scheduler (iii) Short-term scheduler (iv) Batch scheduler20252m

    Module 2: Processes & Scheduling

    Which scheduler selects processes from the ready queue and allocates the CPU?

    (i) Long-term scheduler
    (ii) Medium-term scheduler
    (iii) Short-term scheduler
    (iv) Batch scheduler

    View this question on its own page →
    Worked Solution

    Answer: (iii) Short-term scheduler (CPU scheduler)

    • Long-term: selects jobs from job pool to ready queue (controls degree of multiprogramming)
    • Medium-term: swapping (suspend/resume)
    • Short-term / CPU scheduler: selects process from ready queue and allocates CPU via dispatcher (runs most frequently, must be fast)
    • Batch scheduler is not an OS scheduler type.
  3. Q1c. What is the motive of using a Virtual Machine for an operating system? (i) Increase CPU throughput (ii) Run multiple operating systems on the same hardware (iii) Create databases (iv) Allow multiple threads to execute concurrently within a process20252m

    Module 1: Introduction to Operating Systems

    What is the motive of using a Virtual Machine for an operating system?

    (i) Increase CPU throughput
    (ii) Run multiple operating systems on the same hardware
    (iii) Create databases
    (iv) Allow multiple threads to execute concurrently within a process

    View this question on its own page →
    Worked Solution

    Answer: (ii) Run multiple operating systems on the same hardware

    VM provides virtualization via hypervisor (Type1 bare-metal or Type2 hosted), allowing isolation, consolidation, testing and safe execution of multiple OS instances on one physical host. Not primarily for CPU throughput or databases.

  4. Q1d. Which type of thread is managed directly by the operating system kernel? (i) User-level thread (ii) Kernel-level thread (iii) Single thread (iv) Background thread20252m

    Module 2: Processes & Scheduling

    Which type of thread is managed directly by the operating system kernel?

    (i) User-level thread
    (ii) Kernel-level thread
    (iii) Single thread
    (iv) Background thread

    View this question on its own page →
    Worked Solution

    Answer: (ii) Kernel-level thread

    Kernel threads are managed directly by kernel (visible to scheduler). User-level threads are managed by user library, kernel unaware. Kernel threads allow true parallelism on multicore but have higher creation/scheduling overhead.

  5. Q1e. The Dining Philosopher Algorithm is a classic example of which problem? (i) CPU scheduling (ii) Memory fragmentation (iii) Process synchronization and deadlock (iv) File allocation20252m

    Module 3: Inter-process Communication

    The Dining Philosopher Algorithm is a classic example of which problem?

    (i) CPU scheduling
    (ii) Memory fragmentation
    (iii) Process synchronization and deadlock
    (iv) File allocation

    View this question on its own page →
    Worked Solution

    Answer: (iii) Process synchronization and deadlock

    Dining philosophers share forks (resources); illustrates synchronization, deadlock, starvation. Classic IPC problem solved by semaphores/monitors.

  6. Q1f. Which technique allows the operating system to examine the resource allocation state dynamically to ensure no deadlock occurs? (i) Deadlock detection (ii) Deadlock recovery (iii) Deadlock avoidance (iv) Deadlock ignoring20252m

    Module 4: Deadlocks

    Which technique allows the operating system to examine the resource allocation state dynamically to ensure no deadlock occurs?

    (i) Deadlock detection
    (ii) Deadlock recovery
    (iii) Deadlock avoidance
    (iv) Deadlock ignoring

    View this question on its own page →
    Worked Solution

    Answer: (iii) Deadlock avoidance

    Banker's algorithm (avoidance) dynamically checks safe state before allocating. Prevention prohibits one of four necessary conditions, Detection+Recovery allows deadlock then resolves, Ignoring (ostrich) does nothing.

  7. Q1g. Which free-space management technique uses a bitmap to indicate free and occupied blocks? (i) Bit Vector (ii) Indexing (iii) Grouping (iv) Linked List20252m

    Module 6: I/O & File Management

    Which free-space management technique uses a bitmap to indicate free and occupied blocks?

    (i) Bit Vector
    (ii) Indexing
    (iii) Grouping
    (iv) Linked List

    View this question on its own page →
    Worked Solution

    Answer: (i) Bit Vector

    Bit vector/bitmap: each bit represents a block, 1=free, 0=allocated (or vice versa). Allows fast lookup. Grouping, linked list, counting are other methods.

  8. Q1h. Internal fragmentation occurs when (i) Processes are swapped out (ii) Pages are missing (iii) Memory is completely utilized (iv) Unused space exists within an allocated memory partition20252m

    Module 5: Memory Management

    Internal fragmentation occurs when

    (i) Processes are swapped out
    (ii) Pages are missing
    (iii) Memory is completely utilized
    (iv) Unused space exists within an allocated memory partition

    View this question on its own page →
    Worked Solution

    Answer: (iv) Unused space exists within an allocated memory partition

    Internal fragmentation = waste inside allocated block (e.g., fixed 10KB block allocated to 8KB process leaves 2KB internal). External = free holes scattered outside.

  9. Q1i. Which page replacement algorithm replaces the page that will not be used for the longest period in the future? (i) Optimal (ii) Second Chance (iii) FIFO (iv) NRU20252m

    Module 5: Memory Management

    Which page replacement algorithm replaces the page that will not be used for the longest period in the future?

    (i) Optimal
    (ii) Second Chance
    (iii) FIFO
    (iv) NRU

    View this question on its own page →
    Worked Solution

    Answer: (i) Optimal

    Optimal (Belady's) replaces page farthest in future — theoretically minimal faults but requires future knowledge, so not realizable; used as benchmark. Approximated by LRU.

  10. Q1j. Which disk scheduling algorithm services requests in the order they arrive? (i) SCAN (ii) SSTF (iii) FCFS (iv) C-SCAN20252m

    Module 6: I/O & File Management

    Which disk scheduling algorithm services requests in the order they arrive?

    (i) SCAN
    (ii) SSTF
    (iii) FCFS
    (iv) C-SCAN

    View this question on its own page →
    Worked Solution

    Answer: (iii) FCFS

    FCFS (First-come-first-serve) services in arrival order, simple but convoy effect. SCAN/SSTF reorder to minimize seek.

  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. Q2a. Explain system calls and their importance in Operating Systems. Discuss various categories of system calls.20257m

    Module 1: Introduction to Operating Systems

    Explain system calls and their importance in Operating Systems. Discuss various categories of system calls.

    View this question on its own page →
    Worked Solution

    System Calls & Importance

    Interface for user programs to request kernel services (trap to kernel mode). Essential for protected hardware access.

    Categories

    1. Process Control: fork, exec, exit, wait, kill
    2. File Management: open, read, write, close, unlink
    3. Device Management: ioctl, read/write device
    4. Information Maintenance: getpid, time, sysinfo
    5. Communication: pipe, shmget, send/recv
    6. Protection: chmod, chown
      Importance: provides abstraction, security, portability. Invoked via syscall instruction (int 0x80 / syscall). Library wrappers handle setup.
  13. Q2b. Illustrate the concept of Virtual Machines.20257m

    Module 1: Introduction to Operating Systems

    Illustrate the concept of Virtual Machines.

    View this question on its own page →
    Worked Solution

    Virtual Machine

    VM is software emulation of physical machine via hypervisor.

    • Type1 (bare-metal): hypervisor on hardware (VMware ESXi, Xen)
    • Type2 (hosted): hypervisor on host OS (VirtualBox)
      Components: virtual CPU, virtual memory, virtual devices. Isolation, snapshot, migration. Uses: server consolidation, testing, cloud. Advantages: isolation, resource utilization. Cost: overhead, I/O virtualization. Example: running Linux+Windows simultaneously.
  14. Q3a. What is a Process Control Block? Explain its structure and significance in process management.20257m

    Module 2: Processes & Scheduling

    What is a Process Control Block? Explain its structure and significance in process management.

    View this question on its own page →
    Worked Solution

    PCB Structure & Significance

    Fields: PID, state, PC, registers, scheduling info, memory management (page table base), I/O info, accounting. Significance: enables context switch, scheduling, process management; kernel's repository for resume. Stored in kernel space per process.

  15. Q3b. Define threads and explain their various states. Compare user-level threads with kernel-level threads.20257m

    Module 2: Processes & Scheduling

    Define threads and explain their various states. Compare user-level threads with kernel-level threads.

    View this question on its own page →
    Worked Solution

    Threads & States

    Thread = lightweight process, dispatchable unit, shares address space, files of parent.
    States: New, Ready, Running, Blocked, Terminated.

    ULT vs KLT

    • ULT: managed by user library, many-to-one, fast, kernel unaware, blocking blocks process.
    • KLT: managed by kernel, one-to-one, slower but true parallelism, blocking of one KLT not block process. Hybrid many-to-many combines.
  16. Q4a. Discuss multiprocessor scheduling and real-time scheduling techniques.20257m

    Module 2: Processes & Scheduling

    Discuss multiprocessor scheduling and real-time scheduling techniques.

    View this question on its own page →
    Worked Solution

    Multiprocessor & Real-time Scheduling

    Multiprocessor: load sharing, affinity, gang scheduling; approaches: SMP symmetric (each CPU self-schedules) vs master-slave. Need load balancing.
    Real-time: hard (deadline must met) vs soft. Algorithms: Rate Monotonic (priority ∝ period), EDF (earliest deadline first), priority inheritance to avoid inversion.

  17. Q4b. Consider a system with five processes P0 through P4 and four resources type A, B, C and D. Using the Banker's algorithm answer that the system is in a safe state? | Process | Allocation (A B C D) | Max (A B C D) | Available (A B C D) | | :--- | :---: | :---: | :---: | | P0 | 0 0 1 2 | 0 0 1 2 | 1 5 2 0 | | P1 | 1 0 0 0 | 1 7 5 0 | | | P2 | 1 3 5 4 | 2 3 5 6 | | | P3 | 0 6 3 2 | 0 6 5 2 | | | P4 | 0 0 1 4 | 0 6 5 6 | |20257m

    Module 4: Deadlocks

    Consider a system with five processes P0 through P4 and four resources type A, B, C and D. Using the Banker's algorithm answer that the system is in a safe state?

    Process Allocation (A B C D) Max (A B C D) Available (A B C D)
    P0 0 0 1 2 0 0 1 2 1 5 2 0
    P1 1 0 0 0 1 7 5 0
    P2 1 3 5 4 2 3 5 6
    P3 0 6 3 2 0 6 5 2
    P4 0 0 1 4 0 6 5 6
    View this question on its own page →
    Worked Solution

    Banker's Safe State Check (5 processes A-D)

    Available 1,5,2,0. Need = Max-Alloc.
    P0 Need 0,0,0,0 → can run, completes, releases 0,0,1,2 → Avail 1,5,3,2.
    P3 Need 0,0,2,0 ≤ Avail → run → Avail 1,11,6,4.
    P1 Need 0,7,5,0 ≤ Avail → run → Avail 2,11,6,4.
    P2 Need 1,0,0,2 ≤ Avail → run → Avail 3,14,11,8.
    P4 Need 0,6,4,2 ≤ Avail → finishes.
    Safe sequence P0→P3→P1→P2→P4 exists, so system is safe.

  18. Q5a. Explain the structure of a file system. Discuss the role of directories, metadata, and file control blocks in file management.20257m

    Module 6: I/O & File Management

    Explain the structure of a file system. Discuss the role of directories, metadata, and file control blocks in file management.

    View this question on its own page →
    Worked Solution

    File System Structure

    Layers: logical FS, file-organization, basic FS, I/O control. Components: Boot block, Superblock, FCB/inode (metadata: name, size, permissions, blocks), Directory (maps name→FCB), Data blocks, Free space map.
    Directories: single/two-level/tree/acyclic. FCB: holds metadata. Role: directory resolves path, FCB tracks per-file info.

  19. Q5b. Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending request, in FIFO order is: 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130 Starting from the current head position, applying Shortest-seek-time-first (SSTF) algorithm find what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests.20257m

    Module 6: I/O & File Management

    Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending request, in FIFO order is:
    86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130

    Starting from the current head position, applying Shortest-seek-time-first (SSTF) algorithm find what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests.

    View this question on its own page →
    Worked Solution

    SSTF 5000 cylinders head 143 requests 86,1470,913,1774,948,1509,1022,1750,130

    Order: 143→130(13)=13,130→86(44)=57,86→913(827)=884,913→948(35)=919,948→1022(74)=993,1022→1470(448)=1441,1470→1509(39)=1480,1509→1750(241)=1721,1750→1774(24)=1745.
    Total 1745 cylinders.

  20. Q6a. Describe the objectives of process scheduling. Explain the roles of long-term, medium-term, and short-term schedulers.20257m

    Module 2: Processes & Scheduling

    Describe the objectives of process scheduling. Explain the roles of long-term, medium-term, and short-term schedulers.

    View this question on its own page →
    Worked Solution

    Scheduling Objectives

    Max utilization, throughput, minimize turnaround/waiting/response, fairness.
    Roles as earlier: LT admit, MT suspend, ST dispatch.

  21. Q6b. Consider the main memory with the capacity of 4 page frames. Assume that the pages of a process are referenced in the order as given below: 1, 3, 4, 4, 3, 2, 1, 7, 5, 6, 4, 2, 1, 2 Which of FIFO or LRU would be better in this case as a page replacement policy? Why?20257m

    Module 5: Memory Management

    Consider the main memory with the capacity of 4 page frames. Assume that the pages of a process are referenced in the order as given below:
    1, 3, 4, 4, 3, 2, 1, 7, 5, 6, 4, 2, 1, 2

    Which of FIFO or LRU would be better in this case as a page replacement policy? Why?

    View this question on its own page →
    Worked Solution

    4 frames ref 1,3,4,4,3,2,1,7,5,6,4,2,1,2

    Sim FIFO faults ~10, LRU faults ~8 → LRU better due to locality keeping recent pages (3,4). FIFO evicts early 1 quickly leading to extra fault when 1 reappears. LRU approximates working set.

  22. 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
  23. Q7a. Explain the Producer-Consumer problem and discuss how semaphores can be used to solve it.20257m

    Module 3: Inter-process Communication

    Explain the Producer-Consumer problem and discuss how semaphores can be used to solve it.

    View this question on its own page →
    Worked Solution

    Producer-Consumer

    As Q23: bounded buffer problem, solution with semaphores empty/full/mutex as above.

  24. Q7b. Consider the following set of processes with the length of the CPU burst given in milliseconds: | Process | Burst Time | Priority | | :---: | :---: | :---: | | A | 10 | 3 | | B | 1 | 1 | | C | 2 | 3 | | D | 1 | 4 | | E | 5 | 2 | The processes are assumed to have arrived in order A, B, C, D, E all at time 0. Draw the Gantt charts that illustrate the execution of SJF scheduling algorithm. Show which algorithm results in the minimum average waiting time.20257m

    Module 2: Processes & Scheduling

    Consider the following set of processes with the length of the CPU burst given in milliseconds:

    Process Burst Time Priority
    A 10 3
    B 1 1
    C 2 3
    D 1 4
    E 5 2

    The processes are assumed to have arrived in order A, B, C, D, E all at time 0. Draw the Gantt charts that illustrate the execution of SJF scheduling algorithm. Show which algorithm results in the minimum average waiting time.

    View this question on its own page →
    Worked Solution

    SJF as Q72: sorted B1,D1,C2,E5,A10 → Gantt B0-1,D1-2,C2-4,E4-9,A9-19, Avg WT 3.2, proving SJF optimal for avg WT vs FCFS 9.6.

  25. Q8a. Discuss deadlock recovery techniques. Explain process termination and resource preemption methods used for recovery from deadlock.20257m

    Module 4: Deadlocks

    Discuss deadlock recovery techniques. Explain process termination and resource preemption methods used for recovery from deadlock.

    View this question on its own page →
    Worked Solution

    Deadlock Recovery

    • Process termination: abort all deadlocked or one by one (victim selection by priority/cost), rollback.
    • Resource preemption: preempt resources, roll back process to safe state, starvation avoidance. Requires selecting victim, rollback, starvation prevention.
  26. Q8b. Write an algorithm for Readers-Writers Problem solution using Semaphores.20257m

    Module 3: Inter-process Communication

    Write an algorithm for Readers-Writers Problem solution using Semaphores.

    View this question on its own page →
    Worked Solution

    Readers-Writers with Semaphores

    shared int readcount=0; sem mutex=1, wrt=1;
    Reader: wait(mutex); readcount++; if(readcount==1) wait(wrt); signal(mutex); read; wait(mutex); readcount--; if(readcount==0) signal(wrt); signal(mutex);
    Writer: wait(wrt); write; signal(wrt);
    Readers preference variant, writer may starve; for writer preference add extra sem.

  27. Q9a. Write a short note on: Process State transitions20257m

    Module 2: Processes & Scheduling

    Write a short note on:

    Process State transitions

    View this question on its own page →
    Worked Solution

    Process State Transitions

    As Q13: New→Ready→Running↔Waiting→Terminated, with suspend states. Explained with diagram and events.

  28. Q9b. Write a short note on: Paging and segmentation20257m

    Module 5: Memory Management

    Write a short note on:

    Paging and segmentation

    View this question on its own page →
    Worked Solution

    Paging vs Segmentation

    Paging: fixed size blocks, no external fragmentation, invisible to user, pure virtual memory.
    Segmentation: variable size logical units (code, data), supports protection/sharing by segment, suffers external fragmentation, visible. Combined paging+segmentation used in modern systems (Intel).

  29. Q9c. Write a short note on: Contiguous Memory allocation20257m

    Module 5: Memory Management

    Write a short note on:

    Contiguous Memory allocation

    View this question on its own page →
    Worked Solution

    Contiguous Memory Allocation

    Each process occupies one contiguous block. Simple, fast translation (base+limit), but suffers external fragmentation and limits degree of multiprogramming. Fixed/variable partition are variants. Paging removes need for contiguous.

  30. Q9d. Write a short note on: Boot-block and Bad blocks20257m

    Module 6: I/O & File Management

    Write a short note on:

    Boot-block and Bad blocks

    View this question on its own page →
    Worked Solution

    Boot-block and Bad Blocks

    • Boot-block: reserved block per disk containing bootstrap loader, executed at boot.
    • Bad blocks: damaged sectors marked in bad block table, excluded from allocation, handled via sector sparing or skipping.
Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.