• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Sudo GATE 2020 Mock II (10 January 2019)

Question 51

A computer network uses polynomial over GF(2) for error checking with 8 bits as information bits and uses x3 + x + 1 as the generator polynomial to generate the check bits. In this network, if the receiver receives 01011011101, then original message send by sender is:
  • 01011011101
  • 01011101
  • 01101011
  • 01011011

Question 52

Which of the following option is true, if L1 and L2 are two languages such that L1 ⊆ L2.
  • If L1 is regular then L2 is regular.
  • If L1 is CFL then L2 is CFL.
  • L2 can be regular even if L1 is CFL but not regular.
  • None of these

Question 53

Consider the following expression
u*v+a-b*c
Which one of the following corresponds to a static single assignment from the above expressions
  • x1 = a - b
    y1 = p * c
    x2 = u * v
    y2 = p + q
  • x 1 = a - b
    y1 = x2   * c
    x3 = u * v
    y2 = x4 + y3
  • x1 = a - b
    y2 = x1 * c
    x2 = u * v
    y3 = x2 + y2
  • p = a - b
    q  = p * c
    p = u * v
    q = p + q 

Question 54

A program is called reentrant if it can be interrupted in the middle of its execution, and then be safely called again ("re-entered") before its previous invocations complete execution. The interruption could be caused by an internal action such as a jump or call, or by an external action such as an interrupt or signal. Once the reentered invocation completes, the previous invocations will resume correct execution. Which of the following program is not reentrant ?
  • int t;
    
    void swap(int *x, int *y)
    {
        int s;
    
        s = t; // save global variable
        t = *x;
        *x = *y;
    
        // hardware interrupt might invoke isr() here!
        *y = t;
        t = s; // restore global variable
    }
    
    void isr()
    {
        int x = 1, y = 2;
        swap(&x, &y);
    }
    
  • void swap(int *x, int *y)
    {
        int t = *x;
        *x = *y;
    
        // hardware interrupt might invoke isr() here!
        *y = t;
    }
    
    void isr()
    {
        int x = 1, y = 2;
        swap(&x, &y);
    }
    
  • int t;
    
    void swap(int *x, int *y)
    {
        t = *x;
        *x = *y;
    
        // hardware interrupt might invoke isr() here!
        *y = t;
    }
    
    void isr()
    {
        int x = 1, y = 2;
        swap(&x, &y);
    }
    
  • None of these.

Question 55

Consider the following code. The function myStrcat concatenates two strings. It appends all characters of b to end of a. So the expected output is "Geeks Quiz". The program compiles fine but produces segmentation fault when run.
C
void myStrcat(char *a, char *b)
{
    int m = strlen(a);
    int n = strlen(b);
    int i;
    for (i = 0; i <= n; i++)
       a[m+i]  = b[i];
}

int main()
{
    char *str1 = \"Geeks \";
    char *str2 = \"Quiz\";
    myStrcat(str1, str2);
    printf(\"%s \", str1);
    return 0;
}
Which of the following changes can correct the program so that it prints "Geeks Quiz"?
  • char *str1 = "Geeks "; can be changed to char str1[100] = "Geeks "; and a line a[m+n-1] = \'\\0\' is added at the end of myStrcat
  • A line a[m+n-1] = \'\\0\' is added at the end of myStrcat
  • A line \'a = (char *)malloc(sizeof(char)*(strlen(a) + strlen(b) + 1)) is added at the beginning of myStrcat()
  • char *str1 = "Geeks "; can be changed to char str1[100] = "Geeks ";

Question 56

Consider a machine with byte addressable memory of 2^32 bytes divided into blocks of size 32 bytes. Assume a 2-set associative cache having 512 cache lines is used with this machine. The size of tag field in bits is _____ .
  • 16
  • 18
  • 19
  • 21

Question 57

Suppose there are two singly linked lists both of which intersect at some point and become a single linked list. The head or start pointers of both the lists are known, but the intersecting node and lengths of lists are not known. What is worst case time complexity of optimal algorithm to find intersecting node from two intersecting linked lists?
  • Θ(n*m), where m, n are lengths of given lists
  • Θ(n^2), where m>n and m, n are lengths of given lists
  • Θ(m+n), where m, n are lengths of given lists
  • Θ(min(n, m)), where m, n are lengths of given lists

Question 58

For the workshops organized in college, students can participate more than one workshop saying that all are organized in different timings. 150 students are enrolled in total for one or more than one workshop. Registration details are as follows : 99 students are enrolled for Cyber Security. 56 students are enrolled for Solar Energy, 89 students are enrolled for Artificial Intelligence. 25 students for both Cyber Security and Solar Energy. 65 students for both Cyber Security and Artificial Intelligence and 18 students for both Solar Energy and Artificial Intelligence. How many students are participating in all three workshops ?
  • 10
  • 12
  • 14
  • 16

Question 59

In B+ tree each key is stored in a leaf node. So, the order of leaf node in B+ tree is the maximum number of (key, record pointer)pairs it can hold. What is the order of B+ tree leaf node, when block size is given as 4 Kilo byte record pointer(RP) of 8 byte, block pointer(BP) size is 2 byte and key is of 15 byte.
  • 164
  • 178
  • 179
  • 241

Question 60

Consider following counters: Counter-1: Counter-2: Which of the following option is correct ?
  • Counter-1 is a three-bit "counter" which counts 0, 1, 2, 4, 5, 7, 0, ... . and Counter-2 is a three-bit "counter" which counts 0, 3, 6, 1, 4, 7, 2, 5, 0, 3, ... .
  • Counter-1 is a three-bit "counter" which counts 0, 2, 6, 1, 4, 7, 2, 5, 0, 2, ... . and Counter-2 is a three-bit "counter" which counts 0, 1, 2, 4, 5, 7, 0, ... .
  • Counter-1 is a three-bit "counter" which counts 0, 3, 6, 1, 4, 7, 2, 5, 0, 3, ... . and Counter-2 is a three-bit "counter" which counts 0, 1, 2, 4, 5, 7, 0, ... .
  • Counter-1 is a three-bit "counter" which counts 0, 3, 6, 1, 4, 7, 2, 5, 0, 3, ... . and Counter-2 is a three-bit "counter" which counts 0, 1, 2, 3, 5, 6, 0, ... .

There are 65 questions to complete.

Last Updated :
Take a part in the ongoing discussion