0% found this document useful (0 votes)
124 views218 pages

1000 MEQs - PDF 2 Operating Systems

Round robin algorithm falls under the category of preemptive algorithms and assigns each process a small unit of CPU time called a time slice.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views218 pages

1000 MEQs - PDF 2 Operating Systems

Round robin algorithm falls under the category of preemptive algorithms and assigns each process a small unit of CPU time called a time slice.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 218

GATE NoteBook

Target JRF - UGC NET Computer Science Paper 2

1000 MEQs
50 Qs on SYSTEM SOFTWARE AND
OPERATING SYSTEM
Most Expected Questions Course
SYSTEM SOFTWARE

101. In an absolute loading scheme, which loader function is


accomplished by programmer?
(A) Linking
(B) Allocation
(C) Both (a) and (b)
(D) Reallocation
SYSTEM SOFTWARE

101. In an absolute loading scheme, which loader function is


accomplished by programmer?
(A) Linking
(B) Allocation
(C) Both (a) and (b)
(D) Reallocation
What is absolute loading scheme?
• The absolute loader relocated object files are created, loader accepts these files and
places them at a specified location in the memory.
• In this scheme, the programmer or assembler should have knowledge of memory
management.

Disadvantages Of Absolute Loader


Programmer must :-
1. specify where the program is to be loaded in memory.
2. remember absolute address of each subroutine.
3. use this address of subroutine linkage.
4. be careful not to give two subroutines with same address.
Linking :-
process of collecting and maintaining piece of code and data
into a single file.
SYSTEM SOFTWARE

102. Specialized program that allows user to utilize in specific


application is classified as

(A) relative programs


(B) application programs
(C) specific programs
(D) replicate programs
SYSTEM SOFTWARE

102. Specialized program that allows user to utilize in specific


application is classified as

(A) relative programs


(B) application programs
(C) specific programs
(D) replicate programs
SYSTEM SOFTWARE
103. Translator for low level programming language were termed as
(A) Assembler
(B) Compiler
(C) Linker
(D) Loader

1. A and C 2. Only B 3. Only A


4. B and D 5. B and C
SYSTEM SOFTWARE
103. Translator for low level programming language were termed as
(A) Assembler
(B) Compiler
(C) Linker
(D) Loader

1. A and C 2. Only B 3. Only A


4. B and D 5. B and C
LINKER LOADER COMPILER ASSEMBLER
main objective is to converts the source code written
The main function is to converts the assembly code into
executable files to main by the programmer to a machine
generate executable files. the machine code.
memory. level language.

It takes input of object code


takes input of executable input source code. input assembly language code.
generated by
files generated by linker.
compiler/assembler.
It converts the whole code into
Assembler can’t do this at once.
Linking - process of Loading - process of loading machine language at a time.
combining various pieces of executable codes to main
codes and source code to memory for further more intelligent less intelligent than a Compiler.
obtain executable code. execution.
The compilation phases are
3 types: Absolute loading,
2 types: Linkage Editor and lexical analyzer, syntax analyzer, Assembler makes two phases
Relocatable loading and
Dynamic Linker. semantic analyzer, intermediate over the given input, first phase
Dynamic run-time loading.
code generated, a code optimizer, and the second phase.
code generator, and error handler
It helps in allocating the
Used to combine all object
address to executable
modules. The output of compiler is a
codes/files. The output of assembler is
mnemonic version of machine
binary code.
responsible for arranging responsible for adjusting code.
objects in program’s references which are used
address space. within the program. C, C++, Java, and C# are examples. GAS, GNU is an example.
SYSTEM SOFTWARE

104. The translator which perform macro expansion is called a


(A) Macro processor
(B) Macro pre-processor
(C) Micro pre-processor
(D) Assembler
SYSTEM SOFTWARE

104. The translator which perform macro expansion is called a


(A) Macro processor
(B) Macro pre-processor
(C) Micro pre-processor
(D) Assembler
SYSTEM SOFTWARE

105. Which of the following system software resides in main


memory always ?
a) Text editor
b) Assembler
c) Linker
d) Loader
SYSTEM SOFTWARE

105. Which of the following system software resides in main


memory always ?
a) Text editor
b) Assembler
c) Linker
d) Loader
SYSTEM SOFTWARE

106. What is boot strapping ?


a) A language interpreting other language program
b) A language compiling other language program
c) A language compile itself
d) All of above
SYSTEM SOFTWARE

106. What is boot strapping ?


a) A language interpreting other language program
b) A language compiling other language program
c) A language compile itself
d) All of above
SYSTEM SOFTWARE
107. Match the following :-
List I (Terminologies) List II (Features)
a) Keyword 1. set of rules to create instructions
b) Mnemonics 2. predefined words using symbols
c) Syntax 3. set of predefined words

A. a)-1, b)-2, c)-3


B. a)-1, b)-3, c)-2
C. a)-3, b)-2, c)-1
D. a)-2, b)-3, c)-1
SYSTEM SOFTWARE
107. Match the following :-
List I (Terminologies) List II (Features)
a) Keyword 1. set of rules to create instructions
b) Mnemonics 2. predefined words using symbols
c) Syntax 3. set of predefined words

A. a)-1, b)-2, c)-3


B. a)-1, b)-3, c)-2
C. a)-3, b)-2, c)-1
D. a)-2, b)-3, c)-1
SYSTEM SOFTWARE
108. Match the following :-
List I (Computer Languages) List II (Features)
a) Low level 1. Similar to human language
b) Middle level 2. Uses binary numbers
c) High level 3. Uses mnemonics

A. a)-1, b)-2, c)-3


B. a)-1, b)-3, c)-2
C. a)-3, b)-2, c)-1
D. a)-2, b)-3, c)-1
SYSTEM SOFTWARE
108. Match the following :-
List I (Computer Languages) List II (Features)
a) Low level 1. Similar to human language
b) Middle level 2. Uses binary numbers
c) High level 3. Uses mnemonics

A. a)-1, b)-2, c)-3


B. a)-1, b)-3, c)-2
C. a)-3, b)-2, c)-1
D. a)-2, b)-3, c)-1
LOW LEVEL LANGUAGE HIGH LEVEL LANGUAGE
Machine Language Similar to human language
Only language understood by the computer understood by the users
Contains only two symbols 1 & 0 has a set of grammar rules used to make
Binary language instructions more easily.
has a set of predefined words known as
Keywords.
MIDDLE LEVEL LANGUAGE
Has a set of rules known as Syntax to create
Assembly Language
instructions.
Uses mnemonics to create instructions
use Compiler or interpreter to convert high-
Mnemonics : using symbols such as letters,
level language to low-level language.
digits and special characters
Examples - FORTRAN,C, C++, JAVA, Python, etc.
use predefined words called mnemonics
use a translator called Assembler to
translate mnemonics into machine language.
computer cannot understand middle-level
language, so it needs to be translated into a
low-level language to make it understandable
by the computer.
OPERATING SYSTEM
109. An algorithm resides under the category of Preemptive
Algorithms and the time slice should be the minimum that is
assigned to a specific task that needs to be processed, though it may
vary for different operating systems.

1. Round robin
2. Shortest job first
3. Latest job first

a) 1 and 2 b) only 2 c) 2 and 3


d) Only 1 e) only 3
OPERATING SYSTEM
109. An algorithm resides under the category of Preemptive
Algorithms and the time slice should be the minimum that is
assigned to a specific task that needs to be processed, though it may
vary for different operating systems.

1. Round robin
2. Shortest job first
3. Latest job first

a) 1 and 2 b) only 2 c) 2 and 3


d) Only 1 e) only 3
OPERATING SYSTEM

109. Which access is based on the disk model of a file since


disk allows random access to any file block ?

a) Sequence access
b) Direct access
c) Both a) and b)
d) None of these
OPERATING SYSTEM

109. Which access is based on the disk model of a file since


disk allows random access to any file block ?

a) Sequence access
b) Direct access
c) Both a) and b)
d) None of these
OPERATING SYSTEM

110. Point out the CORRECT option according to sequence access.


a) It is the simplest access method.
b) Information in the file is processed in order
c) Follows the pattern one record after the other, then
backtracking.
d) Both a) and c) are CORRECT
e) Both a) and b) CORRECT
OPERATING SYSTEM

110. Point out the CORRECT option according to sequence access.


a) It is the simplest access method.
b) Information in the file is processed in order
c) Follows the pattern one record after the other, then
backtracking.
d) Both a) and c) are CORRECT
e) Both a) and b) CORRECT
FILE ACCESS METHODS
Sequential Access –
It is the simplest access method. Information in the file is processed in order, one record
after the other.

Direct Access –
Another method is direct access method also known as relative access method.
• Allows the program to read and write record rapidly , in no particular order.
• The direct access is based on the disk model of a file since disk allows random access to
any file block.
OPERATING SYSTEM

