Operating Systems Test - 1 - PDF Flipbook

Operating Systems Test - 1

469 Views
83 Downloads
PDF 4,295,862 Bytes

Download as PDF

REPORT DMCA


GATE
CSE

Operating
systems

Test-01Solutions


OPERATING SYSTEMS
1. Using a larger block size in a fixed block size file system leads

to
a) better disk throughput but poorer disk space utilization
b) better disk throughput and better disk space utilization
c) poorer disk throughput but better disk space utilization
d) poorer disk throughput and poorer disk space utilization
Answer: (a)
Solution:
Large Block size results in more internal fragmentation and
reading a larger block results in reading more data and hence
higher throughput.
2. Which of the following is an example of spooled device?
a) a line printer used to print the output of a number of jobs
b) a terminal used to enter input data to a running program
c) a secondary storage device m a virtual memory system.
d) a graphic display device.
Answer: (a)
Solution:
SPOOL means Simultaneous Peripheral Operation Online.
spool refers to the process of placing data in a temporary
working area for another program to process. The most
common use is in writing files on a magnetic tape or disk and
entering them in the work queue (possibly just linking it to a
designated folder in the file system) for another process.

1


Spooling is useful because devices access data at different
rates. Spooling allows one program to assign work to another
without directly communicating with it. The most common
spooling application is print spooling: documents formatted
for printing are stored usually into an area on a disk and
retrieved and printed by a printer at its own rate. Printers
typically can print only a single document at a time and
require seconds or minutes to do so. With spooling, multiple
processes can write documents to a print queue without
waiting. As soon as a process has written its document to the
spool device, the process can perform other tasks, while a
separate printing process operates the printer.
3. Virtual memory is
a) Part of Main Memory only used for swapping
b) A technique to allow a program, of size more than the size

of main memory, to run
c) Part of secondary storage used in program execution
d) None of these
Answer: (b)
Solution:
Virtual memory is a memory management technique that is
implemented using both hardware and software. It maps
memory addresses used by a program, called virtual addresses,
into physical addresses in computer memory. Main storage as

2


seen by a process or task appears as a contiguous address space
or collection of contiguous segments.
4. An operating system is
a) intermediary between a user of computer and the computer

hardware
b) an operating system is similar to a given government
c) both (a) and (b)
d) none of these
Answer: (c)
5. An operating system contains 3 user processes each requiring
2 units of resource R. The minimum number of units of R
such that no deadlocks will ever arise is
a) 3
b) 5
c) 4
d) 6
Answer: (c)
6. A computer cannot "boot" if it does not have
a) compiler
b) loader
c) operating system
d) assembler
Answer: (c)

3


7. UNIX operating system
a) is multi user
b) is multitasking
c) can run on PC's and larger system
d) all of these
Answer:(d)

8. Choose the correct alternatives (more than one may be correct)
and write the corresponding letters only: At a particular time
of computation, the value of a counting semaphore is 7. Then
20 P operations and 15 V operations were completed on this
semaphore. The resulting value of the semaphore is:
a) 42
b) 2
c) 7
d) 12
Answer: (b)
Solution:
Initial value of semaphore is 7. After performing 20p
operations, 7 – 20 = –13,
Value of semaphore is now’–13’. After the 15v operation, –13
+ 15 = 2. Resulting value of semaphore is 2.

9. Computer system is divided into how much number of
components?
a) 1
b) 2

4


c) 3

d) 4

Answer:(d)

10. When an interrupt occurs, an Operating System

a) Ignores the interrupt

b) Always changes state of interrupted process to 'blocked'

and schedules another process.

c) Always resumes execution of interrupted process after

processing the interrupt

d) May change state of interrupted processes to "blocked" and

schedule another process.

Answer: (c)

Solution:

Interrupted process is always resumed after processing the

ISR.

When an interrupt occurs, an OS will change the state and

process have go to, wait or blocked or in ready queue.

11. If an instruction takes i microseconds and a page fault takes

an additional j microsecond, the effective instruction time if on

the average a page fault occurs every k instruction is

a) i + j
k

b) i + j ∗ k

c) i+j
k

d) (i + j) ∗ k

5


Answer: (a)
12. The primary purpose of an operating system is

