GATE CS 2012

Last Updated :
Discuss
Comments

Question 1

The cost function for a product in a firm is given by 5q2, where q is the amount of production. The firm can sell the product at a market price of Rs 50 per unit. The number of units to be produced by the firm such that the profit is maximized is

  • 5

  • 10

  • 15

  • 25

Question 2

A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the size of each disk block address is 8 Bytes. The maximum possible file size in this file system is

  • 3 Kbytes

  • 35 Kbytes

  • 280 Bytes

  • Dependent on the size of the disk

Question 3

Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 On a demand paged virtual memory system running on a computer system that main memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacements policy. Then

  • OPTIMAL < LRU < FIFO

  • OPTIMAL < FIFO < LRU

  • OPTIMAL = LRU

  • OPTIMAL = FIFO

Question 4

Suppose (

A

, B) and (

C

,D) are two relation schemas. Let r1 and r2 be the corresponding relation instances. B is a foreign key that refers to C in r2. If data in r1 and r2 satisfy referential integrity constraints, which of the following is ALWAYS TRUE?

DBMSGATE2012
  • A

  • B

  • C

  • D

Question 5

Consider an instance of TCP’s Additive Increase Multiplicative Decrease (AIMD) algorithm where the window size at the start of the slow start phase is 2 MSS and the threshold at the start of the first transmission is 8 MSS. Assume that a timeout occurs during the fifth transmission. Find the congestion window size at the end of the tenth transmission.

  • 8 MSS

  • 14 MSS

  • 7 MSS

  • 12 MSS

Question 6

Consider the set of strings on {0,1} in which, every substring of 3 symbols has at most two zeros. For example, 001110 and 011001 are in the language, but 100010 is not. All strings of length less than 3 are also in the language. A partially completed DFA that accepts this language is shown below. 

 

 The missing arcs in the DFA are 

  •  
  •  
  •  
  •  

Question 7

The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudocode below is invoked as height (root) to compute the height of a binary tree rooted at the tree pointer root. 

 


The appropriate expression for the two boxes B1 and B2 are
 

  • B1 : (1 + height(n->right)), B2 : (1 + max(h1,h2))
     

  • B1 : (height(n->right)), B2 : (1 + max(h1,h2))
     

  • B1 : height(n->right), B2 : max(h1,h2)
     

  • B1 : (1 + height(n->right)), B2 : max(h1,h2)
     

Question 8

Register renaming is done in pipelined processors

  • as an alternative to register allocation at compile time

  • for efficient access to function parameters and local variables

  • to handle certain kinds of hazards

  • as part of address translation

Question 9

Consider a random variable X that takes values +1 and −1 with probability 0.5 each. The values of the cumulative distribution function F(x) at x = −1 and +1 are

  • 0 and 0.5

  • 0 and 1

  • 0.5 and 1

  • 0.25 and 0.75

Question 10

Consider the following C program

C
int a, b, c = 0;
void prtFun (void);
int main ()
{
    static int a = 1; /* line 1 */
    prtFun();
    a += 1;
    prtFun();
    printf ( "\n %d %d " , a, b) ;
}
 
void prtFun (void)
{
    static int a = 2; /* line 2 */
    int b = 1;
    a += ++b;
    printf (" \n %d %d " , a, b);
}

What output will be generated by the given code segment?

  • 3 1
    4 1
    4 2
  • 4 2
    6 1
    6 1
  • 4 2
    6 2
    2 0
  • 3 1
    5 2
    5 2
Tags:

There are 65 questions to complete.

Take a part in the ongoing discussion