GATE 2017 (Session 1) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2017 (Session 1)

64 questions

MCQ 44 · NAT 201-mark 30 · 2-mark 34

Questions 21–25 of 64

Q21Addressing Modes1 markMCQ−0.33 if wrong
Consider the C struct defined below:
struct data {
int marks [100] ;
char grade;
int cnumber;
};
struct data student;
The base address of student is available in register R1. The field student.grade can be accessed efficiently using

Q22Intermediate Code Generation1 markMCQ−0.33 if wrong
Consider the following intermediate program in three address code
p= a -b
q= p *c
p= u * v
q= p + q
Which one of the following corresponds to a static single assignment form of the above code?

Q23Array and Pointer1 markMCQ−0.33 if wrong
Consider the following C code:
#include <stdio.h>
int * assignval (int *x, int val) {
      *x = val;
      return x;
}
void main ( ) {
    int * x= malloc (sizeof (int));
    if (NULL == x) return;
    x = assignval (x,0);
    if(x) { 
    x=(int *) malloc (sizeof (int));
    if (NULL == x) return;
    x = assignval (x, 10);
}
printf("%d\n", *x);
free (x);
}
The code suffers from which one of the following problems:

Q24Transport Layer Protocol1 markMCQ−0.33 if wrong
Consider a TCP client and a TCP server running on two different machines. After completing data transfer, the TCP client calls close to terminate the connection and a FIN segment is sent to the TCP server. Server-side TCP responds by sending an ACK which is received by the client-side TCP. As per the TCP connections state diagram (RFC 793), in which state does the client-side TCP connection wait for the FIN from the sever-side TCP?

Q25Network Security1 markMCQ−0.33 if wrong
A sender S sends a message m to receiver R, which is digitally signed by S with its private key. In this scenario, one or more of the following security violations can take place.

I. S can launch a birthday attack to replace m with a fraudulent message.
II. A third party attacker can launch a birthday attack to replace m with a fraudulent message.
III. R can launch a birthday attack to replace m with a fraudulent message.

Which of the following are possible security violations?