• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE IT 2006

Question 51

The following function computes the value of mCn correctly for all legal values m and n (m≥1,n≥0 and m>n)
C
 int func(int m, int n)
{
    if (E) return 1;
    else return(func(m -1, n) + func(m - 1, n - 1));
}
In the above function, which of the following is the correct expression for E?
  • (n = = 0) || (m = = 1)
  • (n = = 0) && (m = = 1)
  • (n = = 0) || (m = = n)
  • (n = = 0) && (m = = n)

Question 52

Which feature of OOP indicates code reusability?

  • Abstraction

  • Polymorphism
     

  • Encapsulation
     

  • Inheritance

Question 53

The arrival time, priority, and duration of the CPU and I/O bursts for each of three processes P1, P2 and P3 are given in the table below. Each process has a CPU burst followed by an I/O burst followed by another CPU burst. Assume that each process has its own I/O resource.
2006_54
The multi-programmed operating system uses preemptive priority scheduling. What are the finish times of the processes P1, P2 and P3 ?
  • 11, 15, 9
  • 10, 15, 9
  • 11, 16, 10
  • 12, 17, 11

Question 54

For each of the four processes P1, P2, P3 and P4. The total size in kilobytes (KB) and the number of segments are given below.
2006_56 The page size is 1 KB. The size of an entry in the page table is 4 bytes. The size of an entry in the segment table is 8 bytes. The maximum size of a segment is 256 KB. The paging method for memory management uses two-level paging, and its storage overhead is P. The storage overhead for the segmentation method is S. The storage overhead for the segmentation and paging method is T. What is the relation among the overheads for the different methods of memory management in the concurrent execution of the above four processes ?
  • P < S < T
  • S < P < T
  • S < T < P
  • T < S < P

Question 55

Consider the solution to the bounded buffer producer/consumer problem by using general semaphores S, F, and E. The semaphore S is the mutual exclusion semaphore initialized to 1. The semaphore F corresponds to the number of free slots in the buffer and is initialized to N. The semaphore E corresponds to the number of elements in the buffer and is initialized to 0.
Which of the following interchange operations may result in a deadlock?
  1. Interchanging Wait (F) and Wait (S) in the Producer process
  2. Interchanging Signal (S) and Signal (F) in the Consumer process
  • I Only
  • II Only
  • Neither I nor II
  • Both I and II

Question 56

The wait and signal operations of a monitor are implemented using semaphores as follows. In the following, 

  • x is a condition variable,
  • mutex is a semaphore initialized to 1,
  • x_sem is a semaphore initialized to 0,
  • x_count is the number of processes waiting on semaphore x_sem, initially 0, next is a semaphore initialized to 0,
  • next_count is the number of processes waiting on semaphore next, initially 0.
P(mutex); 
body of procedure 
if (next_count > 0) 
    V(next); 
else
    V(mutex); 

Each occurrence of x.wait is replaced with the following:

x_count = x_count + 1; 
if (next_count > 0) 
    V(next) 
else
    V(mutex); 
---------------------------------- E1; 
x_count = x_count - 1; 

Each occurrence of x.signal is replaced with the following:

if (x_count > 0) 
{ 
    next_count = next_count + 1; 
 ---------------------------------- E2; 
    P(next), 
    next_count = next_count - 1; 
} 

For correct implementation of the monitor, statements E1 and E2 are, respectively,

  • P(x_sem), V(next)

  • V(next), P(x_sem)

  • P(next), V(x_sem)

  • P(x_sem), V(x_sem)

Question 57

A software program consists of two modules M1 and M2 that can fail independently, but never simultaneously. The program is considered to have failed if any of these modules fails. Both the modules are \'repairable\' and so the program starts working again as soon as the repair is done. Assume that the mean time to failure (MTTF) of M1 is T1 with a mean time to repair (MTTR) of R1. The MTTF of M2 is T2 with an MTTR of R2. What is the availability of the overall program given that the failure and repair times are all exponentially distributed random variables?
  • ((T1T2)/(T1R1 + T2R2))
  • ((R1R2)/(T1R1 + T2R2))
  • ((T1T2)/(T1T2 + T1R1 + T2R2))
  • ((T1T2)/(T1T2 + T1R2 + T2R1))

Question 58

Consider the following structure chart diagram. The boxes have function names embedded in them, while the variables are indicated along the arcs.
2006_59
Given below are a set of statements relevant to the above diagram.
I. F3 and F6 can be in the same module.
II. F4 and F6 can be in the same module.
III. A4 is both an output and a control variable.
IV. It is incorrect to pass A1 as data and use it as a control variable.
Which combination of these statements is TRUE?
  • III and IV
  • I and IV
  • II and IV
  • I, II and IV

Question 59

Consider a relation R with five attributes V, W, X, Y, and Z. The following functional dependencies hold:
VY→ W, WX → Z, and ZY → V.
Which of the following is a candidate key for R?
  • VXZ
  • VXY
  • VWXY
  • VWXYZ

Question 60

In a database file structure, the search key field is 9 bytes long, the block size is 512 bytes, a record pointer is 7 bytes and a block pointer is 6 bytes. The largest possible order of a non-leaf node in a B+ tree implementing this file structure is
  • 23
  • 24
  • 34
  • 44

There are 86 questions to complete.

Last Updated :
Take a part in the ongoing discussion