a) To make most efficient use of the computer hardware
b) To allow people to use the computer
c) To keep systems Programmers employed
d) Jo make computers easier to use
Answer: (a)
Solution:
The primary purpose of operating system is to make efficient
use of computer hardware i.e., easy to use and time efficient.
13. What will be the output of the following pseudo-code when
parameters are passed by reference and dynamic scoping is
assumed?
a = 3;
Void n(x) {x = x*a; print(x);}
Void m(y) {a = 1; a = y – a; n (a); print (a);}
Void main () {m (a);}
a) 6, 2
b) 6, 6
c) 4, 2
d) 4, 4
Answer: (d)

6


Solution:

14. Which of the following RAID level provides the highest Data
Transfer Rate (Read /Write)?
a) RAID 1
b) RAID 3
c) RAID 4
d) RAID 5
Answer: (a)
Solution:
RAID level 1 provides the highest data transfer rate (read
/write). RAID levels 2, 3 and 4 are theoretically defined but
not used in practice.

15. Suppose we have variable logical records of lengths of 5
bytes, 10 bytes and 25 bytes while the physical block size in
disk is 15 bytes. What is the maximum and minimum
fragmentation seen in bytes?
a) 25 and 5
b) 15 and 5
c) 15 and 0
d) 10 and 5
Answer: (c)

7


Solution:
Given block size is 15 B. So, when the logical records are of
length 5 B. So, on transferring 5B, remaining will be 10 B, of
block, when transferring 10 B, fragmentation will be of 5 B
and while transferring records of length 25 B the
fragmentation will be of 5 B. Hence, the maximum
fragmentation is of size 10 B and the minimum fragmentation
is of size 5 B.
16. Alpha and Beta testing are forms of
a) Acceptance testing
b) Integration testing
c) System testing
d) Unit testing
Answer: (a)
Solution:
Alpha and Beta testing are forms of acceptance testing. The
difference is alpha testing is done at develop site and beta
testing is done at client site.
17. Two control signals in microprocessor which are related to
Direct Memory Access (DMA) are
a) INTR and INTA
b) RD and WR
c) S0 and S1
d) HOLD and HLDA
Answer: (d)

8


Solution:

The DMA controller sends a 'hold' request line to the CPU and

waits for the CPU to assert the HLDA.

18. The following two functions P1 and P2 that share a variable

B with an initial value of 2 execute concurrently.

P1 ( ) P2( )

{{

C = B – 1; D = 2*B;

B = 2*C; B = D – 1;

}}

The number of distinct values that B can possibly take after

the execution is _____.

Answer: 3

Solution:

If P1 execute after P2 then

19. A critical section is a program segment.

a) Which should run in certain specified amount of time

b) Which avoids dead locks

c) Where shared resources are accessed

d) Which must be enclosed by a pair of semaphore

operations, P and V

Answer: (c)

Solution:

Critical section implies usage of shared resources.

9


20. Non-modifiable procedures are called

a) Serially usable procedures

b) Concurrent procedures

c) Re-entrant procedures

d) Top down procedures

Answer: (c)

Solution:

A re-entrance procedure is one i n which single copy of the

program code can be shared by multiple users during the same

period of time

Re-entity is a useful, has 2 key aspects the program code

cannot modify it self and the location data of each user

process test be stored separately.

21. Consider the following CPU processes with arrival times (in

milliseconds) and length of CPU bursts (in milliseconds) as

given below:

Process Arrival Time Burst Time

P1 0 7

P2 3 3

P3 5 5

P4 6 2

If the pre-emptive shortest remaining time first scheduling

algorithm is used to schedule the processes, then the average

waiting time across all processes is _____ millisecond.

Answer: 3

10


Solution:
Gantt Chart:

Process Arrival Burst Compilation Turn Around Waiting

Time Time Time (CT) (Compilation Time

(AT) (BT) Time – (TAT-

Arrival BT)

Time)

P1 0 7 12 12 5

P2 3 3 6 30

P3 5 5 17 12 7

P4 6 2 8 20

Total =

12

Average waiting time = 12 = 3
4

22. Reliability of software dependent on:

a) Number of errors present in software

b) Documentation

c) Testing duties

d) Development process

Answer: (a)

11


