Group A — Short Answer Questions (1 Mark Each)

Q1Define an Operating System.

Ans: An Operating System is system software that acts as an intermediary between the user and the computer hardware. It manages all resources (CPU, main memory, I/O devices, files) and provides an environment in which programs can be executed conveniently and efficiently, e.g. UNIX, Linux, Windows.

Q2What is Kernel in Operating System?

Ans: The Kernel is the core, memory-resident part of the OS that executes in privileged (kernel) mode and remains loaded for the entire time the machine is on. It directly performs process scheduling, memory management, interrupt handling and device control; everything else runs as user-mode utilities.

Q3Define System Call.

Ans: A System Call is the programmatic interface through which a user-mode process requests a service from the kernel. It executes a trap (software interrupt) that switches the CPU from user mode to kernel mode, e.g. fork(), read(), exec().

Q4What is Process Control Block (PCB)?

Ans: The Process Control Block (PCB) is the kernel data structure that represents a process, storing its PID, process state, program counter, CPU registers, scheduling and priority information, memory-management information (base/limit or page-table pointer), accounting data and I/O status. It is the block saved and restored during a context switch.

Q5Define Process State.

Ans: Process State defines the current stage of process execution (New, Ready, Running, Waiting, Terminated) managed by the OS scheduler.

stateDiagram-v2 [*] --> New New --> Ready : Admitted Ready --> Running : Scheduler Dispatch Running --> Ready : Interrupt Running --> Waiting : I/O or Event Wait Waiting --> Ready : I/O or Event Completion Running --> Terminated : Exit Terminated --> [*]
Figure: 5-State Process Transition Diagram
Q6What is Context Switching?

Ans: Context Switching is the act of saving the context (program counter and CPU registers) of the currently running process into its PCB and loading the saved context of the next scheduled process. It is pure overhead — no useful user work is done during the switch.

Q7Define Throughput in CPU scheduling.

Ans: Throughput is the number of processes completed per unit of time, i.e. \( \text{Throughput} = \dfrac{\text{No. of processes completed}}{\text{Total time}} \). It is a measure of the total work done by the system and should be maximised.

Q8Define Turnaround Time.

Ans: Turnaround Time (TAT) is the total time elapsed from the submission (arrival) of a process to its completion: \( TAT = CT - AT \). Equivalently \( TAT = WT + BT \), since it includes both waiting and execution time.

Q9Define Waiting Time.

Ans: Waiting Time (WT) is the total time a process spends in the ready queue waiting for the CPU: \( WT = TAT - BT \). It excludes time spent executing on the CPU or blocked on I/O.

Q10Define Response Time.

Ans: Response Time is the time from submission of a request until the first response is produced, i.e. \( RT = \text{Time of first CPU allocation} - AT \). It measures responsiveness in interactive systems, not completion time.

Q11What is FCFS Scheduling?

Ans: First-Come First-Served (FCFS) is the simplest non-preemptive scheduling algorithm, in which the CPU is allocated to processes in the order of their arrival using a FIFO ready queue. It is simple but gives a high average waiting time and suffers from the convoy effect.

Q12What is Convoy Effect?

Ans: The Convoy Effect occurs in FCFS when one long CPU-bound process holds the CPU while many short processes queue behind it, forcing them all to wait. This lowers both CPU and I/O device utilisation and raises the average waiting time.

Q13What is Shortest Job First (SJF) scheduling?

Ans: Shortest Job First (SJF) selects the process with the smallest CPU burst time. Its preemptive variant is Shortest Remaining Time First (SRTF), which yields optimal minimal average waiting time.

Q14What is Shortest Remaining Time First (SRTF)?

Ans: Shortest Remaining Time First (SRTF) is the preemptive version of SJF: on every new arrival the scheduler compares remaining burst times and preempts the running process if the newcomer has a shorter remaining burst. It gives the provably minimum average waiting time but can starve long processes.

Q15What is Round Robin (RR) scheduling?

Ans: Round Robin (RR) is a preemptive scheduling algorithm designed for time-sharing systems, in which each process gets the CPU for at most one fixed time quantum; on expiry it is preempted and placed at the tail of the ready queue. It guarantees a bounded response time and is starvation-free.

Q16Define Time Quantum.

Ans: The Time Quantum (time slice) is the fixed, small unit of CPU time (typically 10–100 ms) for which a process may run in Round Robin before being preempted. If the quantum is too large RR degenerates into FCFS; if too small, context-switch overhead dominates.

Q17What is Priority Scheduling?

Ans: In Priority Scheduling each process is given a priority number and the CPU is allocated to the process with the highest priority (conventionally the smallest integer); equal priorities are broken by FCFS. It may be preemptive or non-preemptive and suffers from starvation, which is cured by aging.

Q18What is Starvation in CPU scheduling?

Ans: Starvation (indefinite blocking) is the situation in which a low-priority process waits in the ready queue indefinitely because a continuous stream of higher-priority processes keeps being scheduled ahead of it.