111. In Index sequential method , which is the first step to find a


record in the file ?
a) search the index
b) access the file through pointer
c) Search the pointer
d) Access the file through index
e) Either a) or c)
OPERATING SYSTEM

111. In Index sequential method , which is the first step to find a


record in the file ?
a) search the index
b) access the file through pointer
c) Search the pointer
d) Access the file through index
e) Either a) or c)
OPERATING SYSTEM

112. An index in the back of a book, contains the pointer to the


various blocks.
It is an example of :-
a) Sequence access
b) Direct access
c) Both a) and b)
d) None of these
OPERATING SYSTEM

112. An index in the back of a book, contains the pointer to the


various blocks.
Index sequential method
It is an example of :-
a) Sequence access
b) Direct access
c) Both a) and b)
d) None of these
OPERATING SYSTEM

113. Using a larger block size in a fixed block size file system leads to :
1. better disk throughput
2. poorer disk space utilization
3. reduced disk throughput
4. Better disk space utilization

a) 1 and 4
b) 2 and 3
c) 1 and 2
d) 3 and 4
OPERATING SYSTEM

113. Using a larger block size in a fixed block size file system leads to :
1. better disk throughput
2. poorer disk space utilization
3. reduced disk throughput
4. Better disk space utilization

a) 1 and 4 A larger block size guarantees that more data from a


b) 2 and 3 single file can be written or read at a time into a single
block without having to move the disk ́s head to another
c) 1 and 2 spot on the disk.
d) 3 and 4 The less time you spend moving your heads across the
disk, the more continuous reads/writes per second.
OPERATING SYSTEM

115. A file system with 300 GByte uses a file descriptor with 8 direct block address. 1
indirect block address and 1 doubly indirect block address. The size of each disk block is
128 Bytes and the size of each disk block address is 8 Bytes. The maximum possible file
size in this file system is

(A) 3 Kbytes
(B) 35 Kbytes
(C) 280 Bytes
(D) Dependent on the size of the disk
OPERATING SYSTEM
115. A file system with 300 GByte uses a file descriptor with 8 direct block address. 1 indirect block
address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the size of
each disk block address is 8 Bytes. The maximum possible file size in this file system is
(A) 3 Kbytes
(B) 35 Kbytes
(C) 280 Bytes
(D) Dependent on the size of the disk

Answer (B)
Total number of possible addresses stored in a disk block = 128/8 = 16
Maximum number of addressable bytes due to direct address block = 8*128
Maximum number of addressable bytes due to 1 single indirect address block = 16*128
Maximum number of addressable bytes due to 1 double indirect address block = 16*16*128
The maximum possible file size = 8*128 + 16*128 + 16*16*128 = 35KB
OPERATING SYSTEM

116. A Unix-style i-node has 10 direct pointers and one single, one double and one triple
indirect pointers. Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit
integers are used. What is the maximum possible file size ?
(A) 224 bytes
(B) 232 bytes
(C) 234 bytes
(D) 248 bytes
A Unix-style i-node has 10 direct pointers and one single, one double and one triple indirect
pointers. Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit integers are used. What
is the maximum possible file size ?
(A) 224 bytes
(B) 232 bytes Size of Disk Block = 1Kbyte
(C) 234 bytes Disk Blocks address = 32bits,
(D) 248 bytes
but 48 bit integers are used for address
Therefore address size = 6 bytes
No of addresses per block =
A Unix-style i-node has 10 direct pointers and one single, one double and one triple indirect
pointers. Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit integers are used. What
is the maximum possible file size ?
(A) 224 bytes
(B) 232 bytes Size of Disk Block = 1Kbyte
(C) 234 bytes Disk Blocks address = 32bits,
(D) 248 bytes but 48 bit integers are used for address
Therefore address size = 6 bytes
No of addresses per block = 1024/6 =
170.66
Therefore 170 ≈ 2^8 addresses per block
can be stored
A Unix-style i-node has 10 direct pointers and one single, one double and one triple indirect
pointers. Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit integers are used. What
is the maximum possible file size ?
(A) 224 bytes
(B) 232 bytes Size of Disk Block = 1Kbyte
(C) 234 bytes Disk Blocks address = 32bits,
(D) 248 bytes but 48 bit integers are used for address
Therefore address size = 6 bytes
No of addresses per block = 1024/6 = 170.66
Therefore 170 ≈ 2^8 addresses per block can be stored
Maximum File Size = 10 Direct + 1 Single Indirect + 1
Double Indirect + 1 Triple Indirect
A Unix-style i-node has 10 direct pointers and one single, one double and one triple
indirect pointers. Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit
integers are used. What is the maximum possible file size ?
(A) 224 bytes
Size of Disk Block = 1Kbyte
(B) 232 bytes
Disk Blocks address = 32bits,
(C) 234 bytes
but 48 bit integers are used for address
(D) 248 bytes Therefore address size = 6 bytes
No of addresses per block = 1024/6 = 170.66
Therefore 170 ≈ 2^8 addresses per block can be stored
Maximum File Size = 10 Direct + 1 Single Indirect + 1
Double Indirect + 1 Triple Indirect
= 10 + 28 + 28*28 + 28*28*28 ≈ 224
A Unix-style i-node has 10 direct pointers and one single, one double and one triple
indirect pointers. Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit
integers are used. What is the maximum possible file size ?
(A) 224 bytes Size of Disk Block = 1Kbyte

(B) 232 bytes Disk Blocks address = 32bits,


but 48 bit integers are used for address
(C) 234 bytes
Therefore address size = 6 bytes
(D) 248 bytes No of addresses per block = 1024/6 = 170.66
Therefore 170 ≈ 2^8 addresses per block can be stored
Maximum File Size = 10 Direct + 1 Single Indirect + 1
Double Indirect + 1 Triple Indirect
= 10 + 28 + 28*28 + 28*28*28 ≈ 224
Blocks Since each block is of size 210
Maximum files size = 224 * 210 = 234
OPERATING SYSTEM

117. Consider a disk pack with the following specifications- 16 surfaces, 128
tracks per surface, 256 sectors per track and 512 bytes per sector.
What is the capacity of disk pack?
A. 256 MB
B. 152 MB
C. 128 MB
D. 64 MB
Consider a disk pack with the following
Given- specifications- 16 surfaces, 128 tracks per
Number of surfaces = 16 surface, 256 sectors per track and 512
Number of tracks per surface = 128 bytes per sector.
Number of sectors per track = 256 What is the capacity of disk pack?
Number of bytes per sector = 512 bytes

Capacity of disk pack


= Total number of surfaces x Number of
tracks per surface x Number of sectors per
track x Number of bytes per sector
= 16 x 128 x 256 x 512 bytes
= 228 bytes
= 256 MB
OPERATING SYSTEM

118. Consider a typical disk that rotates at 15000 RPM and has a transfer rate of 50 x
106 bytes/sec. If the average seek time of the disk is twice the average rotational delay
and the controller’s transfer time is 10 times the disk transfer time. What is the
average time (in milliseconds) to read or write a 512 byte sector of the disk?
A.8.09
B. 6.11
C. 9.23
D. NONE
Given- Average seek time
Rotation speed of the disk = 15000 RPM = 2 x Average rotational delay
Transfer rate = 50 x 106 bytes/sec = 2 x 2 msec
Average seek time = 2 x Average rotational delay = 4 msec
Controller’s transfer time = 10 x Disk transfer
time Disk transfer time
= Time taken to read or write 512 bytes
Time taken for one full rotation = 512 bytes / (50 x 106 bytes/sec)
= (60 / 15000) sec = 0.004 sec = 4 msec = 10.24 x 10-6 sec
= 0.01024 msec
Average rotational delay
= 1/2 x Time taken for one full rotation Controller’s transfer time
= 1/2 x 4 msec = 2 msec = 10 x Disk transfer time
= 10 x 0.01024 msec
= 0.1024 msec

Average time to read or write 512 bytes


= Average seek time + Average rotational delay + Disk
transfer time + Controller’s transfer time + Queuing delay
= 4 msec + 2 msec + 0.01024 msec + 0.1024 msec + 0
= 6.11 msec
119. Consider a system which has a CPU bound process, which requires the burst time of
21 seconds. The multilevel Feed Back Queue scheduling algorithm is used and the queue
time quantum ‘2’ seconds and in each level it is incremented by ‘2’ seconds.Then how
many times the process will be interrupted and on which queue the process will terminate
the execution?

A. 10 , QUEUE 10
B. 9 , QUEUE 11
C. 10 , QUEUE , 11
D. NONE
Consider a system which has a CPU bound process, which requires the burst time of 21
seconds. The multilevel Feed Back Queue scheduling algorithm is used and the queue
time quantum ‘2’ seconds and in each level it is incremented by ‘2’ seconds.Then how
many times the process will be interrupted and on which queue the process will terminate
the execution?

