QUESTION BANK
QUESTION BANK
a) Output
b) Throughput
c) Efficiency
d) Capacity
To access the services of the operating system, the interface is provided by the
___________
a) Library
b) System calls
c) Assembly instructions
d) API
When a process is in a “Blocked” state waiting for some I/O service. When the service
is completed, it goes to the __________
a) Terminated state
b) Suspended state
c) Running state
d) Ready state
The interval from the time of submission of a process to the time of completion is
termed as ____________
a) 1
b) -1
c) 0.8
d) 0.5
Consider the following statements with respect to user-level threads and kernel-
supported threads
(ii) for user-level threads, a system call can block the entire process
a)(ii), (iii) and (iv) only b)(ii) and (iii) only c)(i) and (iii) only
a) hardware level b) software level c) both hardware and software level d) none of
the mentioned
Consider the following set of processes, the length of the CPU burst time given in
milliseconds.
P1 6
P2 8
P3 7
P4 3
Assuming the above process being scheduled with the SJF scheduling algorithm.
a) The waiting time for process P1 is 3ms b) The waiting time for process P1 is 0ms
c) The waiting time for process P1 is 16ms d) The waiting time for process P1 is 9ms
a) then a deadlock does not exist b) then a deadlock exists c) then the system is in
a safe state d) either deadlock exists or system is in a safe state
A system with 5 processes P0 through P4 and three resource types A, B, C have A with 10
instances, B with 5 instances, and C with 7 instances. At time T0, the following
snapshot has been taken:
Process
P0
P1
P2
P3
P4
A B C
0 1 0
2 0 0
3 0 2
2 1 1
0 0 2
A B C
7 5 3
3 2 2
9 0 2
2 2 2
4 3 3
Available
A B C
3 3 2
The sequence <P1, P3, P4, P2, P0> leads the system to ____________
Logical memory is broken into blocks of the same size called _________
A page fault -
A process has been allocated 3-page frames. Assume that none of the pages of the
process are available in the memory initially. The process makes the following sequence
of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1.
In which one of the following page replacement policies, Belady's anomaly may occur?
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time, the disk arm is
at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90,
100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for
scheduling the disk access, the request for cylinder 90 is serviced after servicing
____________ number of requests.
a)2 b)3 c) 4 d) 5
Which of the following disk scheduling strategies is likely to give the best
throughput?
d) Deny users access to websites which can potentially cause security leak
Which one of the following error will be handle by the operating system?
a) power failure
a) JAVA
b) Python
c) C++
d) C
Which part of the UNIX operating system interacts with the hardware?
a) Kernel
b) Shell
c) vi editor
d) application program
What is a superuser?
a) system manager
b) normal user
c) administrator
a) ^
b) &
c) &&
d) /
a) normal exit
b) fatal error
a) Output
b) Throughput
c) Efficiency
d) Capacity
The child process completes execution, but the parent keeps executing, then the child
process is known as __________
a) Orphan
b) Zombie
c) Body
d) Dead
Consider the following set of processes, the length of the CPU burst time given in
milliseconds.
P1 6
P2 8
P3 7
P4 3
Assuming the above process being scheduled with the SJF scheduling algorithm.
Consider the following set of processes, with arrival times and the required CPU-burst
times given in milliseconds.
What is the sequence in which the processes are completed? Assume round robin
scheduling with a time quantum of 2 milliseconds?
A P1, P2, P3
B P2, P1, P3
C P3, P2, P1
D P2, P3, P1
For the processes listed in the following table, which of the following scheduling
schemes will give the lowest average turnaround time?
a) i only
b) i and iii only
d) i, ii and iii
repeat
P(mutex)
{Critical Section}
V(mutex)
forever
The code for P10 is identical except that it uses V(mutex) instead of P(mutex). What is
the largest number of processes that can be inside the critical section at any moment
(the mutex being initialized to 1)?
a) 1
b) 2
c) 3
a) 1
b) -1
c) 0.8
d) 0.5
Process A
int Y;
A1: Y = X*2;
A2: X = Y;
signal(T);
Process B
int Z;
B1: wait(T);
B2: Z = X+1;
X = Z;
Now, how many different values of X are possible after both processes finish executing?
a) one
b) two
c) three
d) four
a) the system can allocate resources to each process in some order and still avoid a
deadlock
a) banker’s algorithm
b) round-robin algorithm
c) elevator algorithm
d) karn’s algorithm
b) may occur
c) has to occur
c) binding two addresses together to form a new address in a different memory space
a) internal
b) external
c) either type of
How many page faults does the LRU page replacement algorithm produce?
a) 10
b) 15
c) 11
d) 12
1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
For LRU page replacement algorithm with 4 frames, the number of page faults is?
a) 10
b) 14
c) 8
d) 11
1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
For FIFO page replacement algorithms with 4 frames, the number of page faults is?
a) 16
b) 15
c) 14
d) 11
Considering SSTF (shortest seek time first) scheduling, the total number of head
movements is, if the disk head is initially at 53 is?
a) 224
b) 236
c) 245
d) 240
In the ______ algorithm, the disk arm starts at one end of the disk and moves toward
the other end, servicing requests till the other end of the disk. At the other end, the
direction is reversed and servicing continues.
a) LOOK
b) SCAN
c) C-SCAN
d) C-LOOK
Magnetic tape drives can write data at a speed ________ disk drives.
b) comparable to
Disk requests come to a disk driver for cylinders in the order 10, 22, 20, 2, 40, 6 and
38 at a time when the disk drive is reading from cylinder 20. The seek time is 6
ms/cylinder. The total seek time, if the disk arm scheduling algorithms is first-come-
first-served is
A 360
B 850
C 900
In a file allocation system, which of the following allocation schemes(s) can be used
if no external fragmentation is allowed?
I. Contiguous
II. Linked
III. Indexed
B II only
C III only
A Register
B Cache
C Main memory
D Disk
a) processes
b) threads
c) instructions
i) Physical separation – in which process use different physical objects like separate
printers
iii) Physical separation – In which users operate under illusion that no other
processes exist
iv) Temporal separation – In which processes conceal their data and computations
a) i
b) i and ii
c) ii and iii
d) iii and iv
a) stealth
b) virus signature
c) armoured
d) multipartite
a) server
a) telnet
b) http
c) ftp
d) rpc
a) open files
Which of the following scheduling algorithms gives priority to the process with the
smallest execution time?
A) Round Robin
D) Priority Scheduling
What is the purpose of the Process Control Block (PCB)?
What is the role of the 'fork' system call in Unix-like operating systems?
a) Preemptive algorithms allow a process to voluntarily give up the CPU, while non-
preemptive algorithms do not.
b) Preemptive algorithms allow the CPU to be taken away from a process, while non-
preemptive algorithms do not.
What is the difference between deadlock prevention and deadlock avoidance techniques?
a) Deadlock prevention techniques aim to detect and recover from deadlocks, while
deadlock avoidance techniques aim to prevent deadlocks from occurring altogether.
Consider the following statements about process state transitions for a system using
preemptive scheduling.
Consider a process P currently running on a CPU. Identify which of the following events
will invariably necessitate a context switch by the operating system, causing process P
to transition to a non-running state (such as ready or blocked):
I. P makes a blocking system call to read a block of data from the disk.
II. P tries to access a page that is in the swap space, resulting in a page fault.
III. An interrupt is raised by the disk to deliver data requested by some other
process.
a) I and II only
b) II and III only
c) II and IV only
d) I, II, III and IV
Process 0 Process
1
(critical
section) (critical section)
The shared variable turn is initialized to zero. Which one of the following is TRUE?
Consider Peterson's algorithm for mutual exclusion between two concurrent processes i
and j. The program executed by process is shown below.
repeat
flag[i] = true;
turn = j;
Flag[i] = false;
Until false;
For the program to guarantee mutual exclusion, the predicate P in the while loop
should be
incr() decr()
{
{
wait(s); w
ait(s);
X = X+1; X
= X-1;
signal(s); si
gnal(s);
}
}
There are 5 threads each invoking incr once, and 3 threads each invoking decr once, on
the same shared variable X. The initial value of X is 10.
Let V1, V2 be the values of X at the end of execution of all the threads with
implementations I-1, I-2, respectively.
Which one of the following choices corresponds to the minimum possible values of V1,
V2, respectively?
A. 15,7
B. 7,7
C. 12,7
D. 12,8
A. 0
B. 5
C. 8
D. 3
A. -2
B. -1
C. 1
D. 2
fork();
A. 2
B. 2n
C. 2n
D. 2n-1
The following program consists of 3 concurrent processes and 3 binary semaphores. The
semaphores are initialized as S0 = 1, S1 = 0, S2 = 0.
Process P0
while(true)
wait(S0);
print '0';
release(S1);
release(S2);
}
Process P1
wait(S1);
release(S0);
Process P2
wait(S2);
release(S0);
A. 5
B. 2
C. 6
D. 3
Consider the following table of arrival time and the burst time for the five processes
P0, P1, P2, P3, P4, P5. What is the average waiting time for the five processes?
P0 0 14
P1 1 3
P2 2 1
P3 3 2
P4 4 5
A) 15 unit
B) 12 unit
C) 18 unit
D) 13 unit
Consider the following set of processes, assumed to have arrived at time 0. Consider
the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR,
assume that the processes are scheduled in the order P1, P2, P3, P4.
If the time quantum for RR is 4 ms, then the absolute value of the difference between
the average turnaround times (in ms) of SJF and RR (round off to 2 decimal places) is
_________ .
Consider the set of 6 processes whose arrival time and burst time are given below -
P1 0 4
P2 1 5
P3 2 2
P4 3 1
P5 4 6
P6 6 3
If the CPU scheduling policy is Round Robin with time quantum = 2, calculate the
average waiting time and average turnaround time.
Consider the set of 4 processes whose arrival time and burst time are given
below-
Process Id Arrival time Burst time
P1 0 20
P2 15 25
P3 30 10
P4 45 15
If the CPU scheduling policy is SRTF, calculate the waiting time of process P2.
Consider the set of 5 processes whose arrival time and burst time are given below-
P1 0 4 2
P2 1 3 3
P3 2 1 4
P4 3 5 5
P5 4 2 5
If the CPU scheduling policy is priority preemptive, calculate the average waiting time
and average turn around time. (Higher number represents higher priority)