• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE-CS-2005

Question 71

Consider the following code fragment:
  if (fork() == 0)
  { a = a + 5; printf(“%d,%d\\n”, a, &a); }
  else { a = a –5; printf(“%d, %d\\n”, a, &a); } 
Let u, v be the values printed by the parent process, and x, y be the values printed by the child process. Which one of the following is TRUE?
  • u = x + 10 and v = y
  • u = x + 10 and v != y
  • u + 10 = x and v = y
  • u + 10 = x and v != y

Question 72

In a packet switching network, packets are routed from source to destination along a single path having two intermediate nodes. If the message size is 24 bytes and each packet contains a header of 3 bytes, then the optimum packet size is:
  • 4
  • 6
  • 7
  • 9

Question 73

Suppose the round trip propagation delay for a 10 Mbps Ethernet having 48-bit jamming signal is 46.4 ms. The minimum frame size is
  • 94
  • 416
  • 464
  • 512

Question 74

Let E1 and E2 be two entities in an E/R diagram with simple single-valued attributes. R1 and R2 are two relationships between E1 and E2, where R1 is one-to-many and R2 is many-to-many. R1 and R2 do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model?

  • 2

  • 3

  • 4

  • 5

Question 75

The following table has two attributes A and C where A is the primary key and C is the foreign key referencing A with on-delete cascade.
A   C
-----
2   4
3   4
4   3
5   2
7   2
9   5
6   4 
The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (2,4) is deleted is:
  • (3,4) and (6,4)
  • (5,2) and (7,2)
  • (5,2), (7,2) and (9,5)
  • (3,4), (4,3) and (6,4)

Question 76

The relation book (title, price) contains the titles and prices of different books. Assuming that no two books have the same price, what does the following SQL query list?
  select title
  from book as B
  where (select count(*)
     from book as T
     where T.price > B.price) < 5 
  • Titles of the four most expensive books
  • Title of the fifth most inexpensive book
  • Title of the fifth most expensive bookTitles of the five most expensive books
  • Titles of the five most expensive books

Question 77

Consider a relation scheme R = (A, B, C, D, E, H) on which the following functional dependencies hold: {A–>B, BC–>D, E–>C, D–>A}. What are the candidate keys of R?
 

  • AE, BE
     

  • AE, BE, DE
     

  • AEH, BEH, BCH
     

  • AEH, BEH, DEH
     

Question 78

Consider the following data path of a CPU.  

Lightbox

The, ALU, the bus and all the registers in the data path are of identical size. All operations including incrementation of the PC and the GPRs are to be carried out in the ALU. Two clock cycles are needed for memory read operation - the first one for loading address in the MAR and the next one for loading data from the memory bus into the MDR 79.
The instruction “call Rn, sub” is a two word instruction. Assuming that PC is incremented during the fetch cycle of the first word of the instruction, its register transfer interpretation is

Rn < = PC + 1;
PC < = M[PC]; 

The minimum number of clock cycles needed for execution cycle of this instruction is. 
 

  • 2

  • 3

  • 4

  • 5

Question 79

Consider the following data path of a CPU. GATECS2005Q78 The, ALU, the bus and all the registers in the data path are of identical size. All operations including incrementation of the PC and the GPRs are to be carried out in the ALU. Two clock cycles are needed for memory read operation - the first one for loading address in the MAR and the next one for loading data from the memory bus into the MDR 79. The instruction "call Rn, sub" is a two word instruction. Assuming that PC is incremented during the fetch cycle of the first word of the instruction, its register transfer interpretation is
Rn < = PC + 1;
PC < = M[PC]; 
The minimum number of CPU clock cycles needed during the execution cycle of this instruction is:
  • 2
  • 3
  • 4
  • 5

Question 80

Consider the following C-function: 

C
double foo (int n){
    int i;
    double sum;
    if (n = = 0) return 1.0;
    else{
        sum = 0.0;
        for (i = 0; i < n; i++)
            sum += foo (i);
        return sum;
    }
}

The space complexity of the above function is:

  • O(1)

  • O(n)

  • O(n!)

  • O(nn)

There are 90 questions to complete.

Last Updated :
Take a part in the ongoing discussion