Process P needs 21 Seconds for total execution.


At Queue 1 it is executed for 2 seconds and then interrupted and shifted to queue 2.
At Queue 2 it is executed for 4 seconds and then interrupted and shifted to queue 3.
At Queue 3 it is executed for 6 seconds and then interrupted and shifted to queue 4.
At Queue 4 it is executed for 8 seconds and then interrupted and shifted to queue 5.
At Queue 5 it executes for 10 seconds and then it interrupted and shifted to queue 6
At Queue 6 it executes for 12 seconds and then it interrupted and shifted to queue 7.
At Queue 6 it executes for 14 seconds and then it interrupted and shifted to queue 8.
At Queue 6 it executes for 16 seconds and then it interrupted and shifted to queue 9.
At Queue 6 it executes for 18 seconds and then it interrupted and shifted to queue 10.
At Queue 6 it executes for 20 seconds and then it interrupted and shifted to queue 11.
At Queue 6 it executes for 1 seconds and then it completes.
120. Which CPU Scheduling Algorithm is Preemptive ?

a. Multilevel Queue Scheduling


b. Multilevel feedback queue scheduling
c. Highest Response Ratio Next
d. Priority
120. Which CPU Scheduling Algorithm is Preemptive ?

a. Multilevel Queue Scheduling


b. Multilevel feedback queue scheduling
c. Highest Response Ratio Next
d. Priority
121. Find Output :
1.#include<stdio.h>
2.#include<unistd.h>
a) it will print “0”
3.
4.int main()
b) it will print the PID of the child process
5.{ c) it will print “0” & the PID of the child process
6.pid_t child; d) none of the mentioned
7.child = fork();
8.printf("%d\n",child);
9.return 0;
10.}
a) it will print “0”
1.#include<stdio.h> b) it will print the PID of the child process
2.#include<unistd.h>
c) it will print “0” & the PID of the child process
3.
4.int main()
d) none of the mentioned
5.{
6.pid_t child;
7.child = fork();
8.printf("%d\n",child);
9.return 0;
10.}

The “fork” system call returns the PID of the


child process when it is executed by the parent
process and returns 0 when it is executed by
the child process.
122. For the processes listed in the
following table, What is the average
waiting time for SRTF ?
A. 9.25
B. 2.5
C. 9.08
D. 8.25

PROCESS ARRIVAL PROCESSING


TIME TIME
A 0 3
B 1 6
C 4 4
D 6 2
122. For the processes listed in the
following table, What is the average
waiting time for SRTF ?
A. 9.25
B. 2.5
C. 9.08
D. 8.25

PROCESS ARRIVAL PROCESSING


TIME TIME
A 0 3
B 1 6
C 4 4
D 6 2
123. Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths
submitted at the same time to a computer system. Which one of the following process
scheduling algorithms would minimize the average waiting time in the ready queue?

(A) Shortest remaining time first


(B) Round-robin with time quantum less than the shortest CPU burst
(C) Uniform random
(D) Highest priority first with priority proportional to CPU burst length
Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths
submitted at the same time to a computer system. Which one of the following process
scheduling algorithms would minimize the average waiting time in the ready queue?

(A) Shortest remaining time first


(B) Round-robin with time quantum less than the shortest CPU burst
(C) Uniform random
(D) Highest priority first with priority proportional to CPU burst length
As we know, in all CPU Scheduling algorithms, shortest job first is optimal
i.ie. it gives minimum turn round time, minimum average waiting time and
high throughput and the most important thing is that shortest remaining
time first is the pre-emptive version of shortest job first. shortest remaining
time first scheduling algorithm may lead to starvation because If the short
processes are added to the cpu scheduler continuously then the currently
running process will never be able to execute as they will get pre-empted but
here all the processes are arrived at same time so there will be no issue such
as starvation.
124. Calculate the exponential averaging with T1 = 10, α = 0.5 and the algorithm is SJF with
previous runs as 8, 7, 4, 16.
(a) 9
(b) 8
(c) 7.5
(d) None
Calculate the exponential averaging with T1 = 10, α = 0.5
and the algorithm is SJF with previous runs as 8, 7, 4, 16.
(a) 9
(b) 8
(c) 7.5
(d) None

Initially T1 = 10 and α = 0.5 and the run times given are 8, 7,


4, 16 as it is shortest job first,
So the possible order in which these processes would serve
will be 4, 7, 8, 16 since SJF is a non-preemptive technique.
So, using formula: T2 = α*t1 + (1-α)T1
so we have,
T2 = 0.5*4 + 0.5*10 = 7, here t1 = 4 and T1 = 10
T3 = 0.5*7 + 0.5*7 = 7, here t2 = 7 and T2 = 7
T4 = 0.5*8 + 0.5*7 = 7.5, here t3 = 8 and T3 = 7
So the future prediction for 4th process will be T4 = 7.5
which is the option(c).
Based on Exponential Averaging-

•Given n processes P1, P2, … , Pn and burst time of each process Pi as ti.
•Then, predicted burst time for process Pn+1 is given as-

Τn+1 = αtn + (1 - α)Τn


where α = is smoothing factor and 0 <= α
<= 1 ,
tn = actual burst time of nth process,
Τn = predicted burst time of nth process.
125. Which of the following condition is required for deadlock to be possible?
a) mutual exclusion
b) a process may hold allocated resources while awaiting assignment of other
resources
c) no resource can be forcibly removed from a process holding it
d) all of them
125. Which of the following condition is required for deadlock to be possible?
a) mutual exclusion
b) a process may hold allocated resources while awaiting assignment of other
resources
c) no resource can be forcibly removed from a process holding it
d) all of them
126.What is the drawback of banker’s algorithm?
a) in advance processes rarely know that how much resource they will need
b) the number of processes changes as time progresses
c) resource once available can disappear
d) all of them
126.What is the drawback of banker’s algorithm?
a) in advance processes rarely know that how much resource they will need
b) the number of processes changes as time progresses
c) resource once available can disappear
d) all of them
127. To ensure that the hold and wait condition never occurs in the system, it must be
ensured that :
a) whenever a resource is requested by a process, it is not holding any other resources
b) each process must request and be allocated all its resources before it begins its
execution
c) a process can request resources only when it has none
d) all of them
127. To ensure that the hold and wait condition never occurs in the system, it must be
ensured that :
a) whenever a resource is requested by a process, it is not holding any other resources
b) each process must request and be allocated all its resources before it begins its
execution
c) a process can request resources only when it has none
d) all of them
128. A system is having 3 user processes each requiring 3 units of resource R. The
minimum number of units of R such that no deadlock will occur-
1.9
2.8
3.7
4.6
128. A system is having 3 user processes each requiring 3 units of resource R. The minimum number of units of
R such that no deadlock will occur-
1.9
2.8
3.7
4.6

In worst case,
The number of units that each process holds = One less than its maximum demand
So,
•Process P1 holds 2 unit of resource R
•Process P2 holds 2 unit of resource R
•Process P3 holds 2 unit of resource R

Thus,
•Maximum number of units of resource R that ensures deadlock = 2+2+2 = 6
•Minimum number of units of resource R that ensures no deadlock = 6 + 1 = 7
129. A system is having 3 user processes P1, P2 and P3 where P1 requires 22 units of
resource R, P2 requires 32 units of resource R, P3 requires 42 units of resource R. The
minimum number of units of R that ensures no deadlock is _____?

A. 100
B. 98
C. 96
D. 94
A system is having 3 user processes P1, P2 and P3 where P1 requires 22 units of resource R, P2
requires 32 units of resource R, P3 requires 42 units of resource R. The minimum number of units of R
that ensures no deadlock is _____?

In worst case,
The number of units that each process holds = One less than its maximum demand
So,
•Process P1 holds 21 units of resource R
•Process P2 holds 31 units of resource R
•Process P3 holds 41 units of resource R

Thus,
•Maximum number of units of resource R that ensures deadlock = 21 + 31 + 41 = 93
•Minimum number of units of resource R that ensures no deadlock = 93 + 1 = 94
130. If there are 1000 units of resource R in the system and each process in
the system requires 2 units of resource R, then how many processes can be
present at maximum so that no deadlock will occur?

A. 99
B. 999
C. 9999
D. 9
130.If there are 1000 units of resource R in the system and each process in the system
requires 2 units of resource R, then how many processes can be present at maximum
so that no deadlock will occur?

In worst case,
The number of units that each process holds = One less than its maximum demand
So,
•Process P1 holds 1 unit of resource R
•Process P2 holds 1 unit of resource R
•Process P3 holds 1 unit of resource R and so on.
•Process P1000 holds 1 unit of resource R

