GATE (Computer Science & Information Technology)

GATE Computer Science Online Preparation and Practice Test and Study Materials for Information Technology Exams

30 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Let G be a simple graph with 20 vertices and 100 edges. If the size of the minimum vertex cover of G is 8, the size of the maximum independent set of G is

  1. 12
  2. 8
  3. less than 8
  4. more than 12
Question 2 Multiple Choice (Single Answer)

Which of the following is true for a CPU, having a single interrupt request line and a single interrrupt grant line?

  1. Neither vectored interrupt nor multiple interrupting devices are possible.
  2. Vectored interrupts are not possible but multiple interrupting devices are possible.
  3. Vectored interrupts and multiple interrupting devices both are possible.
  4. Vectored interrupt is possible but multiple interrupting devices are not possible.
Question 3 Multiple Choice (Single Answer)

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?

  1. AE, BE
  2. AE, BE, DE
  3. AEH, BEH, BCH
  4. AEH, BEH, DEH
Question 4 Multiple Choice (Single Answer)

Suppose T(n) = 2T (n/2) + n, T(0) = T(1) = 1
Which of the following is false?

  1. T(n) = O(n2 )
  2. T(n) = q (n log n)
  3. T(n) = W (n2)
  4. T(n) = O(n log n)
Question 5 Multiple Choice (Single Answer)

Consider the grammar with the following translation rules and E as the start symbol. E ® E1 # T {E.value = E1.value * T.value}
| T {E.value = T.value }
T ® T1 & F {T.value = T1.value + F.value}
| F {T.value = F.value}
F ® num {F.value = num.value }
Compute E. value for the root of the parse tree for the expression: 2 # 3 & 5 # 6 & 4.

  1. 200
  2. 180
  3. 160
  4. 40
Question 6 Multiple Choice (Single Answer)

A and B are the only two stations on an Ethernet. Each has a steady queue of frames to send. Both A and B attempt to transmit a frame, collide, and A wins the first backoff race. At the end of this successful transmission by A, both A and B attempt to transmit and collide. The probability that A wins the second backoff race is

  1. 0.5
  2. 0.625
  3. 0.75
  4. 1.0
Question 7 Multiple Choice (Single Answer)

The problems 3-SAT and 2-SAT are

  1. both in P
  2. both NP-complete
  3. NP-complete and in P respectively
  4. undecidable and NP-complete respectively
Question 8 Multiple Choice (Single Answer)

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?

  1. AE, BE
  2. AE, BE, DE
  3. AEH, BEH, BCH
  4. AEH, BEH, DEH
Question 9 Multiple Choice (Single Answer)

In a network of LANs connected by bridges, packets are sent from one LAN to another through intermediate bridges. Since more than one path may exist between two LANs, packets may have to be routed through multiple bridges. Why is the spanning tree algorithm used for bridge-routing?

  1. For getting the shortest path routing between LANs
  2. For avoiding loops in the routing paths
  3. For fault tolerance
  4. For minimising collisions
Question 10 Multiple Choice (Single Answer)

Consider three decision problems P1, P2 and P3. It is known that P1 is decidable and P2 is undecidable. Which of the following is true?

  1. P3 is decidable if P1 is reducible to P3.
  2. P3 is undecidable if P3 is reducible to P2.
  3. P3 is undecidable if P2 is reducible to P3.
  4. P3 is decidable if P3 is reducible to P2s complement.
Question 11 Multiple Choice (Single Answer)

Consider the following program fragment for reversing the digits in a given integer to obtain a new integer. Let n = d1d2... dm.
int n, rev;
rev = 0;
while (n > 0)
{
rev = rev * 10 + n % 10;
n = n/10;
}
The loop invariant condition at the end of the ith iteration is

  1. n = d1d2... dm-i....and rev = dmdm-1..dm-i+1
  2. n = dm-i+1...dm-1dm (or) rev = dm-i...d2d1
  3. n ¹ rev
  4. n = d1d2...dm (or) rev = dm...d2d1
Question 12 Multiple Choice (Single Answer)

Consider the following statements with respect to user-level threads and kernel-supported threads
(i) Context switch is faster with kernel-supported threads
(ii) For user-level threads, a system call can block the entire process
(iii) Kernel-supported threads can be scheduled independently
(iv) User-level threads are transparent to the kernel
Which of the above statements are true?

  1. (ii), (iii) and (iv)
  2. (ii) and (iii)
  3. (i) and (iii)
  4. (i) and (ii)
Question 13 Multiple Choice (Single Answer)

Which of the following are essential features of an object-oriented programming language?
(i) Abstraction and encapsulation
(ii) Strictly-typedness
(iii) Type-safe property coupled with sub-type rule
(iv) Polymorphism in the presence of inheritance

  1. (i) and (ii)
  2. (i) and (iv)
  3. (i), (ii) and (iv)
  4. (i), (iii) and (iv)
Question 14 Multiple Choice (Single Answer)

Consider the following program segment for a hypothetical CPU having three user registers Rl R2 and R3. Instruction Operation Instruction Size in word.
MOV Rl,5000 ; Rl ¬ Memory[5000] 2
MOV R2,(R1) ; R2 ¬ Memory[(Rl)]
ADD R2,R3 ; R2 ¬ R2 + R3 1
MOV 6000, R2 ; Memory[6000] ¬ R2 2
HALT; Machine halts 1
Let the clock cycles required for various operations be as follows.
1
Register to/from memory transfer : 3 clock cycles
ADD with both operands in register: 1 clock cycle
Instruction fetch and decode : 2 clock cycles per word
The total number of clock cycles required to execute the program is

  1. 29
  2. 24
  3. 23
  4. 20
