• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE CS 2019

Question 31

Consider three concurrent processes P1, P2 and P3 as shown below, which access a shared variable D that has been initialized to 100.

The process are executed on a uniprocessor system running a time-shared operating system. If the minimum and maximum possible values of D after the three processes have completed execution are X and Y respectively, then the value of Y–X is __________. Note: This was Numerical Type question.
  • 80
  • 130
  • 50
  • None of these

Question 32

Consider the following C program:
C
#include<stdio.h>
 int main(){
  int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 5}, *ip = arr + 4;

  printf(\"%d\\n\", ip[1]);

  return 0;
}
The number that will be displayed on execution of the program is _________ .
  • 6
  • 5
  • 4
  • segmentation error

Question 33

Consider a sequence of 14 elements: A = [-5, -10, 6, 3, -1, -2, 13, 4, -9, -1, 4, 12, -3, 0]. The subsequence sum . Determine the maximum of S(i,j), where 0 ≤ i ≤ j < 14. (Divide and conquer approach may be used)
Note: This was Numerical Type question.
  • 29
  • 19
  • 39
  • 09

Question 34

Consider the following C program: C
void convert(int n) {
  if (n < 0)
    printf( % d, n);
  else {
    convert(n / 2);
    printf( % d, n % 2);
  }
}
Which one of the following will happen when the function convert is called with any positive integer n as argument?
  • It will print the binary representation of n in the reverse order and terminate.
  • It will print the binary representation of n but will not terminate
  • It will not print anything and will not terminate.
  • It will print the binary representation of n and terminate.

Question 35

Consider the following C program:

C
#include<stdio.h>

int r(){
 int static num=7;
 return num--;
}

int main() {
    
 for(r();r();r()) {
  printf(\"%d \",r());
  };
  
 return 0;
}
Which one of the following values will be displayed on execution of the programs?
  • 41

  • 52

  • 63

  • 630

Question 36

Consider three machines M, N and P with IP addresses 100.10.5.2, 100.10.5.5 and 100.10.5.6 respectively. The subnet mask is set to 255.255.255.252 for all the three machines. Which one of the following is true?
  • M, N and P all belong to the same subnet
  • Only N and P belong to the same subnet
  • M, N, and P belong to three different subnets
  • Only M and N belong to the same subnet

Question 37

Suppose that in an IP-over-Ethernet network, a machine X wishes to find the MAC address of another machine Y in its subnet. Which one of the following techniques can be used for this?
  • X sends an ARP request packet with broadcast IP address in its local subnet
  • X sends an ARP request packet to the local gateway’s MAC address which then finds the MAC address of Y and sends to X
  • X sends an ARP request packet with broadcast MAC address in its local subnet
  • X sends an ARP request packet to the local gateway’s IP address which then finds the MAC address of Y and sends to X

Question 38

Consider three 4-variable functions f1, f2 and f3, which are expressed in sum-of-minterms
f1 = Σ(0, 2, 5, 8, 14)
f2 = Σ(2, 3, 6, 8, 14, 15)
f3 = Σ(2, 7, 11, 14) 
For the following circuit with one AND gate and one XOR gate, the output function f can be expressed as:
  • Σ(7, 8, 11)
  • Σ(2, 14)
  • Σ(0, 2, 3, 5, 6, 7, 8, 11, 14)
  • Σ(2, 7, 8, 11, 14)

Question 39

Which one of the following languages over ∑ = {a, b} is NOT context-free?

  • {anbi ⏐ i ∈ {n, 3n, 5n}, n≥ 0}

  • {wanwRbn ⏐ w ∈ {a, b}*, n≥ 0}

  • {wwR ⏐ w ∈ {a, b}*}

  • {wan bn wR ⏐ w ∈ {a, b}*, n≥ 0}

Question 40

Let the set of functional dependencies F = {QR → S, R → P, S → Q} hold on a relation schema X = (PQRS). X is not in BCNF. Suppose X is decomposed into two schemas and Z where Y = (PR) and Z = (QRS). Consider the two statements given below:

  • I. Both Y and Z are in BCNF
  • II. Decomposition of X into Y and Z is dependency preserving and a lossless.

Which of the above statements is/are correct?

  • I only

  • Neither I nor II

  • Both I and II

  • II only

There are 65 questions to complete.

Last Updated :
Take a part in the ongoing discussion