Thus,
•Minimum number of processes that ensures deadlock = 1000
•Maximum number of processes that ensures no deadlock = 1000 – 1 = 999
131. Consider a system having m resources of the same type being shared by n
processes. Resources can be requested and released by processes only one at
a time. The system is deadlock free if and only if-

1.The sum of all max needs is < m+n


2.The sum of all max needs is > m+n
3.Both of above
4.None of these
Consider a system having m resources of the same type being shared by n processes. Resources can be
requested and released by processes only one at a time. The system is deadlock free if and only if-
1.The sum of all max needs is < m+n
2.The sum of all max needs is > m+n
3.Both of above
4.None of these

Solution-

We have derived above-


Maximum number of units of resource R that ensures deadlock = (∑xi – n)

Thus, For no deadlock occurrence,


Number of units of resource R must be > (∑xi – n)
i.e. m > (∑xi – n)
or ∑xi < m + n
Thus, Correct Option is (A).
132. Which of the following is not a valid deadlock prevention scheme?
A. Release all resources before requesting a new resource.
B. Number the resources uniquely and never request a lower numbered resource
than the last one requested.
C. Never request a resource after releasing any resource.
D. Request and all required resources be allocated before execution.
C

Which of the following is not a valid deadlock prevention scheme?


A. Release all resources before requesting a new resource.
B. Number the resources uniquely and never request a lower numbered resource
than the last one requested.
C. Never request a resource after releasing any resource.
D. Request and all required resources be allocated before execution.
The answer is (C).
A) is valid. Which dissatisfies Hold and Wait but ends up in starvation.
B) is valid. Which is used to dissatisfy circular wait.
C) is invalid.
D) is valid and is used to dissatisfy Hold and Wait.
133. Which is FALSE Statement ?

1. Memory management is a form of resource management applied to computer


memory.
2. The essential requirement of memory management is to provide ways to dynamically
allocate portions of memory to programs at their request, and free it for reuse when
no longer needed.
3. Virtual memory systems separate the memory addresses used by a process from actual
physical addresses, allowing separation of processes and increasing the size of
the virtual address space beyond the available amount of RAM using paging or
swapping to secondary storage.

4. The quality of the virtual memory manager cannot have an extensive effect on overall
system performance.
Which is FALSE Statement ?

1. Memory management is a form of resource management applied to computer


memory.
2. The essential requirement of memory management is to provide ways to dynamically
allocate portions of memory to programs at their request, and free it for reuse when
no longer needed.
3. Virtual memory systems separate the memory addresses used by a process from actual
physical addresses, allowing separation of processes and increasing the size of
the virtual address space beyond the available amount of RAM using paging or
swapping to secondary storage.

4. The quality of the virtual memory manager can have an extensive effect on overall
system performance.
133. Consider a three level paging scheme with a TLB. Assume no page
fault occurs. It takes 20 ns to search the TLB and 100 ns to access the
physical memory. If TLB hit ratio is 80%, the effective memory access
time is _______ nsec.
A. 100
B. 130
C. 150
D. 180
EAT = Hit Ratio (Access Time of TLB + Access Time of main memory)
+ Miss Ratio of TLB (Access Time of TLB + (L+1) x Access time of main memory)
Consider a three level paging scheme with a TLB.
Assume no page fault occurs. It takes 20 ns to
Given-
search the TLB and 100 ns to access the physical
Number of levels of page table = 3
memory. If TLB hit ratio is 80%, the effective
TLB access time = 20 ns
memory access time is _______ msec.
Main memory access time = 100 ns
TLB Hit ratio = 80% = 0.8
Calculating Effective Access Time-
Calculating TLB Miss Ratio-
Substituting the values in above formula, we get-
Effective Access Time
TLB Miss ratio
= 0.8 x { 20 ns + 100 ns } + 0.2 x { 20 ns + (3+1) x 100 ns }
= 1 – TLB Hit ratio
= 0.8 x 120 ns + 0.2 x 420 ns
= 1 – 0.8
= 96 ns + 84 ns
= 0.2
= 180 ns
Thus, effective memory access time = 180 ns.
134. Two processes, P1 and P2, need to access a critical section of code. Consider the
following synchronization construct used by the processes:
Here, JRF1 and JRF2 are shared variables,
/* P1 */ /* P2 */
while (true) { while (true) {
which are initialized to false. Which one of the
JRF1 = true; JRF2 = true; following statements is TRUE about the above
while (JRF2 == true); while (JRF1==true); construct?
/* Critical /* Critical (a) It does not ensure mutual exclusion.
Section */ Section */ (b) It does not ensure bounded waiting.
JRF1=false; JRF2 = false; (c) It requires that processes enter the critical
} } section in strict alteration.
/* Remainder section */ /* Remainder section */ (d) It does not prevent deadlocks, but ensures
mutual exclusion.
Two processes, P1 and P2, need to access a critical section of code. Consider the following
synchronization construct used by the processes:
Here, JRF1 and JRF2 are shared variables,
/* P1 */ /* P2 */
while (true) { while (true) {
which are initialized to false. Which one of the
JRF1 = true; JRF2 = true; following statements is TRUE about the above
while (JRF2 == true); while (JRF1==true); construct?
/* Critical /* Critical (a) It does not ensure mutual exclusion.
Section */ Section */ (b) It does not ensure bounded waiting.
JRF1=false; JRF2 = false; (c) It requires that processes enter the critical
} } section in strict alteration.
/* Remainder section */ /* Remainder section */ (d) It does not prevent deadlocks, but ensures
mutual exclusion.
135. A solution to the Dining Philosophers Problem which avoids deadlock is:
(A) ensure that all philosophers pick up the left fork before the right fork
(B) ensure that all philosophers pick up the right fork before the left fork
(C) ensure that one particular philosopher picks up the left fork before the right fork,
and that all other philosophers pick up the right fork before the left fork
(D) None of the above
A solution to the Dining Philosophers Problem which avoids deadlock is:
(A) ensure that all philosophers pick up the left fork before the right fork
(B) ensure that all philosophers pick up the right fork before the left fork
(C) ensure that one particular philosopher picks up the left fork before the right fork,
and that all other philosophers pick up the right fork before the left fork
(D) None of the above
136. Consider the following two scenarios in the dining philosophers problem:
1.First a philosopher has to enter a room with the table that restricts the number of
philosophers to four.
2.There is no restriction on the number of philosophers entering the room.
Which of the following is true?
A. Deadlock is possible in (i) and (ii).
B. Deadlock is possible in (i).
C. Starvation is possible in (i).
D. Deadlock is not possible in (ii).
E. Starvation is not possible in (ii)
Since restricting the number of philosophers to 4 is a deadlock free solution, Options A
and B are incorrect.
By the same logic, increasing the number of philosophers would make deadlock more
likely. So (ii) is vulnerable to deadlock, and hence, starvation too. Option D and E are
incorrect.
Starvation is definitely possible in (i) if a philosopher gets hungry more often and keeps
picking up both the forks again and again.

Consider the following two scenarios in the dining philosophers problem:


1.First a philosopher has to enter a room with the table that restricts the number of philosophers to four.
2.There is no restriction on the number of philosophers entering the room.
Which of the following is true?
A. Deadlock is possible in (i) and (ii).
B. Deadlock is possible in (i).
C. Starvation is possible in (i).
D. Deadlock is not possible in (ii).
E. Starvation is not possible in (ii)
136.

A. Mutual Exclusion but not free


from deadlock
B. No Mutual Exclusion but
deadlock
C. Both mutual exclusion and
deadlock not possible
D. Deadlock free but mutual
exclusion not satisfied
guarantees M.E but not free from deadlock
137. Consider two processes P1 and P2
accessing the shared variables X and Y In order to avoid deadlock, the
protected by two binary semaphores SX and correct operators at L1, L2, L3 and L4
SY respectively, both initialized to 1. P and V are respectively
denote the usual semaphore operators, where (A) P(SY), P(SX); P(SX), P(SY)
P decrements the semaphore value, and V (B) P(SX), P(SY); P(SY), P(SX)
increments the semaphore value. The pseudo- (C) P(SX), P(SX); P(SY), P(SY)
code of P1 and P2 is as follows : P1 : (D) P(SX), P(SY); P(SX), P(SY)

While true do { While true do {


L1 : ................ L3 : ................
L2 : ................ L4 : ................
X = X + 1; Y = Y + 1;
Y = Y - 1; X = Y - 1;
V(SX); V(SY);
V(SY); V(SX);
} }
138. Here are the two concurrent process P 1, P2 with
respective codes:
P1 code: P 2 code:
while (true) // infinite condition while (true) // infinite condition
{ {
A :____; C :____;
printf("%d", 1); printf("%d", 0);
printf("%d", 1); printf("%d", 0);
B:____; D:____;
} }

What should be the binary semaphore operation on A,B,C,D


