Sample Questions – Operating Systems
Q1) Consider the following set of process with burst time given below;
Process Burst Time(ms) Arrival Time Priority
A 10 0 3
B 4 1 1
C 7 2 2
D 2 3 4
E 5 4 1
Draw Gantt charts and calculate the average waiting time and turnaround time for the
above processes using;
a) FCFS scheduling
b) SJF (Preemptive) scheduling
c) Priority with non-preemptive scheduling
d) Round Robin with time quantum 3ms.
Q2) Map the following logical memory to physical memory using the page table given below;
Page size = 4Bytes and Physical Memory = 32Bytes.
0 A0
- --
3 A3
4 B0
- --
7 B3 0 4
8 C0 1 2
2 6
- -- 3 1
Page Table
11 C3
12 D0
- --
15 D3
Logical Memory
b) Given memory partitions of 120K, 600K, 50K, 300K, 250K and 700K (in Order) needs to
map 112K, 520K, 225K, 30K, 426K and 155K (in Order). Using First Fit, Best Fit and Worst Fit
algorithms and find the most efficient method of memory allocation.
Q3) Consider the following file directories to be allocated on a Hard Disk with 32 Blocks(0-
31) and map using following methods;
1) Contiguous allocation
File Name Start Block Length
A 2 3
B 10 4
C 20 2
2) Link List
File Name Start Block End Block Link List
P 0 3 4, 16, 3
Q 9 26 8, 1, 9, 18
R 15 30 19, 23, 17, 7, 30
3) Indexed Allocation
File Name Index Block Link List
X 31 28, 25, 29, 22
Q4) Draw a Resource allocation graph for the following processes and check for a possibility
of a deadlock where all resource types have only one instance.
1) Process P0 holds R0 and waits for R1
2) Process P1 holds nothing but waits for R2
3) Process P2 holds nothing but waits for R1
4) Process P3 holds R3 and waits for R1 and R2
5) Process P4 holds R2 and waits for R4
6) Process P5 holds R1 and R5
7) Process P6 holds R4 and waits for R3
b) The head of a moving hard disk with 200 tracks (0-199) is currently positioned over track
75 and moving towards the track 76. The requested tracks in the order received are 85, 125,
15, 195, 36, 40, 105, 60 and 120. Calculate the average seek length for following disk
scheduling algorithms.
1) First Come First Serve (FCFS)
2) Shortest Seek Time First (SSTF)
3) SCAN