QUESTION BANK
What is an operating system?
a) collection of programs that manages hardware resources
b) system service provider to the application programs
c) interface between the hardware and application programs
d) all of the mentioned
In operating system, each process has its own __________
a) address space and global variables b) open files c) pending alarms,
signals and signal handlers d) all of the mentioned
The number of processes completed per unit time is known as __________
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) waiting time b) turnaround time c) response time d)
throughput
In priority scheduling algorithm ____________
a) CPU is allocated to the process with highest priority
b) CPU is allocated to the process with lowest priority
c) Equal priority processes cannot be scheduled
d) None of the mentioned
A binary semaphore is a semaphore with integer values ____________
a) 1
b) -1
c) 0.8
d) 0.5
Consider the following statements with respect to user-level threads and kernel-
supported threads
(i) context switch is faster with kernel-supported threads
(ii) for user-level threads, a system call can block the entire process
(iii) Kernel supported threads can be scheduled independently
(iv) User level threads are transparent to the kernel
Which of the above statements are true?
a)(ii), (iii) and (iv) only b)(ii) and (iii) only c)(i) and (iii) only
d)(i) and (ii) only
What is the formula to find disk access time?
a)Disk Access time=Seek time +Rotational latency +transfer time
b)Disk Access time=Seek time-Rotational latency+ transfer time
c)Disk Access time=Seek time-Rotational latency-transfer time
d)Disk Access time=Seek time+ Rotational latency/transfer time
Process synchronization can be done on __________
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.
Process Burst time
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
To avoid deadlock ____________
a) there must be a fixed number of resources to allocate
b) resource allocation must be done only once
c) all deadlocked processes must be aborted
d) inversion technique can be used
If the wait for graph contains a cycle ____________
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 has 3 processes sharing 4 resources. If each process needs a maximum of 2
units, then
a)Deadlock can never occur b)Deadlock may occur
c)Deadlock has to occur d)None of these
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
Allocation (process-wise : P0 through P4 top TO bottom)
A B C
0 1 0
2 0 0
3 0 2
2 1 1
0 0 2
MAX (process-wise: P0 through P4 top TO bottom)
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 ____________
a) an unsafe state b) a safe state c) a protected state d) a
deadlock
Logical memory is broken into blocks of the same size called _________
a) frames b) pages c) backing store d) none of the mentioned
The __________ is used as an index into the page table.
a) frame bit b) page number c) page offset d) frame offset
A page fault -
a)Occurs when a program accesses an available page on memory
b)is an error in a specific page
c)is a reference to a page belonging to another program
d)occurs when a program accesses a page not currently in memory
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.
Least Recently Used (LRU) page replacement policy is a practical approximation to
optimal page replacement. For the above reference string, how many more page faults
occur with LRU than with the optimal page replacement policy?
a)0 b)1 c)2 d)3
In which one of the following page replacement policies, Belady's anomaly may occur?
a)FIFO b)Optimal c)LRU d)MRU
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?
a)Farthest cylinder next b)Nearest cylinder next
c)First come first served d)Elevator algorithm
Why is one time password safe?
a) It is easy to generated b) It cannot be shared c) It is different for every
access d) It is a complex encrypted password
What is used to protect network from outside internet access?
a) A trusted antivirus b) 24 hours scanning for virus c)
Firewall to separate trusted and untrusted network
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
b) lack of paper in printer
c) connection failure in the network
d) all of the mentioned
In which language UNIX is written?
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
d) a user with special rights
Which character is known as a root directory?
a) ^
b) &
c) &&
d) /
A process can be terminated due to __________
a) normal exit
b) fatal error
c) killed by another process
d) all of the mentioned
The number of processes completed per unit time is known as __________
a) Output
b) Throughput
c) Efficiency
d) Capacity
A semaphore is a shared integer variable __________
a) that can not drop below zero
b) that can not be more than zero
c) that can not drop below one
d) that can not be more than one
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
DMA is used for __________
a) High speed devices(disks and communications network)
b) Low speed devices
c) Utilizing CPU cycles
d) All of the mentioned
Consider the following set of processes, the length of the CPU burst time given in
milliseconds.
Process Burst time
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
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 First Come First Serve
B Non-preemptive Shortest Job First
C Shortest Remaining Time
D Round Robin with Quantum value two
Which of the following statements are true?
i) Shortest remaining time first scheduling may cause starvation
ii) Preemptive scheduling may cause starvation
iii) Round robin is better than FCFS in terms of response time
a) i only
b) i and iii only
c) ii and iii only
d) i, ii and iii
Each process Pi, i = 0,1,2,3,……,9 is coded as follows.
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
d) None of the mentioned
A binary semaphore is a semaphore with integer values ____________
a) 1
b) -1
c) 0.8
d) 0.5
The program follows to use a shared binary semaphore T.
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;
T is set to 0 before either process begins execution and, as before, X is set to 5.
Now, how many different values of X are possible after both processes finish executing?
a) one
b) two
c) three
d) four
A system is in the safe state if ____________
a) the system can allocate resources to each process in some order and still avoid a
deadlock
b) there exist a safe sequence
c) all of the mentioned
d) none of the mentioned
Which one of the following is the deadlock avoidance algorithm?
a) banker’s algorithm
b) round-robin algorithm
c) elevator algorithm
d) karn’s algorithm
The wait-for graph is a deadlock detection algorithm that is applicable when
____________
a) all resources have a single instance
b) all resources have multiple instances
c) all resources have a single 7 multiple instances
d) all of the mentioned
A system has 3 processes sharing 4 resources. If each process needs a maximum of 2
units then, deadlock ____________
a) can never occur
b) may occur
c) has to occur
d) none of the mentioned
What is Address Binding?
a) going to an address in memory
b) locating an address with the help of another address
c) binding two addresses together to form a new address in a different memory space
d) a mapping from one address space to another
With paging there is no ________ fragmentation.
a) internal
b) external
c) either type of
d) none of the mentioned
For 3 page frames, the following is the reference string:
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
How many page faults does the LRU page replacement algorithm produce?
a) 10
b) 15
c) 11
d) 12
Consider the following page reference string.
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
Consider the following page reference string.
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
Consider a disk queue with requests for I/O to blocks on cylinders.
98 183 37 122 14 124 65 67
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.
a) much lesser than
b) comparable to
c) much faster than
d) none of the mentioned
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
D None of the above
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
A I and III only
B II only
C III only
D II and III only
Which of the following requires a device driver ?
A Register
B Cache
C Main memory
D Disk
Because of virtual memory, the memory can be shared among ____________
a) processes
b) threads
c) instructions
d) none of the mentioned
Which of the following statements are correct?
i) Physical separation – in which process use different physical objects like separate
printers
ii) Temporal separation – in which process having different security requirement at
different times
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
For system protection, a process should access _____________
a) all the resources
b) only those resources for which it has authorization
c) few resources but authorization is not required
d) all of the mentioned
The pattern that can be used to identify a virus is known as _____________
a) stealth
b) virus signature
c) armoured
d) multipartite
What is the need of protection?
a) Prevent mischievous violation
b) Prevent and intentional
c) Ensure that each program component uses resources allotted to it only
d) All of the mentioned
Network operating system runs on ___________
a) server
b) every system in the network
c) both server and every system in the network
d) none of the mentioned
Internet provides _______ for remote login.
a) telnet
b) http
c) ftp
d) rpc
In operating system, each process has its own __________
a) open files
b) pending alarms, signals, and signal handlers
c) address space and global variables
d) all of the mentioned
Which of the following scheduling algorithms gives priority to the process with the
smallest execution time?
A) Round Robin
B) Shortest Job Next (SJN)
C) First Come First Serve (FCFS)
D) Priority Scheduling
What is the purpose of the Process Control Block (PCB)?
A) To store the program code.
B) To manage the CPU registers.
C) To store information about a process.
D) To manage the file system.
What is the primary role of the interrupt vector table?
A) To store the addresses of interrupt service routines.
B) To manage memory allocation.
C) To store user-level processes.
D) To handle process scheduling.
What is the role of the 'fork' system call in Unix-like operating systems?
A) To create a new process.
B) To terminate the currently running process.
C) To allocate memory for a new process.
D) To change the ownership of a file.
What is the purpose of a semaphore in process synchronization?
a) To prevent race conditions
b) To implement mutual exclusion
c) To control access to shared resources
d) To allocate memory for processes
What is the difference between preemptive and non-preemptive scheduling algorithms?
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.
c) Preemptive algorithms prioritize processes based on their priority levels, while
non-preemptive algorithms do not.
d) Preemptive algorithms are designed for real-time systems, while non-preemptive
algorithms are 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.
b) Deadlock prevention techniques require processes to request resources in a specific
order, while deadlock avoidance techniques use algorithms to ensure safe resource
allocation.
c) Deadlock prevention techniques involve preemption of resources, while deadlock
avoidance techniques do not.
d) Deadlock prevention techniques require the use of synchronization primitives, while
deadlock avoidance techniques do not.
In a multi-threaded environment, what is the primary advantage of using user-level
threads over kernel-level threads?
a) User-level threads provide better concurrency
b) User-level threads are more lightweight
c) User-level threads have faster context switching
d) User-level threads have direct access to kernel resources
Which one of the following is not true?
a) kernel remains in the memory during the entire computer session
b) kernel is made of various modules which can not be loaded in running operating
system
c) kernel is the first part of the operating system to load into memory during booting
d) kernel is the program that constitutes the central core of the operating system
What is a long-term scheduler?
a) It selects processes which have to be brought into the ready queue
b) It selects processes which have to be executed next and allocates CPU
c) It selects processes which heave to remove from memory by swapping
d) None of the mentioned
Consider the following statements about process state transitions for a system using
preemptive scheduling.
I. A running process can move to ready state.
II. A ready process can move to ready state.
III. A blocked process can move to running state.
IV. A blocked process can move to ready state.
Which of the above statements are TRUE?
a)I, II and III only
b) II and III only
c) I, II and IV only
d) I, II, III and IV
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.
IV. A timer interrupt is raised by the hardware.
Which of the above statements are TRUE?
a) I and II only
b) II and III only
c) II and IV only
d) I, II, III and IV
Consider the following two-process synchronization solution.
Process 0 Process
1
Entry: loop while (turn == 1); Entry: loop while (turn ==
0);
(critical
section) (critical section)
Exit: turn = 1; Exit
turn = 0;
The shared variable turn is initialized to zero. Which one of the following is TRUE?
(A) This is a correct two-process synchronization solution.
(B) This solution violates mutual exclusion requirement.
(C) This solution violates progress requirement.
(D) This solution violates bounded wait requirement.
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;
while (P) do no-op;
Enter critical section, perform actions, then
exit critical section
Flag[i] = false;
Perform other non-critical section actions.
Until false;
For the program to guarantee mutual exclusion, the predicate P in the while loop
should be
A. flag[j] == true and turn == i
B. flag[j] = =true and turn == j
C. flag[i] == true and turn == j
D. flag[i] = =true and turn == i
Consider the two functions incr() and decr() shown below.
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.
suppose there are two implementations of the semaphore s, as follows:
I-1:s is a binary semaphore initialized to 1.
I-2:s is a counting semaphore initialized to 2.
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 counting semaphore S is initialized to 10. Then, 6 P operations and 4 V operations
are performed on S. What is the final value of S?
A. 0
B. 5
C. 8
D. 3
A shared variable x, initialized to zero, is operated on by four concurrent processes
W, X, Y, Z as follows. Each of the processes W and X reads x from memory, increments by
one, stores it to memory and then terminates. Each of the processes Y and Z reads x
from memory, decrements by two, stores it to memory, and then terminates. Each process
before reading x invokes the P operation (i.e. wait) on a counting semaphore S and
invokes the V operation (i.e. signal) on the semaphore S after storing x to memory.
Semaphore S is initialized to two. What is the maximum possible value of x after all
processes complete execution?
Process W Process X Process Y Process Z
Wait(s) Wait(s) Wait(s) Wait(s)
Read (x) Read (x) Read (x) Read (x)
x= x+1; x=x+1; x=x-2; x= x-2;
write (x) write (x) write (x) write (x)
signal (s) Signal(s) Signal(s) Signal (s)
initially, counting semaphore S is initialized with value 2
A. -2
B. -1
C. 1
D. 2
A process executes the following code
for(i=0; i<n; i++)
fork();
The total number of child processes created is
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);
How many times will P0 print ‘0’?
a) At least twice
b) Exactly twice
c) Exactly thrice
d) Exactly once
A counting semaphore S is initialized to 7. Then, 20 P operations and 15 V operations
are performed on S. What is the final value of S?
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?
Process. No Arrival Time Burst Time
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
_________ .
(A) 5.0 (B) 5.25 (C) 5.50 (D) 5.75
Consider the set of 6 processes whose arrival time and burst time are given below -
Process Id Arrival time Burst time
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.
A. 10.84 unit and 7.33 unit
B. 11.23 unit and 8.21 unit
C. 9.8 unit and 7.14 unit
D. 10. 34 unit and 8.44 unit
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.
A. 15 unit B) 12 unit C) 16 unit D) 14 unit
Consider the set of 5 processes whose arrival time and burst time are given below-
Process Id Arrival time Burst time Priority
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)
A. 7.6 unit and 4.6 unit
B. 8.6 unit and 5.7 unit
C. 7.2 unit and 4.0 unit
D. 8.4 unit and 4.1 unit