2025 question paper
Operating System
28 questions
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
View this question on its own page →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 OSWorked SolutionAnswer: (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.
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
View this question on its own page →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 schedulerWorked SolutionAnswer: (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.
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
View this question on its own page →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 processWorked SolutionAnswer: (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.
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
View this question on its own page →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 threadWorked SolutionAnswer: (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.
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
View this question on its own page →The Dining Philosopher Algorithm is a classic example of which problem?
(i) CPU scheduling
(ii) Memory fragmentation
(iii) Process synchronization and deadlock
(iv) File allocationWorked SolutionAnswer: (iii) Process synchronization and deadlock
Dining philosophers share forks (resources); illustrates synchronization, deadlock, starvation. Classic IPC problem solved by semaphores/monitors.
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
View this question on its own page →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 ignoringWorked SolutionAnswer: (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.
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
View this question on its own page →Which free-space management technique uses a bitmap to indicate free and occupied blocks?
(i) Bit Vector
(ii) Indexing
(iii) Grouping
(iv) Linked ListWorked SolutionAnswer: (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.
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
View this question on its own page →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 partitionWorked SolutionAnswer: (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.
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
View this question on its own page →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) NRUWorked SolutionAnswer: (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.
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
View this question on its own page →Which disk scheduling algorithm services requests in the order they arrive?
(i) SCAN
(ii) SSTF
(iii) FCFS
(iv) C-SCANWorked SolutionAnswer: (iii) FCFS
FCFS (First-come-first-serve) services in arrival order, simple but convoy effect. SCAN/SSTF reorder to minimize seek.
- 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. Explain system calls and their importance in Operating Systems. Discuss various categories of system calls.20257m
Module 1: Introduction to Operating Systems
View this question on its own page →Explain system calls and their importance in Operating Systems. Discuss various categories of system calls.
Worked SolutionSystem Calls & Importance
Interface for user programs to request kernel services (trap to kernel mode). Essential for protected hardware access.
Categories
- Process Control: fork, exec, exit, wait, kill
- File Management: open, read, write, close, unlink
- Device Management: ioctl, read/write device
- Information Maintenance: getpid, time, sysinfo
- Communication: pipe, shmget, send/recv
- Protection: chmod, chown
Importance: provides abstraction, security, portability. Invoked via syscall instruction (int 0x80 / syscall). Library wrappers handle setup.
Q2b. Illustrate the concept of Virtual Machines.20257m
Module 1: Introduction to Operating Systems
View this question on its own page →Illustrate the concept of Virtual Machines.
Worked SolutionVirtual 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.
Q3a. What is a Process Control Block? Explain its structure and significance in process management.20257m
Module 2: Processes & Scheduling
View this question on its own page →What is a Process Control Block? Explain its structure and significance in process management.
Worked SolutionPCB 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.
Q3b. Define threads and explain their various states. Compare user-level threads with kernel-level threads.20257m
Module 2: Processes & Scheduling
View this question on its own page →Define threads and explain their various states. Compare user-level threads with kernel-level threads.
Worked SolutionThreads & 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.
Q4a. Discuss multiprocessor scheduling and real-time scheduling techniques.20257m
Module 2: Processes & Scheduling
View this question on its own page →Discuss multiprocessor scheduling and real-time scheduling techniques.
Worked SolutionMultiprocessor & 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.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
View this question on its own page →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 Worked SolutionBanker'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.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
View this question on its own page →Explain the structure of a file system. Discuss the role of directories, metadata, and file control blocks in file management.
Worked SolutionFile 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.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
View this question on its own page →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, 130Starting 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.
Worked SolutionSSTF 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.Q6a. Describe the objectives of process scheduling. Explain the roles of long-term, medium-term, and short-term schedulers.20257m
Module 2: Processes & Scheduling
View this question on its own page →Describe the objectives of process scheduling. Explain the roles of long-term, medium-term, and short-term schedulers.
Worked SolutionScheduling Objectives
Max utilization, throughput, minimize turnaround/waiting/response, fairness.
Roles as earlier: LT admit, MT suspend, ST dispatch.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
View this question on its own page →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, 2Which of FIFO or LRU would be better in this case as a page replacement policy? Why?
Worked Solution4 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.
- 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. Explain the Producer-Consumer problem and discuss how semaphores can be used to solve it.20257m
Module 3: Inter-process Communication
View this question on its own page →Explain the Producer-Consumer problem and discuss how semaphores can be used to solve it.
Worked SolutionProducer-Consumer
As Q23: bounded buffer problem, solution with semaphores empty/full/mutex as above.
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
View this question on its own page →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.
Worked SolutionSJF 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.
Q8a. Discuss deadlock recovery techniques. Explain process termination and resource preemption methods used for recovery from deadlock.20257m
Module 4: Deadlocks
View this question on its own page →Discuss deadlock recovery techniques. Explain process termination and resource preemption methods used for recovery from deadlock.
Worked SolutionDeadlock 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.
Q8b. Write an algorithm for Readers-Writers Problem solution using Semaphores.20257m
Module 3: Inter-process Communication
View this question on its own page →Write an algorithm for Readers-Writers Problem solution using Semaphores.
Worked SolutionReaders-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.Q9a. Write a short note on: Process State transitions20257m
Module 2: Processes & Scheduling
View this question on its own page →Write a short note on:
Process State transitions
Worked SolutionProcess State Transitions
As Q13: New→Ready→Running↔Waiting→Terminated, with suspend states. Explained with diagram and events.
Q9b. Write a short note on: Paging and segmentation20257m
Module 5: Memory Management
View this question on its own page →Write a short note on:
Paging and segmentation
Worked SolutionPaging 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).Q9c. Write a short note on: Contiguous Memory allocation20257m
Module 5: Memory Management
View this question on its own page →Write a short note on:
Contiguous Memory allocation
Worked SolutionContiguous 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.
Q9d. Write a short note on: Boot-block and Bad blocks20257m
Module 6: I/O & File Management
View this question on its own page →Write a short note on:
Boot-block and Bad blocks
Worked SolutionBoot-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.
Coursify Android App
Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.