respectively and what must be the intial values of semaphore M,N
inorder to get the output 110011001100….?
Where P is down and V is up operation respectively.
(A) A = P(N), B = V(M), C = P(M), D = V(N); M = 0, N = 1;
(B) A = P(N), B = V(M), C = P(M), D = P(N); M = N = 1;
(C) A = P(N), B = V(N), C = P(M), D = V(M); M = 1, N = 0;
(D) A = P(N), B = V(N), C = P(M), D = V(M); M = N = 1;
Here are the two concurrent process P 1, P2 with
respective codes:
P1 code: P 2 code:
while (true) // infinite condition while (true) // infinite condition
{ {
A :____; C :____;
printf("%d", 1); printf("%d", 0);
printf("%d", 1); printf("%d", 0);
B:____; D:____;
} }

What should be the binary semaphore operation on A,B,C,D


respectively and what must be the intial values of semaphore M,N
inorder to get the output 110011001100….?
Where P is down and V is up operation respectively.
(A) A = P(N), B = V(M), C = P(M), D = V(N); M = 0, N = 1;
(B) A = P(N), B = V(M), C = P(M), D = P(N); M = N = 1;
(C) A = P(N), B = V(N), C = P(M), D = V(M); M = 1, N = 0;
(D) A = P(N), B = V(N), C = P(M), D = V(M); M = N = 1;
OPERATING SYSTEM

139. Consider a disk pack with the following specifications-


• Number of surfaces = 32
• Number of tracks per surface = 64
• Number of sectors per track = 128
• Number of bytes per sector = 1024 bytes

What is the number of bits required to address the sector?


A. 18
B. 19
C. 20
D. 21
Given-
Number of surfaces = 32
Number of tracks per surface = 64
Number of sectors per track = 128
Number of bytes per sector = 1024 bytes

Total number of sectors


= Total number of surfaces x Number of tracks per
surface x Number of sectors per track
= 32 x 64 x 1024 sectors
= 221 sectors
Thus, Number of bits required to address the
sector = 21 bits
140. When the process is switched, which information is not stored for later use?
•Program Counter
•Scheduling information
•Base and limit register value
•Currently used register
•Changed State
•I/O State information
•Accounting information

A. Any 4
B. Any 5
C. Any 6
D. None
When the process is switched, which information is not stored for later use?
•Program Counter
•Scheduling information
•Base and limit register value
•Currently used register
•Changed State
•I/O State information
•Accounting information

A. Any 4
B. Any 5
C. Any 6
D. None
141. Which statement is FALSE in context of Process control block ?

A. PCB of each process resides in the main memory.


B. There exists only one PCB corresponding to each process.
C. PCB of all the processes are present in a Array.
D. OS maintains pointers to each process’s PCB so that it can access the
PCB quickly.
Which statement is FALSE in context of Process control block ?

A. PCB of each process resides in the main memory.


B. There exists only one PCB corresponding to each process.
C. PCB of all the processes are present in a Array.(It should be Linked list)
D. OS maintains pointers to each process’s PCB so that it can access the
PCB quickly.
142. The minimum no. of states required with and without I/O Operation ?

A. 4 ,5
B. 5,4
C. 3,4
D. 4,3
142. The minimum no. of states required with and without I/O Operation ?

A. 4 ,5
B. 5,4
C. 3,4
D. 4,3 •The minimum number of states through which a
process compulsorily goes through is 4.
•These states are new state, ready state, run state
and terminate state.
•However, if a process also requires the I/O
operation, then minimum number of states is 5.
143. Consider a system using TLB for paging with TLB access
time of 40ns. What hit ratio is reduced for TLB to reduce the
effective memory access time from 400ns to 280ns?

a) 95%
b) 90%
c) 85%
d) 80%
143. Consider a system using TLB for paging with TLB access
time of 40ns. What hit ratio is reduced for TLB to reduce the
effective memory access time from 400ns to 280ns?

a) 95%
b) 90%
c) 85%
Given that without using TLB, the effective memory access time
d) 80% = 400ns, which is 2 * tm
Hence memory access time tm = 200ns
Effective memory access time = H(tTLB + tm) + (1-H)(tTLB + 2Tm)
280 = H(40+200) + (1-H) (40 + 400)
H = 0.8 = 80%
144. A system has 56-bit virtual addresses and 48-bit physical addresses. If
the pages are 4kB in size, the number of bits required for virtual page
number and physical frame number will be respectively?

a) 56 and 48
b) 44 and 36
c) 41 and 31
d) 36 and 44
144. A system has 56-bit virtual addresses and 48-bit physical addresses. If
the pages are 4kB in size, the number of bits required for virtual page
number and physical frame number will be respectively?

a) 56 and 48 Given page size = 4KB = 212bytes, hence the line number (displacement
or offset) = 12 bits
b) 44 and 36
Virtual address 56 bits:
c) 41 and 31
d) 36 and 44
Page number = 56-12 = 44 bits

Physical address 48 bits:

Frame number = 48-12 = 36 bits


145. Consider a system which has R identical resources, 5
processes competing for them and 3 is the maximum need of
each process. Then the minimum number of resources required
such that deadlock will never occur is
1. 11
2. 10
3. 12
4. None of these.
145. Consider a system which has R identical resources, 5
processes competing for them and 3 is the maximum need of
each process. Then the minimum number of resources required
such that deadlock will never occur is
1. 11
2. 10
3. 12
A system with R identical resources, P processes
4. None of these. competing for them and N is the maximum need of
each process, then the minimum number of resources
required, so that deadlock will never occur is
R >= P * (N - 1) + 1
R>=5*(3-1)+1>=11.
Therefore, minimum =11.
146. ____________ is a situation in which two or more
processes continuously change their state in response to
changes in the other process(es) without doing any useful work,
indefinitely.

a) Spin lock
b) Deadlock
c) Livelock
d) None of these.
146. ____________ is a situation in which two or more
processes continuously change their state in response to
changes in the other process(es) without doing any useful work,
indefinitely.

a) Spin lock
b) Deadlock
c) Livelock
d) None of these. Livelock
This is similar to deadlock in that no progress is
made, but differs in that neither process is
blocked or waiting for anything.
147. Four jobs A, B, C and D are waiting in Ready Queue. Their
expected runtimes are 6, 2, 4 and x respectively. All jobs
entered in Ready queue at time zero. They must run
in.........order to minimize average response time if 2 < x < 4.

a) B, D, C, A
b) C, B, A, D
c) A, D, C, B
d) C, A, D, B
147. Four jobs A, B, C and D are waiting in Ready Queue. Their
expected runtimes are 6, 2, 4 and x respectively. All jobs
entered in Ready queue at time zero. They must run
in.........order to minimize average response time if 2 < x < 4.

a) B, D, C, A
b) C, B, A, D
c) A, D, C, B
d) C, A, D, B
148. Given that a computer system has only 5 processes. The first and
fourth processes are single threaded, second process is two threaded
and third and fifth processes are 4 threaded. So total how many page
tables will be managed by the operating system if all the page tables
are always in the main memory ?
A. Exactly 5
B. At most 12
C. At least 5
D. None of the above
148. Given that a computer system has only 5 processes. The first and
fourth processes are single threaded, second process is two threaded
and third and fifth processes are 4 threaded. So total how many page
tables will be managed by the operating system if all the page tables
are always in the main memory ?
A. Exactly 5
B. At most 12
As we know in multithreading memory is shared by the
C. At least 5 threads of the processes . So, Page table is also shared in
D. None of the above between the threads of the process.

We need 5 page table for 5 process but in question there is


no where written there that OS is using Single Level Paging
. OS can use Multi level Paging (more than one page table
per Process) also . So we need atleast 5 page tables.
149. Consider a swapping system in which memory consists of the following
hole sizes in memory order: 10 MB, 4 MB, 20 MB, 18 MB, 7 MB, 9 MB, 12 MB,
and 15 MB.
For successive segment requests of 12MB, 10MB and 9MB, using Next Fit,
which hole will be allocated for the third request?
A. 10 MB
B. 20 MB
C. 18 MB
D. None of the above
149. Consider a swapping system in which memory consists of the following
hole sizes in memory order: 10 MB, 4 MB, 20 MB, 18 MB, 7 MB, 9 MB, 12 MB,
and 15 MB.
For successive segment requests of 12MB, 10MB and 9MB, using Next Fit,
which hole will be allocated for the third request?
A. 10 MB
In next Fit It begins as the first fit to find a free partition but when
B. 20 MB called next time it starts searching from where it left off, not from
C. 18 MB the beginning.
D. None of the above
12MB request would go to 20 MB hole.

Then for 10 MB request we will start searching after 20 MB , it