Q19Define Aging technique.

Ans: Aging is a technique that gradually increases the priority of a process the longer it waits in the ready queue, so that even a low-priority process eventually attains a high enough priority to execute. It is the standard cure for starvation in priority scheduling.

Q20What is Multilevel Queue Scheduling?

Ans: In Multilevel Queue Scheduling the ready queue is permanently partitioned into several separate queues (e.g. system, interactive, batch), each with its own scheduling algorithm, and a process is permanently assigned to one queue. Scheduling between the queues is done by fixed priority or time-slicing; processes do not migrate (migration is allowed only in Multilevel Feedback Queue).

Q21Define Critical Section.

Ans: A Critical Section is the segment of a process's code in which it accesses shared resources (shared variables, files, tables). The critical-section problem requires that no two processes execute in their critical sections at the same time.

Q22What is Mutual Exclusion?

Ans: Mutual Exclusion is the requirement that if one process is executing in its critical section, then no other process may execute in its critical section simultaneously. It is the first of the three requirements of a correct critical-section solution.

Q23Define Progress requirement in critical section.

Ans: The Progress requirement states that if no process is executing in its critical section and some processes wish to enter, then only those processes not in their remainder section may participate in deciding which enters next, and this selection cannot be postponed indefinitely.

Q24Define Bounded Waiting requirement.

Ans: Bounded Waiting requires that there exists a bound (limit) on the number of times other processes are allowed to enter their critical sections after a process has made a request to enter and before that request is granted. It prevents starvation of any waiting process.

Q25What is Semaphore?

Ans: A Semaphore is an integer variable \(S\) that, apart from initialisation, can be accessed only through two indivisible (atomic) operations — wait(S) / P which decrements and blocks if \(S < 0\), and signal(S) / V which increments and wakes a blocked process. It is used for mutual exclusion and process synchronisation.

Q26What is Binary Semaphore / Mutex?

Ans: A Binary Semaphore takes only the values 0 and 1 and therefore behaves as a lock providing mutual exclusion over a single resource. A Mutex is a binary lock with ownership — only the process that locked it is allowed to unlock it.

Q27What is Counting Semaphore?

Ans: A Counting Semaphore is a semaphore whose value may range over an unrestricted domain and is initialised to the number of available instances of a resource. Each wait() consumes one instance and each signal() releases one, so it controls access to a resource having multiple identical instances.

Q28Define Busy Waiting / Spinlock.

Ans: Busy Waiting occurs when a process waiting to enter its critical section continuously loops testing a lock variable, wasting CPU cycles; a lock implemented this way is called a Spinlock. It is acceptable only on multiprocessors when the expected waiting time is shorter than the cost of a context switch.

Q29What is Deadlock?

Ans: Deadlock is a situation in which a set of processes is permanently blocked because every process in the set is holding a resource and waiting to acquire a resource held by another process in the same set, so none can ever proceed.

Q30Name 4 necessary conditions for Deadlock.

Ans: The four necessary conditions, all of which must hold simultaneously, are: (i) Mutual Exclusion, (ii) Hold and Wait, (iii) No Preemption, and (iv) Circular Wait (Coffman conditions).

Q31What is Resource Allocation Graph (RAG)?

Ans: A Resource Allocation Graph (RAG) is a directed graph with process vertices (circles) and resource vertices (rectangles), a request edge \(P_i \rightarrow R_j\) and an assignment edge \(R_j \rightarrow P_i\). If every resource type has a single instance, a cycle implies deadlock; with multiple instances a cycle is only a necessary, not sufficient, condition.

Q32What is Deadlock Prevention?

Ans: Deadlock Prevention is a set of static restrictions on how resource requests may be made, designed so that at least one of the four necessary conditions can never hold (e.g. request all resources at once, or impose a total ordering on resources). It guarantees no deadlock but causes low device utilisation and reduced throughput.

Q33What is Deadlock Avoidance?

Ans: Deadlock Avoidance requires each process to declare in advance the maximum number of resources of each type it may need; before granting any request the system dynamically checks whether the resulting state is safe, and grants it only if it is. Banker's algorithm is the standard example.

Q34What is Banker's Algorithm?

Ans: Banker's Algorithm (Dijkstra) is a deadlock avoidance algorithm that evaluates if allocating requested resources leaves the system in a safe state where a safe sequence \(\langle P_1, P_2, \dots, P_n \rangle\) exists.

Q35Define Safe State in deadlock avoidance.

Ans: A system is in a Safe State if there exists a safe sequence \(\langle P_1, P_2, \dots, P_n \rangle\) such that the remaining need of each \(P_i\) can be satisfied by the currently available resources plus the resources held by all \(P_j\) with \(j < i\). A safe state is never a deadlocked state, though an unsafe state need not be deadlocked.

Q36What is Paging in memory management?

