CS604 Past Paper OPERATINGSYSTEM
CS604 Past Paper OPERATINGSYSTEM
(2) Consider a computer system with 6 tape drives and n processes completing
for them. What is the maximum value of n for the system to be deadlock free
assuming each processes may need 3 tape drives?
(A) 3
(B) 2
(C) 4
(D) 7
ANSWER: 2
(3) When size of the memory is increased the page replacement policy that
sometimes leads to more page faults is
(A) FIFO
(B) Optimal
(C) LRU
(D) None of the above
ANSWER: FIFO
(4) A program is executing in a pure demand paging system with 100 records per
page with 1 free main memory frame. The address sequence that is generated by
tracing this program is recorded as follows.
0100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0370.
(A) 8
(B) 11
(C) 7
(D) 12
ANSWER: 7
(5) The capacity of a memory unit = The number of words x The number of
bits/words. For the memory of 4k x 16 the number of separate address and data
lines needed is
(6) A system has m number of resources of same type and 3 processes A, B and
C. share these resources. A, B and C have the peak demand of 3, 4 and 6
respectively. Deadlock will not occur if
(A) m = 15
(B) m = 8
(C) m = 13
(D) m = 9
ANSWER: m = 13
(7) In the table shown below P1, P2 and P3 are the three processes
What is the completion order of the 3 processes under the policies FCFS and Round
robin (RR2) scheduling with CPU quantum time of 2 units?
(8) When the result of computation depends on the speed of the processes
involved there is said to be
(A) A deadlock
(B) A time lock
(C) Cycle stealing
(D) Race condition
(9) Consider a counting semaphore which was initialized to 10 and then 6P (wait)
operation and 4v (signal) operations were completed on this semaphore. What is
the resulting value of semaphore?
(A) 10
(B) 9
(C) 8
(D) 0
ANSWER: 8
(11) How many child processes are created if a process executes the code
fork();
fork();
fork();
(A) 5
(B) 8
(C) 7
(D) 9
ANSWER: 7
(13) On a single processor four jobs are to be executed. At time t = 0+ jobs arrive
in the order of A, B, C, D. The burst CPU time requirements are 4, 1, 8, 1 time units
respectively.
Under round robin scheduling with time slice of 1 time unit the completion time of
A is
(A) 3
(B) 5
(C) 7
(D) 9
ANSWER: 9
(15) Consider a Unix-style I-node that has 10 direct pointers, 1 single, 1 double
and 1 triple indirect pointers. What is the maximum possible file size if disk block
size of 1kbyte, disk block address of 32 bit and 48 bit integers are used?
(17) For time-shared operating systems the most suitable scheduling policy is
(18) We have a system with a two level paging scheme whose description is given
below:
(A) 700ns
(B) 1500ns
(C) 1230ns
(D) 1000ns
ANSWER: 1230ns
(19) The compute time burst of three processes with process id 0, 1, 2 is 2, 4 and
8 time units. All processes arrive at time 0 and the Longest Remaining Time First
(LRTF) scheduling algorithm is used. In LRTF giving priority to the process with
the lowest process id breaks ties. What is the average turn around time?
(A) 13unit
(B) 17unit
(C) 21unit
(D) 19unit
ANSWER: 13unit
(20) if (fork()==0)
{
a = a + 5, printf(“%d, %d\n”, a, &a),
}
else
{
a = a – 5, printf(“%d, %d\n”, a, &a),
}
The values printed by the parent process is denoted by u and v and the values printed
by the child process is denoted by x and y. The statement that holds true is
ANSWER: u = x + 10 and v = y
(21) Consider a uniprocessor computer system that has 2 processes and both of
them alternate 10ms CPU bursts with 90ms IN/OUT bursts. Both the processes
were created at nearly the same time and the IN/OUT of both the processes can
proceed in parallel. For this system the scheduling strategies that will result in
the least CPU utilization (over a long period of time) is
(22) The average time to service a page fault is 10ms and the time taken to access
the memory is 1µs. A 99.99% hit ratio results in average memory access time of
(A) 1.9999μs
(B) 1.9999ms
(C) 1ms
(D) 9.99μs
ANSWER: 1.9999μs
(23) From the statement given below the one, which is not valid for deadlock
prevention scheme, is
(A) Number the resources uniquely and never request a lower numbered resource than
the last one requested
(B) Request and all required resources be allocated before execution
(C) Release all resources before requesting a new resource
(D) Never request a resource after releasing any resource
What will be the address of c[40][50] if it is assumed that the main memory is byte
addressable and that the array is stored starting from memory address 0?
(A) 5050
(B) 5040
(C) 4050
(D) 4040
ANSWER: 4050
(25) A machine has a physical memory of 64Mbyte and virtual address space of
32-bit. The page size is 4kbyte and the page table size is approximately
(A) 24Mbyte
(B) 16Mbyte
(C) 2Mbyte
(D) 8Mbyte
ANSWER: 8Mbyte
We have a process that has been allocated 3 page frames and initially none of the
pages of the process are available in the memory. The following sequence of page
references (reference
1, 2, 1, 3, 7, 4, 5, 6, 3, 1
(26) The number of page faults that will occur for the above reference string if
optimal page replacement policy is used is
(A) 7
(B) 8
(C) 9
(D) 6
ANSWER: 7
(27) How many more number of page faults occur for the above reference string
with Least recently used page replacement policy than with the optimal page
replacement policy?
(A) 3
(B) 2
(C) 1
(D) 0
ANSWER: 2
(28) Consider a processor, which uses 36-bit physical address and 32-bit virtual
address with 4kbyte page frame. Size of each page table entry is 4 byte. For
virtual to physical address translation a three level page table has been used. The
virtual address is used as follows:
Bit 30-31 are used to index into the first level page table
Bit 21-29 are used to index into the second level page table
Bit 12-20 are used to index into the third level page table
Bit 0-11 are used as offset within the page
In the page table entry of the first, second and third level page table the number
of bits required for addressing the next level page table (or page frame)
respectively are
(29) A computer system supports virtual address and physical address each of 32
bits. The operating system designer decides to get rid of the virtual memory
entirely as the virtual address space is the same as that of physical address
space. Which one of the following statement holds true?
(30) We have three processes P0, P1 and P2 whose arrival time and burst time are
given below:
The average waiting for the three processes, if the pre-emptive shortest job first
scheduling algorithm is carried out only at arrival or completion of processes, is
(A) 7.33ms
(B) 6.33ms
(C) 5.33ms
(D) 4.33ms
ANSWER: 4.33ms
(31) For the deadlock prevention and deadlock avoidance schemes the statement
that does not hold true is
(32) We have a CPU that generates virtual addresses of 32 bits and the page size
is of 4kbyte. Transition look aside buffer (TLB) of the processor can hold a total
of 128 page table entries and is 4-way set associative. What is the minimum size
of the TLB tag?
(A) 16 bit
(B) 20 bit
(C) 11 bit
(D) 15 bit
ANSWER: 11 bit
(33) Consider a virtual memory system that uses First In First Out (FIFO) page
replacement policy and allocates a fixed number of frames to a process.
a: Sometimes the page fault rate is increased if the number of page frames allocated is
increased
ANSWER: Both a and b are true but b is not the reason for a
for (j=0; j
(A) 2n - 1
(B) 2n
(C) 2n+1 - 1
(D) 2n+1
ANSWER: 2n - 1
(35) For translating virtual address to physical address a multilevel page table is
preferred in comparison to a single level page table because
ANSWER: It helps to reduce the size of page table needed to implement the
virtual address space of a process
(36) Consider a system that has n number of resources R0, ……, R(n-1) and k number
of processes P0, ……P(k-1). The code given below is for the implementation of the
resources request logic
of each process:
if (j%2 ==0)
{
if (j<n)
request Rj;
if (j +2 < n)
request R(j+2);
}
else
{
if (j<n)
request R(n-j);
if (j+2<n)
request R(n-j-2);
}
(A) n = 12, k = 41
(B) n = 40, k = 26
(C) n = 21, k = 12
(D) n = 41, k = 14
ANSWER: n = 21, k = 12
(37) An application loads 100 libraries at startup and to load each library exactly
one disk access is required. 10ms is the seek time of the disk to a random
location and 6000rpm is the rotational speed of the disk. Neglect the time to
transfer data from the disk block once the head has been positioned at the start
of the block. The time taken by the application to load all the libraries if all 100
libraries are loaded from random location on the disk is
(A) 1.50s
(B) 1.00s
(C) 1.87s
(D) 0.74s
ANSWER: 1.50s
(38) We have a FIFO page replacement policy for a virtual memory system.
Increase the number of page frames in the main memory for an arbitrary page
access pattern. This will
(39) The program given below consists of three concurrent processes P0, P1, P2
and three binary semaphores with the values S0 = 1, S1 = 0, S2 = 0.
(40) In a virtual memory environment the minimum number of page frames that
(41) A disk system has 100 cylinders and the request to access the cylinders
occur in the sequence given below:
The head is currently at cylinder 50. It takes 1ms to move from one cylinder to adjacent
one. If shortest seek time first policy is used then the time taken to satisfy all the
requests is
(A) 150ms
(B) 210ms
(C) 276ms
(D) 119ms
ANSWER: 119ms
user programs?
(A) 0%
(B) 25%
(C) 50%
(D) 75%
ANSWER: 0%
(43) What is the effect of using a larger block size in a fixed block size file
system?
(A) It leads to poorer disk throughput and poorer disk space utilization
(B) It leads to poorer disk throughput but better disk space utilization
(C) It leads to better disk throughput and better disk space utilization
(D) It leads to better disk throughput and poorer disk space utilization
ANSWER: It leads to poorer disk throughput and poorer disk space utilization
(44) With respect to user-level threads and kernel-supported threads consider the
following statements given below:
(A) a and d
(B) a and b
(C) b and c
(D) a and c
ANSWER: b and c
(45) Consider a system with 32 bit virtual addresses and 1kbyte page size. It is
not possible to use one-level page tables for virtual to physical address
translation because of
(46) We have a uniprocessor machine where a set of n tasks with known runtimes
r1, r2, r3, …. rn are to be run. The processor scheduling algorithm that will result
in the maximum throughput is
(47) Three CPU intensive processes requires 10, 20 and 30 time units and arrive at
times 0, 2 and 6 respectively. The operating system implements a shortest
remaining time first scheduling algorithm. Considering that the context switches
at time zero and at the end are not counted the number of context switches
needed is
(A) 4
(B) 3
(C) 2
(D) 1
ANSWER: 2
ANSWER: First-in-first-out
(A) Disk
(B) ROM
(C) RAM
(D) On-chip cache
(50) A system that uses FIFO page replacement policy has 4 page frames with no
pages loaded initially. 100 distinct pages are accessed by the system in some
order and then the same 100 pages are accessed in the reverse order. The
number of page faults that may occur is
(A) 193
(B) 194
(C) 195
(D) 196
(51) Which one of the following is the essential content in each entry of a page
table?
List I List II
(A) a – p, b – r, c - q
(B) a – r, b – q, c - p
(C) a – p, b – q, c - r
(D) a – q, b – r, c - p
ANSWER: a – r, b – q, c - p
ANSWER: The page that will not be used for the longest time in the future
(54) In the Unix file system the data blocks of a very large file are allocated using
(55) Let P1 and P2 be the two processes and S1 and S2 be the two shared
Boolean variables. The initial values of S1 and S2 are randomly assigned. For
accessing the critical sections of P1 and P2 the methods used by them are given
below:
Method used by P1
While (S1==S2);
Critical section
S1=S2;
Method used by P2
While (S1! =S2)
Critical section
S2=not (S1);
(57) An operating system maintains smaller data structures for a thread than for a
(59) The system call, which is responsible for sending of SYN packets, is
(A) Bind
(B) Socket
(C) Connect
(D) Listen
ANSWER: Connect
(60) If t1 is the time taken to switch between user and kernel modes of execution
and t2 is the time to switch between two processes then the relation between t1
and t2 is
(A) t1< t2
(B) t1 > t2
(C) t1 = t2
(D) No relation exists between t1 and t2
ANSWER: t1< t2
(61) Which one of the following statement is true for the dirty page in a page
table?
(62) To get the best throughput the disk scheduling strategy that comes into
picture is
(63) The device that should get the highest priority in assigning interrupts is
(A) Linker
(B) Loader
(C) Assembler
(D) Compiler
ANSWER: Loader
(A) a – 2, b – 1, c – 3, d - 4
(B) a – 4, b – 1, c – 3, d - 2
(C) a – 2, b – 3, c – 1, d - 4
(D) a – 3, b – 4, c – 2, d - 1
ANSWER: a – 2, b – 1, c – 3, d - 4
(68) What should be the size of ROM if it is used to store the table for
multiplication of two 8-bit unsigned integers?
(A) 64k x 8
(B) 64k x 16
(C) 4k x 8
(D) 64k x 16
ANSWER: 64k x 8
(69) What will a simple two pass assembler do in the first pass?