would go to 18 MB hole .
Then for 9 MB request we will start searching after 18 MB , it would
go to 9 MB.
So for the third request (9 MB ) 9MB hole is allocated
150. Consider a demand paging system which takes x millisecond to service a
page fault and y millisecond to fulfil a memory request of CPU without page-
fault. If x is 7 times of y and page fault rate is 0.1 then the effective memory
access time is given by?
a) 6.4y millisecond
b) 6y millisecond
c) 1.7y millisecond
d) 1.6y millisecond
150. Consider a demand paging system which takes x millisecond to service a
page fault and y millisecond to fulfil a memory request of CPU without page-
fault. If x is 7 times of y and page fault rate is 0.1 then the effective memory
access time is given by?
a) 6.4y millisecond
b) 6y millisecond
c) 1.7y millisecond
d) 1.6y millisecond

x =7y (given)
Effective memory access time = 0.1 * x + (1-0.1)*y
= 0.1 * 7y + 0.9 * y
= 1.6 y
THANK YOU !!
Keep Learning, Keep Practicing
GATE NoteBook
Target JRF - UGC NET Computer Science Paper 2

1000 MEQs
50 Qs on SYSTEM SOFTWARE AND
OPERATING SYSTEM
Most Expected Questions Course
OPERATING SYSTEM

151. Consider a system with 4 processes A, B, C and D. The maximum need of


processes A, B, C and D for a specific resource R are 3, 6, 4 and 5 instances,
respectively. Maximum with how instances of resource R, it has then too can
suffer from deadlock?
a) 15
b) 14
c) 13
d) 18
OPERATING SYSTEM

151. Consider a system with 4 processes A, B, C and D. The maximum need of


processes A, B, C and D for a specific resource R are 3, 6, 4 and 5 instances,
respectively. Maximum with how instances of resource R, it has then too can
suffer from deadlock?
a) 15
b) 14
c) 13
d) 18
For maximum instances with deadlock, each process should acquire 1
less than maximum need.
Which is in total 2+5+3+4 = 14

All processes will wait for 1 instance each and will suffer from deadlock.
OPERATING SYSTEM

152. On increasing the no of frames to a virtual memory of process,


a) Its execution becomes faster
b) Its execution becomes lesser
c) Its execution remains same
d) None of the above
OPERATING SYSTEM

152. On increasing the no of frames to a virtual memory of process,


a) Its execution becomes faster
b) Its execution becomes lesser
c) Its execution remains same
d) None of the above
On increasing the no of frames to a virtual
memory of process, its execution becomes faster
as less no of page faults occur.
OPERATING SYSTEM

153. Belady Anomaly is defined as


a) Less no of page faults occur when more frames are allocated to a proccess.
b) On increasing the no of frames to a virtual memory of process, its execution
becomes faster as less no of page faults occur.
c) More no of page faults occur when more frames are allocated to a proccess.
d) More no of page faults occur when less frames are allocated to a proccess.
OPERATING SYSTEM

153. Belady Anomaly is defined as


a) Less no of page faults occur when more frames are allocated to a proccess.
b) On increasing the no of frames to a virtual memory of process, its execution
becomes faster as less no of page faults occur.
c) More no of page faults occur when more frames are allocated to a proccess.
d) More no of page faults occur when less frames are allocated to a proccess.
OPERATING SYSTEM

154. Which of the following page replacement algorithms suffer from Belady
Anomaly ?
1. FCFS
2. LRU
3. MRU

a) 1 and 2
b) 2 and 3
c) 1 and 3
d) Only 2
e) All of them
OPERATING SYSTEM

154. Which of the following page replacement algorithms suffer from Belady
Anomaly ?
1. FCFS
2. LRU
3. MRU

a) 1 and 2
b) 2 and 3
c) 1 and 3
d) Only 2
e) All of them
OPERATING SYSTEM

155. If there are 32 pages and the page size is 1024 words, the what will be the
length of logical address ?

a) 10
b) 13
c) 15
d) 17
e) 18
OPERATING SYSTEM

155. If there are 32 pages and the page size is 1024 words, the what will be the
length of logical address ?

a) 10
b) 13
c) 15
d) 17
e) 18

No. of bits for no. of pages = log2 32 = 5


No. of bits for no. of page size = log2 1024 = 10

Therefore, length of logical address = 5 + 10 = 15


OPERATING SYSTEM

156. Consider the statements :

(I) The size of pages is typically of any size depending upon user program.
(II) The physical addresses and virtual addresses are represented in bits.

Which is/are TRUE ?

a) Only I
b) Only II
c) Both
d) None
OPERATING SYSTEM

156. Consider the statements :

(I) The size of pages is typically of any size depending upon user program.
(II) The physical addresses and virtual addresses are represented in bits.

Which is/are TRUE ?

a) Only I
b) Only II
c) Both
d) None
The size of pages is typically a power of 2
OPERATING SYSTEM

157. Which of the following is/are Pass 2 task in a typical assembler ?


1) Generate data
2) Generate instructions
3) Determine length of machine instructions

a) Only 1
b) Only 3
c) 1 and 2
d) 2 and 3
e) All of the above
OPERATING SYSTEM

157. Which of the following is/are Pass 2 task in a typical assembler ?


1) Generate data
2) Generate instructions
3) Determine length of machine instructions = Pass 1

a) Only 1 Pass-1:
b) Only 3 •Define symbols and literals and remember them in symbol
c) 1 and 2 table and literal table respectively.
•Keep track of location counter
d) 2 and 3 •Process pseudo-operations
e) All of the above Pass-2:
•Generate object code by converting symbolic op-code into
respective numeric op-code
•Generate data for literals and look for values of symbols
OPERATING SYSTEM

158. Main memory is managed by operating system but _______


is/are not managed by it.

a) Cache memory
b) Solid State Disk
c) Magnetic disk
d) Both a) and b)
e) All of the above
OPERATING SYSTEM

158. Main memory is managed by operating system but _______


is/are not managed by it.

a) Cache memory
b) Solid State Disk
c) Magnetic disk
d) Both a) and b)
e) All of the above
Memory management keeps track of each and
every memory location, regardless of either it is
allocated to some process or it is free.
OPERATING SYSTEM
159. Consider the following statements about user level threads and kernel level threads.
Which one of the following statement is FALSE?
(A) Context switch time is longer for kernel level threads than for user level threads.
(B) User level threads do not need any hardware support.
(C) Related user level threads can be scheduled on different processors in a multi-
processor system.
(D) Blocking one user level thread blocks all related threads.
OPERATING SYSTEM

159. Consider the following statements about user level threads and kernel level threads.
Which one of the following statement is FALSE?
(A) Context switch time is longer for kernel level threads than for user level threads.
(B) User level threads do not need any hardware support.
(C) Related user level threads can be scheduled on different processors in a multi-
processor system.
(D) Blocking one user level thread blocks all related threads.
OPERATING SYSTEM

160. ___________ is/are I/O devices, used to store data, boot the system.

a) Hard Disk Drive (HDD)


b) Solid State Drive (SSD)
c) Both Hard Disk Drive (HDD) and Solid State Drive (SSD)
d) Neither Hard Disk Drive (HDD) nor Solid State Drive (SSD)
OPERATING SYSTEM

160. ___________ is/are I/O devices, used to store data, boot the system.

a) Hard Disk Drive (HDD)


b) Solid State Drive (SSD)
c) Both Hard Disk Drive (HDD) and Solid State Drive (SSD)
d) Neither Hard Disk Drive (HDD) nor Solid State Drive (SSD)
OPERATING SYSTEM

161. In HDD the data transfer is _________ and the data transfer is
_________ access in SSD.

a) Random, Sequential
b) Index Sequential, Random
c) Direct, Sequential
d) Sequential, Random
OPERATING SYSTEM

161. In HDD the data transfer is _________ and the data transfer is
_________ access in SSD.

a) Random, Sequential
b) Index Sequential, Random
c) Direct, Sequential
d) Sequential, Random
OPERATING SYSTEM

162. Point out the WRONG Statement(s) :

i. HDD is less reliable due to possibility of mechanical failure, like head


crash and susceptibility to strong magnets.
ii. SSD is less reliable due to possibility of mechanical failure, like head
crash and susceptibility to strong magnets.

a) Only i
b) Only ii
c) Both i and ii
d) None of them
OPERATING SYSTEM

162. Point out the WRONG Statement(s) :

i. HDD is less reliable due to possibility of mechanical failure, like head


crash and susceptibility to strong magnets.
ii. SSD is less reliable due to possibility of mechanical failure, like head
crash and susceptibility to strong magnets.

a) Only i
b) Only ii
c) Both i and ii
d) None of them
HDD SSD
Hard Disk Drive. Solid State Drive.

does not contains, mechanical parts,


contains moving mechanical parts, like the arm.
only electronical parts like ICs.

longer R/W time. shorter R/W time..

higher latency. lower latency.

supports fewer I/O operations per second. supports more I/O operations per second.

HDD has fragmentation. SSD do not has fragmentation.

