Operating System Question Bank - Answer Key
Q1 (2 Marks each)
1. List file allocation method and explain any one in detail.
Ans:-
File allocation methods include Contiguous Allocation, Linked Allocation, and Indexed
Allocation.
Contiguous Allocation: In this method, each file occupies a series of consecutive blocks on
the disk. This allows quick access because all file blocks are sequentially located, making it
efficient for sequential access. However, it can lead to fragmentation, where scattered free
spaces make it hard to allocate continuous space for new files.
2. What is meant by CPU scheduling?
Ans:-
CPU Scheduling is the process where the operating system decides which process in the
ready queue should use the CPU next. The aim is to optimize CPU utilization and ensure
fairness among processes by reducing waiting time and maximizing efficiency. Various
algorithms like FCFS, SJF, and Round Robin are used to achieve effective CPU scheduling.
3. Write the difference between pre-emptive and non-pre-emptive scheduling.
Ans:-
Pre-emptive Scheduling: The CPU can be reallocated if a higher-priority process enters the
ready queue, ensuring critical processes get immediate attention.
Non-pre-emptive Scheduling: Once a process starts, it continues until completion or
voluntarily releasing the CPU, simplifying scheduling but potentially increasing wait time
for other processes.
Q2 (4 Marks each)
1. Define following terms: i) Virtual Memory ii) Paging
Ans:-
Virtual Memory: Virtual memory allows the OS to use both RAM and disk storage, creating
an illusion of more memory than physically available. It loads only necessary parts of a
program into RAM, helping run large or multiple programs simultaneously.
Paging: Paging divides memory into fixed-size pages and frames. It allows processes to
occupy non-contiguous memory, reducing fragmentation and simplifying allocation. Pages
are loaded into frames as needed, but a page fault occurs if a page is not in memory.
2. List any four file attributes and its meaning.
Ans:-
Name: Identifies the file within a directory.
Type: Specifies the file format (e.g., .txt, .jpg).
Location: Indicates the physical storage path.
Size: Shows the file’s data capacity in bytes.
3. State and explain any two scheduling criteria.
Ans:-
CPU Utilization: Aims to keep the CPU busy to maximize productivity by minimizing idle
time.
Turnaround Time: Measures the time from process submission to completion, ideally
minimized to improve task processing speed.
4. Define fragmentation. Explain internal and external fragmentation.
Ans:-
Fragmentation: Memory is divided into small, scattered free spaces, limiting efficient
allocation.
Internal Fragmentation: Occurs when fixed memory blocks leave unused space within them.
External Fragmentation: Happens when free memory is scattered, preventing large
contiguous allocations.