Solution:
Software reliability is measured in terms of mean time
between failures (MTBF). Reliability increases when errors or
bugs from the program are removed.
23. The throughput of slotted ALOHA is given by:
a) S = G
b) S = GeG
c) S = Ge-G
d) S = eG
Answer: (c)
Solution:
An improvement to the original ALOHA protocol was
“slotted ALOHA”, which introduced discerned timeslots and
increased a maximum throughput. The throughput is:

Sslotted = Ge-G
The maximum throughput is 1/e frames per frame time
(reached when g=1), which is approximately 0.368 frames per
frame-time or 36.8%
24. Virtual circuit is associated with a _ service.
a) Connectionless
b) Error-free
c) Segmentation
d) Connection-oriented
Answer: (d)

12


Solution:
A virtual Circuit (VC) is a means of transporting data over a
packet switching data over a packet switching computer
network in such a way that is a dedicated physical layer like
between the source and destination end systems of this data.
The arm virtual circuit is synonymous with virtual connection
and virtual channel.
Virtual circuit communication resembles circuit switching,
since both are connection oriented, meaning that in both class
data is delivered in correct order and singling establishment
overhead a required during a connection establish phase.
25. Where does the swap space reside?
a) RAM
b) Disk
c) ROM
d) On-chip cache
Answer: (b)
Solution:
Disk is used for Swap Space Management.
26. Consider a disk queue with request for input V output to
block on cylinders

98, 183, 37, 122, 14, 124,65, 67
in that order. Assume that disk head is initially positioned at
cylinder 53 and moving towards cylinder number 0. The total

13


number of head movements using Shortest Seek Time First
(SSTF) and SCAN algorithms is respectively
a) 236 and252cylinders
b) 640 and 236 cylinders
c) 235 and 640 cylinders
d) 235 and 2l2cylinders
Answer: (b)
Solution:
Given request are:
98, 183, 37, 122, 14, 124, 65, 67
I. Using SSTF disk scheduling:

Total seek time = (67 – 53) + (67 – 14) + (183 – 14) = 236

II. Using SCAN disk scheduling:

Total seek time =183 + 53 = 236
Hence, answer is 236 and 236.
None of the options is true.

14


27. The most important features of Microsoft windows program
is (are)
a) Windows
b) Pull-down menus
c) ICONS
d) All of these
Answer: (d)

28. A FAT (File allocation table) based file system is being used
and the total overhead of each entry in the FAT is 4 bytes in
size. Given a 100 × 106 bytes’ disk on which the file system is
stored and data block size is 103 bytes, the maximum size of a
file that can be stored on this disk in units of 106 bytes is
______.
Answer: 99.6
Solution:
The total number of blocks on the Disk is 100 x 103;
The size of FAT = 4 x 100 x 103
Bytes = 0.4 x 106 Bytes.
Subtracting this value from the size of Disk is the case of
Maximum File size which is 99.6 × 106 Bytes.

29. Suppose we are implementing quadratic probing with a Hash
function, Hash(y) = X mode 100. Lf an element with key 4594
is inserted and the first three locations attempted are already
occupied then the next cell that will be tried is:
a) 2

15


b) 3

c) 9

d) 97

Answer: (d)

Solution:

Since, hash(y) = 4594 mod100 = 94.

But first 3 locations are already occupied which are attempt

i.e., 94, 95, 96 so answer 97.

30. In a resident-OS computer, which of the following system

software must reside in the main memory under all situations?

a) Assembler

b) Linker

c) Loader

d) Compiler

Answer: (c)

Solution:

A loader is a program used to load then program and data on

to memory and will reside in memory always.

P1() P2()

{{

C = B – 1; D = 2*B;

B = 2*C; B = D – 1;

}}

D = 2*2 C=3–1

=4 =2

16


⟹B=D–1 B = 2*C

=4–1 = 2*2

=3 B=4

P2 is executed after P1 then

P1() P2()

{{

C = B – 1; D = 2*B;

B = 2*C; B = D – 1;

}}

C=B–1 D = 2*B

=2–1 = 2*2

=1 =4
⟹ B = 2*1 B=D–1

B=2 =4–1

=3

B=3

If we done pre-emption between P1 to P2 then B = 2
∴ There are 3 different possible

B = 2, 3, 4

17


Data Loading...