heavier in weight. lighter in weight.

larger in size. more compact in size.

In HDD the data transfer is sequential. In SSD the data transfer is random access.

less reliable due to possibility of mechanical failure, like head crash and
SSD is more reliable.
susceptibility to strong magnets.

HDD is cheaper per unit storage. SSD is costlier per unit storage.

HDD is older and more traditional. SSD is newer to use.

HDD can produce noise due to mechanical movements. SSD does not produces noise.
UNI/LINUX

163. Pipes in UNIX was introduced by M.D Mcllory in June 1972– version 2,
10 UNIX installations. Piping is used to give ___________ .

a) The output of one command as input to another command


b) The input of one command as output to another command
c) The output of multiple commands as input to single command
d) The output of single commands as input to multiple command
e) None of these
UNI/LINUX

163. Pipes in UNIX was introduced by M.D Mcllory in June 1972– version 2,
10 UNIX installations. Piping is used to give ___________ .

a) The output of one command as input to another command


b) The input of one command as output to another command
c) The output of multiple commands as input to single command
d) The output of single commands as input to multiple command
e) None of these

Commands are piped together using vertical bar “ | ” symbol.


Syntax:
command 1|command 2
UNI/LINUX

164. Which of the following is/are filter in UNIX ?


1. cat
2. wc
3. grep
4. sort

a) 1, 2 and 3
b) 2, 3 and 4
c) 1, 3 and 4
d) All of them
e) None of them
UNI/LINUX

164. Which of the following is/are filter in UNIX ?


1. cat
2. wc
3. grep
4. sort
Filters
a) 1, 2 and 3 i. set of commands
ii. take input from standard input stream = stdin
b) 2, 3 and 4
perform some operations
c) 1, 3 and 4 iii. write output to standard output stream = stdout
d) All of them The stdin and stdout can be managed as per
e) None of them preferences using redirection and pipes.
SYSTEM SOFTWARE
165. Match the following :-
List I (Filter Commands) List II (Functions)
a) grep 1. look for a pattern consisting of a single word
b) sort 2. arranges lines of text alphabetically or numerically
c) pg 3. displays the contents of text files, 1 page at a time.

A. a)-1, b)-2, c)-3


B. a)-1, b)-3, c)-2
C. a)-3, b)-2, c)-1
D. a)-2, b)-3, c)-1
SYSTEM SOFTWARE
165. Match the following :-
List I (Filter Commands) List II (Functions)
a) grep 1. look for a pattern consisting of a single word
b) sort 2. arranges lines of text alphabetically or numerically
c) pg 3. displays the contents of text files, 1 page at a time.

A. a)-1, b)-2, c)-3


B. a)-1, b)-3, c)-2
C. a)-3, b)-2, c)-1
D. a)-2, b)-3, c)-1
UNI/LINUX

166. Which of the following is feature(s) of System calls ?

I. Used for file system control, process control, interprocess communication.


II. Access to the Unix kernel is only available through system calls.
III. system calls are exactly works same as function calls do.

a) I and III
b) Only II
c) II and III
d) I and II
e) Only III
UNI/LINUX

166. Which of the following is feature(s) of System calls ?

I. Used for file system control, process control, interprocess communication.


II. Access to the Unix kernel is only available through system calls.
III. system calls are exactly works same as function calls do.

a) I and III
b) Only II
c) II and III
Generally, system calls are similar to function
d) I and II calls, the only difference is that they remove
e) Only III the control from the user process.
UNI/LINUX

167. Which of the following system calls in Unix used to gets the
parent and child process times ?

a) fork()
b) chroot()
c) times()
d) chmod()
UNI/LINUX

167. Which of the following system calls in Unix used to gets the
parent and child process times ?

a) fork()
b) chroot()
c) times()
d) chmod()
a) fork() : A new process is created
b) chroot() : changes the root directory of a file
c) times() : Gets the parent and child process times
d) chmod() : The mode of a file can be changed
UNI/LINUX
UNI/LINUX
UNI/LINUX
UNI/LINUX
WINDOWS OS
WINDOWS
UNI/LINUX
OS
WINDOWS
UNI/LINUX
OS
WINDOWS
UNI/LINUX
OS
WINDOWS
UNI/LINUX
OS
WINDOWS
UNI/LINUX
OS
WINDOWS
UNI/LINUX
OS
WINDOWS
UNI/LINUX
OS
OPERATING SYSTEM

174. Peterson’s Algorithm is used to synchronize two processes. hen a process


wants to execute it’s critical section, it sets it’s flag to true and turn as the index
of the other process. This means that :

a) The process wants to wait and allow the other process to wait.
b) The process wants to execute and also allow the other process to execute
simultaneously.
c) The process wants to execute but it will allow the other process to run first.
d) The process wants to execute but it will restrict the other process to run
first.
OPERATING SYSTEM

174. Peterson’s Algorithm is used to synchronize two processes. hen a process


wants to execute it’s critical section, it sets it’s flag to true and turn as the index
of the other process. This means that :

a) The process wants to wait and allow the other process to wait.
b) The process wants to execute and also allow the other process to execute
simultaneously.
c) The process wants to execute but it will allow the other process to run first.
d) The process wants to execute but it will restrict the other process to run
first.
PETERSON’S ALGORITHM –

1. Used to synchronize two processes.


2. It uses two variables :-
a) A bool array flag of size 2
b) An int variable turn.

3. The process wants to execute but it will allow the other process to run first.
4. The process performs busy waiting until the other process has finished it’s own critical
section.
5. After this the current process enters it’s critical section and adds or removes a random
number from the shared buffer.
6. After completing the critical section, it sets it’s own flag to false, indication it does not wish to
execute anymore.
7. The program runs for a fixed amount of time before exiting.
8. This time can be changed by changing value of the macro RT.
SYSTEM SOFTWARE
175. Match the following :-
List I (Multi-Threading Models) List II (Functions)
a) One to One 1. a thread blocking system call blocks entire process.
b) Many to One 2. restriction on the number of threads in the system.
c) Many to Many 3. no. of kernel threads depends on the kernel or app.

A. a)-1, b)-2, c)-3


B. a)-1, b)-3, c)-2
C. a)-3, b)-2, c)-1
D. a)-2, b)-1, c)-3
SYSTEM SOFTWARE
175. Match the following :-
List I (Multi-Threading Models) List II (Functions)
a) One to One 1. a thread blocking system call blocks entire process.
b) Many to One 2. restriction on the number of threads in the system.
c) Many to Many 3. no. of kernel threads depends on the kernel or app.

A. a)-1, b)-2, c)-3


B. a)-1, b)-3, c)-2
C. a)-3, b)-2, c)-1
D. a)-2, b)-1, c)-3
OPERATING SYSTEM

176. Storage management is a process for users to optimize the use of storage
devices and it is also responsible for :
a) Protecting the integrity of data for any media on which it resides
b) covering aspects such as security, virtualization and more, as well as
different types of provisioning or automation
c) improve the performance of system.
d) All of the above
OPERATING SYSTEM

176. Storage management is a process for users to optimize the use of storage
devices and it is also responsible for :
a) Protecting the integrity of data for any media on which it resides
b) covering aspects such as security, virtualization and more, as well as
different types of provisioning or automation
c) improve the performance of system.
d) All of the above
OPERATING SYSTEM

177. In distributed systems, Processors communicate with each other through


various communication lines like high-speed buses or telephone lines. These are
known as :-
a) Loosely coupled systems
b) Tightly coupled systems
c) Tangible systems
d) Client - Server systems
OPERATING SYSTEM

177. In distributed systems, Processors communicate with each other through


various communication lines like high-speed buses or telephone lines. These are
known as :-
a) Loosely coupled systems
b) Tightly coupled systems
c) Tangible systems Distributed Systems Advantage :-
d) Client - Server systems Failure of one site in a distributed system
doesn’t affect the others, the remaining sites
can potentially continue operating.
WINDOWS OPERATING SYSTEM

178. _________ is a feature that allows users to switch between user accounts on
a single computer without quitting applications and logging out in windows
operating system.
a) Multi-user Operating System
b) Fast User Switching
c) Terminal services
d) None of the above
WINDOWS OPERATING SYSTEM

178. _________ is a feature that allows users to switch between user accounts on
a single computer without quitting applications and logging out in windows
operating system.
a) Multi-user Operating System
b) Fast User Switching
c) Terminal services
d) None of the above
WINDOWS OPERATING SYSTEM

179. Terminal Server client require two license to connect to a terminal server.
The first license is a __________ and second is a client access license for the
server.
a) Windows 10 workstation license
b) Windows NT workstation license
c) Server access license
d) None of these
WINDOWS OPERATING SYSTEM

179. Terminal Server client require two license to connect to a terminal server.
The first license is a __________ and second is a client access license for the
server.
a) Windows 10 workstation license
b) Windows NT workstation license
c) Server access license
d) None of these
WINDOWS OPERATING SYSTEM