Ans: Paging is a non-contiguous memory-allocation scheme in which physical memory is divided into fixed-size blocks called frames and logical memory into blocks of the same size called pages; any page may be placed in any free frame. It completely eliminates external fragmentation.

Q37Define Page and Frame.

Ans: A Page is a fixed-size block of a process's logical (virtual) address space, while a Frame is a block of physical memory of exactly the same size (a power of 2, e.g. 4 KB). Paging loads one page into one frame, and the page table records the mapping.

Q38What is Page Table?

Ans: A Page Table is a per-process kernel data structure that maps each page number to its frame number in physical memory; it is located through the Page Table Base Register (PTBR). Each entry also carries the valid–invalid bit, protection bits, and dirty (modify) and reference bits.

Q39What is Translation Lookaside Buffer (TLB)?

Ans: The Translation Lookaside Buffer (TLB) is a small, fast, fully-associative hardware cache that holds recently used page-number → frame-number translations, so that a hit avoids the extra memory access needed to read the page table. With hit ratio \(h\), TLB access \(c\) and memory access \(m\): \( EMAT = h(c+m) + (1-h)(c+2m) \).

Q40Define Internal Fragmentation.

Ans: Internal Fragmentation is the memory wasted inside an allocated fixed-size block because the process needs slightly less than the whole block. In paging it occurs only in the last page of a process and averages half a page per process.

Q41Define External Fragmentation.

Ans: External Fragmentation exists when the total free memory is large enough to satisfy a request but it is not contiguous, so the request cannot be granted. It afflicts variable-partition allocation and segmentation, and is removed by compaction or by paging.

Q42What is Virtual Memory?

Ans: Virtual Memory is a technique that allows the execution of processes that are not completely in main memory, by separating the logical address space seen by the user from physical memory. It allows programs larger than physical memory to run and increases the degree of multiprogramming; it is usually implemented by demand paging.

Q43Define Page Fault.

Ans: A Page Fault is the trap raised by the hardware when a process references a page whose valid–invalid bit is set to invalid, i.e. the page is not present in main memory. The OS then locates the page on the backing store, swaps it into a free frame, updates the page table and restarts the interrupted instruction.

Q44What is Demand Paging?

Ans: Demand Paging is a virtual-memory implementation in which a page is brought into main memory only when it is referenced (by a page fault) and never in advance; the module that does this is called a lazy swapper or pager. It reduces I/O traffic, memory usage and process start-up time.

Q45Define Belady's Anomaly.

Ans: Belady's Anomaly is the counter-intuitive phenomenon in which, for certain reference strings, increasing the number of allocated frames increases the number of page faults. It occurs in FIFO replacement but never in stack algorithms such as LRU and Optimal.

Q46What is Thrashing?

Ans: Thrashing is the condition in which a process spends more time servicing page faults (paging in and out) than executing, because it does not have enough frames to hold its working set. CPU utilisation falls sharply while paging-device utilisation approaches 100%.

Q47Define Working Set Model.

Ans: The Working Set Model defines \(WS(t,\Delta)\) as the set of pages referenced in the most recent \(\Delta\) page references (the working-set window), which approximates the process's locality. If \(D = \sum WSS_i\) is the total demand and \(m\) the number of available frames, then \(D > m\) causes thrashing.

Q48What is SSTF Disk Scheduling?

Ans: Shortest Seek Time First (SSTF) selects the pending request whose cylinder is closest to the current head position, thus minimising the seek time for the next request. It gives far better average seek time than FCFS but is not optimal and can starve requests located far from the head.

Q49What is SCAN Disk Scheduling?

Ans: SCAN (Elevator) scheduling moves the disk head in one direction servicing every request on the way until it reaches the end of the disk, then reverses direction and services the requests on the return sweep. It avoids the starvation of SSTF but favours cylinders in the middle of the disk.

Q50What is C-SCAN Disk Scheduling?

Ans: C-SCAN (Circular SCAN) services requests in one direction only; on reaching the last cylinder the head jumps immediately back to the first cylinder without servicing any request on the return trip. Treating the disk as circular gives a more uniform waiting time than SCAN.

Q51Define Inode in UNIX file system.

Ans: An Inode (index node) is the on-disk UNIX data structure that stores all the metadata of one file — file type, permissions, owner/group ID, size, timestamps and link count — together with the direct and single/double/triple indirect pointers to its data blocks. The file name is not stored in the inode; it is kept in the directory entry, which maps name → inode number.

Q52What is Zombie Process?

Ans: A Zombie (defunct) Process is a process that has terminated but whose entry still remains in the process table because its parent has not yet executed wait() to read its exit status. It holds no memory or other resources, only the PCB entry.

Q53What is Orphan Process?

Ans: An Orphan Process is a process whose parent has terminated while the child is still running. It is immediately re-parented (adopted) by init/systemd (PID 1), which subsequently calls wait() to reap it.