Question 15 Multiple Choice (Single Answer)

How many distinct binary search trees can be created out of 4 distinct keys?

  1. 5
  2. 14
  3. 24
  4. 42
Question 16 Multiple Choice (Single Answer)

Packets of the same session may be routed through different paths in

  1. TCP but not UDP
  2. TCP and UDP
  3. UDP but not TCP
  4. Neither TCP nor UDP
Question 17 Multiple Choice (Single Answer)

Consider the following relation schema pertaining to a students database: Student (rollno, name, address) Enroll (rollno, courseno, coursename)
where the primary keys are shown underlined. The number of tuples in the Student and Enroll tables are 120 and 8 respectively. What are the maximum and the minimum number of tuples that can be presented in (Student * Enroll), where ' *' denotes natural join?

  1. 8, 8
  2. 120, 8
  3. 960, 8
  4. 960, 120
Question 18 Multiple Choice (Single Answer)

Assume the following C variable declaration:

int *A [10], B [10][10];

Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program?

I. A [2]
II. A [2] [3]
III. B [1]
IV. B [2][3]

  1. I, II and IV
  2. II, III and IV
  3. II and IV
  4. IV only
Question 19 Multiple Choice (Single Answer)

Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod 10, which of the following statement(s) is/are true?
(i) 9679, 1989, 4199 hash to the same value
(ii) 1471, 6171 hash to the same value
(iii) All elements hash to the same value
(iv) Each element hashes to a different value

  1. (i) only
  2. (ii) only
  3. (i) and (ii)
  4. either (iii) or (iv)
Question 20 Multiple Choice (Single Answer)

Consider the grammar E ® E + n | E x n | n
For a sentence n + n x n, the handles in the right-sentential form of the reduction are

  1. n, E + n and E + n x n
  2. n, E + n and E + E x n
  3. n, n + n and n + n x n
  4. n, E + n and E x n
Question 21 Multiple Choice (Single Answer)

The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)?

  1. 2
  2. 3
  3. 4
  4. 6
Question 22 Multiple Choice (Single Answer)

Postorder traversal of a binary search tree T produces the following sequence of keys:

10, 9, 23, 22, 27, 25, 15, 50, 95, 60, 40, 29

Which of the following sequences of keys can be the result of an inorder traversal of the tree T?

  1. 9, 10, 15, 22, 23, 25, 27, 29, 40, 50, 60, 95
  2. 9, 10, 15, 22, 40, 50, 60, 95, 23, 25, 27, 29
  3. 29, 15, 9, 10, 25, 22, 23, 27, 40, 60, 50, 95
  4. 95, 50, 60, 40, 27, 23, 22, 25, 10, 9, 15, 29
Question 23 Multiple Choice (Single Answer)

Let f: B ® C and g: A ® B be two functions and let h = f o g. Given that h is an onto function. Which of the following is true?

  1. f and g should both be onto functions.
  2. f should be onto but g need not to be onto.
  3. g should be onto but f need not to be onto.
  4. both f and g need not to be onto.
Question 24 Multiple Choice (Single Answer)

Consider the following C program segment
struct CellNode
{
struct CellNode *leftChild ;
int element;
struct CellNode *rightChild ;
};
int DoSomething (struct CellNode *ptr)
{
int value = 0 ; if (ptr ! = NULL)
{
if (ptr->leftChild ! = NULL)
value = 1 + DoSomething (ptr - > leftChild);
if (ptr - > rightChild ! = NULL)
value = max (value, 1 + DoSomething (ptr - > rightChild)) ;
}
return (value);
}
The value returned by the function do something when a pointer to the root of a non-empty tree is passed as argument is

  1. the number of leaf nodes in the tree
  2. the number of nodes in the tree
  3. the number of internal nodes in the tree
  4. the height of the tree
Question 25 Multiple Choice (Single Answer)

A circuit outputs a digit in the form of 4 bits. 0 is represented by 0000,1 by 4,..., 9 by 1001. A combinational circuit is to be designed that takes these 4 bits as input and outputs 1 if the digit ³ 5, and 0 otherwise. If only AND, OR and NOT gates may be used, what is the minimum number of gates required?

  1. 2
  2. 3
  3. 4
  4. 5
Question 26 Multiple Choice (Single Answer)

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

  1. 4
  2. 6
  3. 7
  4. 9
Question 27 Multiple Choice (Single Answer)

If 73x (in base-x number system) is equal to 54y (in base-y number system), the possible values of x and y are

  1. 8, 16
  2. 10, 12
  3. 9, 13
  4. 8, 11
Question 28 Multiple Choice (Single Answer)

What does the following algorithm approximate? (Assume m > 1, Î > 0)
x = m;
y - i;
while (x - y > Î)
{
x = (x + y) / 2;
y = m/x ;
}
print (x);

  1. log m
  2. m2
  3. m1/2
  4. m1/3
Question 29 Multiple Choice (Single Answer)

Consider an operating system capable of loading and executing a single sequential user process at a time. The disk head scheduling algorithm used is First Come First Served (FCFS). If FCFS is replaced by the Shortest Seek Time First (SSTF), claimed by the vendor to give 50% better benchmark results, what is the expected improvement in the I/O performance of user programs?

  1. 50%
  2. 40%
  3. 25%
  4. 0%