180. What is TRUE about Virtualization?

A. In Virtualization, it is necessary to have well-compiled Multitenant.


B. In Virtualization, we analyze the strategy problems that customer might face
C. It assign a logical name to a physical resource and providing a pointer to that
physical resource when demanded.
D. All of the above
E. None of these
WINDOWS OPERATING SYSTEM

180. What is TRUE about Virtualization?

A. In Virtualization, it is necessary to have well-compiled Multitenant.


B. In Virtualization, we analyze the strategy problems that customer might face
C. It assign a logical name to a physical resource and providing a pointer to that
physical resource when demanded.
D. All of the above
E. None of these The Multitenant architecture offers virtual
isolation among the multiple tenants.
Hence, the organizations can use and
customize their application as though they
each have their instances running.
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
OPERATING SYSTEM
WINDOWS OPERATING SYSTEM

187. Consider the set of 6 processes whose arrival time and burst time are given below-
If the CPU scheduling policy is Round Robin with time quantum = 2, calculate the average
turn around time and average waiting time.
Process Arrival time Burst time
a) 11.89, 6.98 P1 0 4
b) 10.84, 7.33 P2 1 5
c) 9.74, 8.93 P3 2 2
d) 13.04, 6.89 P4 3 1
P5 4 6
P6 6 3
OPERATING SYSTEM

Arrival Burst
Process
time time

P1 0 4
P2 1 5
P3 2 2
P4 3 1
P5 4 6
P6 6 3
OPERATING SYSTEM

Arrival Burst
Process
time time

P1 0 4
P2 1 5
P3 2 2
P4 3 1
P5 4 6
P6 6 3
OPERATING SYSTEM

Arrival Burst
Process
time time

P1 0 4
P2 1 5
P3 2 2
P4 3 1
P5 4 6
P6 6 3
WINDOWS OPERATING SYSTEM

187. Consider the set of 6 processes whose arrival time and burst time are given below-
If the CPU scheduling policy is Round Robin with time quantum = 2, calculate the average
turn around time and average waiting time.
Process Arrival time Burst time
a) 11.89, 6.98 P1 0 4
b) 10.84, 7.33 P2 1 5
c) 9.74, 8.93 P3 2 2
d) 13.04, 6.89 P4 3 1
P5 4 6
P6 6 3
188. For the processes listed in the following (A)5
table, (B)6
(C)7
Using Round Robin with TQ = 2 , find the (D)8
number of context switches ?

PROCESS ARRIVAL PROCESSING


TIME TIME
A 0 3
B 1 6
C 4 4
D 6 2
189. For the processes listed in the (A)5
following table, What is the Turn Around (B)6
time of Process D using SJF Algorithm ? (C)7
(D)8

PROCESS ARRIVAL PROCESSING


TIME TIME
A 0 3
B 1 6
C 4 4
D 6 2
190.Which of the following scheduling algorithms is non-preemptive?
(a) Round-Robin (b) First In First Out
(c) Multilevel Queue Scheduling (d) Multilevel Queue Scheduling with
Feedback
190.Which of the following scheduling algorithms is non-preemptive?
(a) Round-Robin (b) First In First Out
(c) Multilevel Queue Scheduling (d) Multilevel Queue Scheduling with
Feedback

Ans: option (b)


191. Consider three CPU-intensive processes, which require 5, 10 and 20 time units and
arrive at times 0, 2 and 6, respectively. How many context switches are needed if the
operating system implements a shortest remaining time first scheduling algorithm? Do
not count the context switches at time zero and at the end.
(a) 1 (b) 2 (c) 3 (d) 4
191. Consider three CPU-intensive processes, which require 5, 10 and 20 time units and
arrive at times 0, 2 and 6, respectively. How many context switches are needed if the
operating system implements a shortest remaining time first scheduling algorithm? Do
not count the context switches at time zero and at the end.
(a) 1 (b) 2 (c) 3 (d) 4
192. Which CPU Scheduling is Guaranteed Scheduling ?

(A) Gang Scheduling


(B) Rate Monotonic Scheduling
(C) Fair Share Scheduling
(D) None
192. Which CPU Scheduling is Guaranteed Scheduling ?

(A) Gang Scheduling


(B) Rate Monotonic Scheduling
(C) Fair Share Scheduling
(D) None
193. Which CPU Scheduling is Rate Monotonic Scheduling ?

(A) Gang Scheduling


(B) Real Time Scheduling
(C) Thread Scheduling
(D) None
193. Which CPU Scheduling is Rate Monotonic Scheduling ?

(A) Gang Scheduling


(B) Real Time Scheduling
(C) Thread Scheduling
(D) None

ANSWER : B
Rate monotonic scheduling is a scheduling algorithm used in real-time operating
systems with a static-priority scheduling class.
194. Assume that the following jobs are to be executed on a single processor
system
-----------------------
Job-Id CPU-BurstTime
-----------------------
p 4
q 1
r 8
s 1
t 2
-----------------------
The jobs are assumed to have arrived at time 0 and in the order p, q, r, s, t.
Calculate the Turn around time for job p if scheduling is round robin with time
slice 1.
(a) 4 (b) 10 (c) 11 (d) 12

Ans: option (c)


195. A critical section is a program segment
(a) which should run in a certain specified amount of time
(b) which avoids deadlocks
(c) where shared resources are accessed
(d) which must be enclosed by a pair of semaphore operations, P and V
195. A critical section is a program segment
(a) which should run in a certain specified amount of time
(b) which avoids deadlocks
(c) where shared resources are accessed
(d) which must be enclosed by a pair of semaphore operations, P and V

Ans: option (c)


196. A counting semaphore was initialized to 10. Then 9 P (wait) operations and
9V (signal) operations were completed on this semaphore. The resulting value of
the semaphore is
(a) 0 (b) 8 (c) 10 (d) 12
196. A counting semaphore was initialized to 10. Then 9 P (wait) operations and
9V (signal) operations were completed on this semaphore. The resulting value of
the semaphore is
(a) 0 (b) 8 (c) 10 (d) 12
197. System calls are usually invoked by using
(a) a software interrupt (b) polling
(c) an indirect jump (d) a privileged instruction
197. System calls are usually invoked by using
(a) a software interrupt (b) polling
(c) an indirect jump (d) a privileged instruction

Ans: option (a)


198. Which of the following actions is/are typically not performed by the operating
system when switching context from process A to process B?
(a) Saving current register values and restoring saved register values for process B.
(b) Changing address translation tables.
(c) Swapping out the memory image of process A to the disk.
(d) Invalidating the translation look-aside buffer.
198. Which of the following actions is/are typically not performed by the operating
system when switching context from process A to process B?
(a) Saving current register values and restoring saved register values for process B.
(b) Changing address translation tables.
(c) Swapping out the memory image of process A to the disk.
(d) Invalidating the translation look-aside buffer.

Ans: option (c)


Explanation:
Swapping out the memory image of process to the disk occurs only when the process
is suspended.
199. A process executes the following code
for (i = 0; i < n; i++) fork();
The total number of child processes created is
(a) n
(b) 2n - 1
(c) 2n
(d) 2n+1 - 1;
199. A process executes the following code
for (i = 0; i < n; i++) fork();
The total number of child processes created is
(a) n
(b) 2n - 1
(c) 2n
(d) 2n+1 - 1;

Ans: option (b)


Explanation:
Loop executes for n times. Therefore, fork() is executed for n times.
For n fork statements, 2n – 1 child processes are created.
200. Let the page fault service time be 10 ms in a computer with
average memory access time being 20 ns. If one page fault is
generated for every 106 memory accesses, what is the effective
access time for the memory?

A. 10 ns
B. 20 ns
C. 30 ns
D. none
Let the page fault service time be 10 ms in a computer with
average memory access time being 20 ns. If one page fault EMAT (with page faults) =
is generated for every 10 6 memory accesses, what is the Page fault rate x {EAT without page fault + Page
effective access time for the memory? fault service time} + (1- Page fault rate) x {EMAT
without page fault}
Page fault service time = 10 ms
Average memory access time = 20 ns
One page fault occurs for every 10 6 memory accesses
It is given that one page fault occurs for every 10 6 memory
accesses.
Page fault rate = 1 / 106 = 10-6

Effective Access Time With Page Fault-

It is given that effective memory access time without page


fault = 20 ns.
Now, substituting values in the above formula, we get-
Effective access time with page fault
= 10-6 x { 20 ns + 10 ms } + ( 1 – 10-6 ) x { 20 ns }
= 10-6 x 10 ms + 20 ns
= 10-5 ms + 20 ns
= 10 ns + 20 ns
= 30Copy
nsprotected with Online-PDF-No-Copy.com

You might also like