GATE-CS-2009

Last Updated :
Discuss
Comments

Question 1

The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows:

void enter_CS(X)
{
while test-and-set(X) ;
}
void leave_CS(X)
{
X = 0;
}

In the above solution, X is a memory location associated with the CS and is initialized to 0. Now consider the following statements: I. The above solution to CS problem is deadlock-free II. The solution is starvation free. III. The processes enter CS in FIFO order. IV More than one process can enter CS at the same time. Which of the above statements is TRUE?

  • I only

  • I and II

  • II and III

  • IV only

Question 2

Consider the data of previous question. Suppose that the sliding window protocol is used with the sender window size of 2i where is the number of bits identified in the previous question and acknowledgments are always piggybacked. After sending 2i frames, what is the minimum time the sender will have to wait before starting transmission of the next frame? (Identify the closest choice ignoring the frame processing time.)

  • 16ms

  • 18ms

  • 20ms

  • 22ms

Question 3

Let G(x) be the generator polynomial used for CRC checking. What is the condition that should be satisfied by G(x) to detect odd number of bits in error?

  • G(x) contains more than two terms

  • G(x) does not divide 1+x^k, for any k not exceeding the frame length

  • 1+x is a factor of G(x)

  • G(x) has an odd number of terms.

Question 4

Frames of 1000 bits are sent over a 10^6 bps duplex link between two hosts. The propagation time is 25ms. Frames are to be transmitted into this link to maximally pack them in transit (within the link). What is the minimum number of bits (i) that will be required to represent the sequence numbers distinctly? Assume that no time gap needs to be given between transmission of two frames.

  • i = 2

  • i = 3

  • i = 4

  • i = 5

Question 5

In quick sort, for sorting n elements, the (n/4)th smallest element is selected as a pivot using an O(n) time algorithm. What is the worst-case time complexity of the quick sort?

(A) θ(n)

(B) θ(nlogn)

(C) θ(n2)

(D) θ(n2 log n)

  • A

  • B

  • C

  • D

Question 6

A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are given two sequences X[m] and Y[n] of lengths m and n respectively, with indexes of X and Y starting from 0. We wish to find the length of the longest common sub-sequence(LCS) of X[m] and Y[n] as l(m,n), where an incomplete recursive definition for the function l(i,j) to compute the length of The LCS of X[m] and Y[n] is given below:

l(i,j) = 0, if either i=0 or j=0
= expr1, if i,j > 0 and X[i-1] = Y[j-1]
= expr2, if i,j > 0 and X[i-1] != Y[j-1]
  • expr1 ≡ l(i-1, j) + 1

  • expr1 ≡ l(i, j-1)

  • expr2 ≡ max(l(i-1, j), l(i, j-1))

  • expr2 ≡ max(l(i-1,j-1),l(i,j))

Question 7

A multilevel page table is preferred in comparison to a single level page table for translating virtual address to physical address because

  • It reduces the memory access time to read or write a memory location.

  • It helps to reduce the size of page table needed to implement the virtual address space of a process.

  • It is required by the translation lookaside buffer.

  • It helps to reduce the number of page faults in page replacement algorithms.

Question 8

In which one of the following page replacement policies, Belady’s anomaly may occur?

  • FIFO

  • Optimal

  • LRU

  • MRU

Question 9

The essential content(s) in each entry of a page table is / are

  • Virtual page number

  • Page frame number

  • Both virtual page number and page frame number

  • Access right information

Question 10

A CPU generally handles an interrupt by executing an interrupt service routine

  • As soon as an interrupt is raised

  • By checking the interrupt register at the end of fetch cycle.

  • By checking the interrupt register after finishing the execution of the current instruction.

  • By checking the interrupt register at fixed time intervals.

Tags:

There are 60 questions to complete.

Take a part in the ongoing discussion