BSc CSIT (TU) Science Operating System (BSc CSIT, CSC259) Question Paper 2080 Nepal
This is the official BSc CSIT (TU) (Science stream) Operating System (BSc CSIT, CSC259) question paper for 2080, as set in the regular annual examination. It carries 60 full marks and a time allowance of 180 minutes, across 12 questions. On Kekkei you can attempt this Operating System (BSc CSIT, CSC259) past paper online with a timer, get instant AI feedback and step-by-step solutions, and track the topics where you lose marks — completely free. Whether you are revising for your BSc CSIT (TU) Operating System (BSc CSIT, CSC259) exam or solving previous years' question papers, this 2080 paper is a great way to practise under real exam conditions.
Section A: Long Answer Questions
Attempt any TWO questions.
Consider the following processes with their arrival and burst times. Compute the average waiting time and turnaround time for FCFS, SJF (preemptive/SRTN), and Round Robin (quantum = 2) scheduling algorithms.
Since the question does not give explicit values, we solve a standard representative data set:
| Process | Arrival Time | Burst Time |
|---|---|---|
| P1 | 0 | 5 |
| P2 | 1 | 3 |
| P3 | 2 | 1 |
| P4 | 3 | 2 |
| P5 | 4 | 3 |
Turnaround Time (TAT) = Completion Time − Arrival Time, Waiting Time (WT) = Turnaround Time − Burst Time.
(a) FCFS (First-Come First-Served)
Execution order = P1, P2, P3, P4, P5 (by arrival).
| P | AT | BT | CT | TAT | WT |
|---|---|---|---|---|---|
| P1 | 0 | 5 | 5 | 5 | 0 |
| P2 | 1 | 3 | 8 | 7 | 4 |
| P3 | 2 | 1 | 9 | 7 | 6 |
| P4 | 3 | 2 | 11 | 8 | 6 |
| P5 | 4 | 3 | 14 | 10 | 7 |
Average WT , Average TAT .
(b) SJF Preemptive (SRTN – Shortest Remaining Time Next)
At each instant the process with the smallest remaining burst runs.
Gantt: P1(0-1) P2(1-2) P3(2-3) P2(3-5) P4(5-7) P5(7-10) P1(10-14)
| P | AT | BT | CT | TAT | WT |
|---|---|---|---|---|---|
| P1 | 0 | 5 | 14 | 14 | 9 |
| P2 | 1 | 3 | 5 | 4 | 1 |
| P3 | 2 | 1 | 3 | 1 | 0 |
| P4 | 3 | 2 | 7 | 4 | 2 |
| P5 | 4 | 3 | 10 | 6 | 3 |
Average WT , Average TAT .
(c) Round Robin (Quantum = 2)
Ready queue serviced in time slices of 2.
Gantt: P1(0-2) P2(2-4) P3(4-5) P4(5-7) P1(7-9) P5(9-11) P2(11-12) P1(12-13) P5(13-14)
| P | AT | BT | CT | TAT | WT |
|---|---|---|---|---|---|
| P1 | 0 | 5 | 13 | 13 | 8 |
| P2 | 1 | 3 | 12 | 11 | 8 |
| P3 | 2 | 1 | 5 | 3 | 2 |
| P4 | 3 | 2 | 7 | 4 | 2 |
| P5 | 4 | 3 | 14 | 10 | 7 |
Average WT , Average TAT .
Conclusion
For this data, SRTN gives the lowest average waiting (3.0) and turnaround (5.8) time, confirming that SJF/SRTN is optimal for minimizing average waiting time, while RR gives the highest because of context-switch overhead but provides better responsiveness.
What is a deadlock? Explain the four necessary conditions for deadlock and describe deadlock avoidance using the Banker's algorithm with an example.
Deadlock
A deadlock is a situation in which a set of processes is permanently blocked because each process is holding a resource and simultaneously waiting for a resource that is held by another process in the same set. No process can proceed, and the cycle never breaks without external intervention.
Four Necessary Conditions (Coffman conditions)
All four must hold simultaneously for a deadlock:
- Mutual Exclusion – At least one resource is held in a non-sharable mode; only one process can use it at a time.
- Hold and Wait – A process holding at least one resource is waiting to acquire additional resources held by other processes.
- No Preemption – A resource cannot be forcibly taken away; it is released only voluntarily by the holding process.
- Circular Wait – There exists a circular chain of processes , where each process waits for a resource held by the next.
Deadlock Avoidance – Banker's Algorithm
Deadlock avoidance uses prior knowledge of the maximum resource demand of each process. The system only grants a request if the resulting state is safe — i.e., there exists a sequence in which all processes can complete. The Banker's algorithm maintains: Available, Max, Allocation, and Need = Max − Allocation.
Example (3 resource types A, B, C; total = 10, 5, 7)
| Process | Allocation (A B C) | Max (A B C) | Need (A B C) |
|---|---|---|---|
| P0 | 0 1 0 | 7 5 3 | 7 4 3 |
| P1 | 2 0 0 | 3 2 2 | 1 2 2 |
| P2 | 3 0 2 | 9 0 2 | 6 0 0 |
| P3 | 2 1 1 | 2 2 2 | 0 1 1 |
| P4 | 0 0 2 | 4 3 3 | 4 3 1 |
Total allocated = (7 2 5), so Available = (3 3 2).
Safety check: Find a process whose Need ≤ Available, run it, and release its resources.
- Available (3 3 2): P1 Need (1 2 2) ≤ (3 3 2) ✓ → release → Available (5 3 2)
- P3 Need (0 1 1) ≤ (5 3 2) ✓ → Available (7 4 3)
- P4 Need (4 3 1) ≤ (7 4 3) ✓ → Available (7 4 5)
- P0 Need (7 4 3) ≤ (7 4 5) ✓ → Available (7 5 5)
- P2 Need (6 0 0) ≤ (7 5 5) ✓ → Available (10 5 7)
A safe sequence ⟨P1, P3, P4, P0, P2⟩ exists, so the state is safe and no deadlock will occur. If a new request (e.g., P1 requests (1 0 2)) keeps the state safe after the Resource-Request algorithm check, it is granted; otherwise the process must wait.
What is a resource allocation graph? Explain the process of detecting deadlock when there is a single instance of each resource type with a suitable example.
Resource Allocation Graph (RAG)
A Resource Allocation Graph is a directed graph used to describe the state of resources and processes in a system. It has two kinds of nodes and two kinds of edges:
- Process nodes – drawn as circles ().
- Resource nodes – drawn as rectangles (); each dot inside represents one instance of that resource type.
- Request edge – process has requested an instance of resource .
- Assignment edge – an instance of has been allocated to process .
Deadlock Detection with Single Instance per Resource
When every resource type has exactly one instance, the RAG reduces to a simpler structure and the following rule holds:
A deadlock exists if and only if the resource allocation graph contains a cycle.
(With multiple instances a cycle is only a necessary, not sufficient, condition — but with single instances, a cycle is both necessary and sufficient.) Detection therefore reduces to cycle detection in a directed graph, which can be done with depth-first search.
Example
Consider resources (one instance each) and processes :
- (R1 allocated to P1), (P1 requests R2)
- ,
- ,
Following the edges gives the cycle:
Since a cycle exists and each resource has a single instance, the system is deadlocked: P1 waits for R2 (held by P2), P2 waits for R3 (held by P3), and P3 waits for R1 (held by P1) — a circular wait that can never resolve. If we remove any one request edge (e.g., P3 does not request R1), the cycle breaks and there is no deadlock.
Section B: Short Answer Questions
Attempt any EIGHT questions.
What is RAID? Explain any two RAID levels.
RAID
RAID (Redundant Array of Independent/Inexpensive Disks) is a technology that combines multiple physical disk drives into a single logical unit to improve performance (through parallelism/striping) and/or reliability (through redundancy/mirroring and parity). The OS sees the array as one drive.
Two RAID Levels
RAID 0 (Striping): Data is split into blocks and striped across multiple disks with no redundancy. It gives the best read/write performance and full capacity utilization, but offers no fault tolerance — failure of any single disk loses all data. Minimum 2 disks.
RAID 1 (Mirroring): Identical copies of data are written to two (or more) disks. It provides high reliability (data survives a disk failure) and fast reads, but storage efficiency is only 50% because every block is duplicated. Minimum 2 disks.
(RAID 5 — block-level striping with distributed parity, tolerating one disk failure with only one disk of overhead — is another commonly cited level.)
Explain the directory structure of a file system.
Directory Structure of a File System
A directory is a symbol table that maps file names to their file-control-block / metadata, letting users organize and locate files. The common directory structures are:
-
Single-Level Directory – All files reside in one directory. Simple, but every file must have a unique name and it does not scale for multiple users.
-
Two-Level Directory – Each user has a separate User File Directory (UFD), indexed by a Master File Directory (MFD). Allows same file names for different users, but no grouping within a user and limited file sharing.
-
Tree-Structured Directory – A hierarchy with a root and arbitrarily nested subdirectories. Supports grouping, absolute and relative path names, and is the most widely used structure (e.g., Unix, Windows). Each file/directory has one parent.
-
Acyclic-Graph Directory – Allows directories/files to be shared between users via links (hard/symbolic), forming a graph with no cycles. Enables sharing but complicates deletion (dangling pointers / reference counts).
-
General Graph Directory – Permits links freely, possibly creating cycles. Most flexible but needs cycle detection and garbage collection to manage traversal and deletion safely.
Going from single-level to general-graph increases flexibility (sharing, grouping) at the cost of implementation complexity.
Can deadlock occur in the case of preemptive resources? List the conditions for deadlock.
Can deadlock occur with preemptive (preemptable) resources?
No. A deadlock generally cannot occur if all resources are preemptable. If a resource can be forcibly taken from a process (preempted) and given to another, then the "No Preemption" condition is violated. Since a deadlock requires all four necessary conditions to hold simultaneously, breaking even one — here, no-preemption — makes deadlock impossible. For example, the CPU and main memory (which can be swapped out) are preemptable, so they rarely cause deadlock; deadlocks instead arise with non-preemptable resources such as printers, tape drives, or file locks.
Conditions for Deadlock (Coffman conditions)
All four must hold at the same time:
- Mutual Exclusion – a resource is held in non-sharable mode.
- Hold and Wait – a process holds resources while waiting for others.
- No Preemption – resources are released only voluntarily.
- Circular Wait – a circular chain of processes each waiting on the next.
What is spooling? Explain with an example.
Spooling
Spooling (Simultaneous Peripheral Operations On-Line) is a technique in which data destined for a slow I/O device is temporarily placed in a buffer or queue (the spool, usually on disk) so that the fast CPU/process need not wait for the slow device. A dedicated process (the spooler) then feeds the data to the device at its own pace, decoupling the producer from the consumer.
Benefits: overlaps I/O with computation, allows multiple jobs to share one device, and lets processes "finish" output before the device actually consumes it.
Example – Print Spooling
When several users send documents to a single printer, the OS does not block each process until the printer is free. Instead, each print job is written to a print spool (queue) on disk. The printer daemon/spooler picks jobs from this queue one at a time and sends them to the printer in order. Thus a user's program returns immediately after "printing," the printer is kept busy, and jobs are serialized fairly without conflict. Spooling also avoids deadlock over the printer because the device is only ever accessed by the single spooler process.
What is an operating system? List its main functions.
Operating System
An Operating System (OS) is a system software that acts as an intermediary between the user/application programs and the computer hardware. It manages hardware resources, provides a convenient environment to execute programs, and controls the overall operation of the computer. Examples: Windows, Linux, macOS, Android.
Main Functions of an Operating System
- Process Management – Creating, scheduling, synchronizing, and terminating processes; CPU scheduling and inter-process communication.
- Memory Management – Allocating/deallocating main memory, keeping track of usage, and implementing virtual memory (paging/segmentation).
- File Management – Creating, deleting, organizing, and controlling access to files and directories on storage.
- Device (I/O) Management – Managing device drivers, buffering, caching, and spooling to control I/O devices.
- Storage / Secondary-Storage Management – Disk scheduling, free-space management, and allocation.
- Security and Protection – Authentication, access control, and protecting resources from unauthorized use.
- User Interface – Providing a CLI or GUI for user interaction.
- Resource Allocation & Accounting – Fairly distributing resources among users/programs and tracking usage.
Differentiate between multiprogramming and multitasking.
Multiprogramming vs Multitasking
| Basis | Multiprogramming | Multitasking |
|---|---|---|
| Concept | Keeps several jobs in memory so the CPU is never idle; when one job waits (e.g., for I/O), the CPU switches to another. | An extension of multiprogramming that switches the CPU among tasks so rapidly that a single user can run several tasks (programs) seemingly at once. |
| Objective | Maximize CPU utilization / throughput. | Maximize responsiveness and interactivity for the user. |
| Switching | CPU switches only when the running job leaves the CPU (I/O wait or completion). | CPU switches based on time slices (time-sharing), even if the job has not finished. |
| User interaction | Typically batch, little/no interaction. | Interactive; user gets quick response. |
| Example | Early batch systems running multiple jobs. | Modern desktop OS running a browser, editor, and music player together. |
In short, multiprogramming focuses on keeping the CPU busy, whereas multitasking (time-sharing) focuses on giving each task a fair, frequent share of the CPU for fast response.
Explain the difference between a process and a program.
Process vs Program
A program is a passive entity: a set of instructions stored on disk (an executable file). It does nothing until it is loaded and executed.
A process is an active entity: a program in execution, with an associated program counter, registers, stack, data section, heap, and a Process Control Block (PCB). It is the unit of work in a system.
| Basis | Program | Process |
|---|---|---|
| Nature | Passive (static) | Active (dynamic) |
| Existence | Stored permanently on disk | Exists temporarily in main memory during execution |
| Resources | Holds no system resources | Holds CPU, memory, registers, files, etc. |
| Lifetime | Exists until deleted | Created at execution, dies on termination |
| Instances | One program | One program can spawn many processes |
Thus a process is the runtime instance of a program; running the same program twice creates two distinct processes with separate states.
What is a system call? Explain its types.
System Call
A system call is the programmatic interface through which a user program requests a service from the operating-system kernel. It causes a switch from user mode to kernel mode (a trap), the OS performs the privileged operation, and control returns to the program. System calls are the only legitimate entry points into the kernel and are usually wrapped by library functions (e.g., printf uses the write system call).
Types / Categories of System Calls
- Process Control – create/terminate processes, load/execute, wait, allocate memory. Examples:
fork(),exec(),exit(),wait(). - File Management – create, delete, open, close, read, write files. Examples:
open(),read(),write(),close(). - Device Management – request/release a device, read/write/reposition a device. Examples:
ioctl(),read(),write(). - Information Maintenance – get/set system data such as time, date, attributes. Examples:
getpid(),alarm(),time(). - Communication – create/delete connections, send/receive messages, shared memory. Examples:
pipe(),shmget(),send(),recv(). - Protection – control access to resources, set permissions. Examples:
chmod(),umask(),setuid().
Distinguish between starvation and deadlock.
Starvation vs Deadlock
Deadlock is a situation where a set of processes are permanently blocked, each waiting for a resource held by another in the set, so none can ever proceed. Starvation (indefinite blocking) is a situation where a process waits indefinitely because resources are continually granted to other (e.g., higher-priority) processes, even though it could run if it got the resource.
| Basis | Deadlock | Starvation |
|---|---|---|
| Definition | Circular waiting; processes block each other forever. | A process waits indefinitely due to unfair scheduling/allocation. |
| Progress | No process in the set makes progress. | Other processes do make progress; only the victim is denied. |
| Cause | All four Coffman conditions (esp. circular wait) hold. | Biased resource allocation / priority scheduling (no circular wait needed). |
| Also called | — | Indefinite blocking / lived-lock-free indefinite wait. |
| Resolution | Prevention, avoidance (Banker's), detection & recovery. | Aging (gradually raise the waiting process's priority). |
In short, every deadlock implies the involved processes are starved, but starvation can occur without a deadlock — it is caused by unfair policy, and is typically cured by aging.
Frequently asked questions
- Where can I find the BSc CSIT (TU) Operating System (BSc CSIT, CSC259) question paper 2080?
- The full BSc CSIT (TU) Operating System (BSc CSIT, CSC259) 2080 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
- Does the Operating System (BSc CSIT, CSC259) 2080 paper come with solutions?
- Yes. Every question on this Operating System (BSc CSIT, CSC259) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
- How many marks is the BSc CSIT (TU) Operating System (BSc CSIT, CSC259) 2080 paper?
- The BSc CSIT (TU) Operating System (BSc CSIT, CSC259) 2080 paper carries 60 full marks and is meant to be completed in 180 minutes, across 12 questions.
- Is practising this Operating System (BSc CSIT, CSC259) past paper free?
- Yes — reading and attempting this Operating System (BSc CSIT, CSC259) past paper on Kekkei is completely free.