CS and IT GATE 2015 Set-1 Questions with Answer

Ques 1 Automata


For any two languages L1 and L2 such that L1 is context free and L2 is recursively enumerable but not recursive, which of the following is/are necessarily true?

I. L1' (complement of L1) is recursive
II. L2' (complement of L2) is recursive
III. L1' is context-free
IV. L1' ∪ L2 is recursively enumerable

A

I only

B

III only

C

III and IV only

D

I and IV only



Ques 2 C Programming


The output of the following C program is __________.

void f1 (int a, int b)
{
    int c;
    c=a; a=b; b=c;
}
void f2 (int *a, int *b)
{
    int c;
   c=*a; *a=*b;*b=c;
}
int main()
{
    int a=4, b=5, c=6;
    f1(a, b);
    f2(&b, &c);
    printf (“%d”, c-a-b);
    return 0;
}


a is the correct answer.


Ques 3 C Programming


Which of following statements is/are False?

I. XML overcomes the limitations in HTML to support a structured way of organizing content.
II. XML specification is not case sensitive while HTML specification is case sensitive.
III. XML supports user defined tags while HTML uses pre-defined tags.
IV. XML tags need not be closed while HTML tags must be closed.

A

II only

B

I only

C

I and IV only

D

III and IV only



Ques 4 COA


Consider a system with byte-addressable memory, 32 bit logical addresses, 4 kilobyte page size and page table entries of 4 bytes each. The size of the page table in the system in megabytes is_________


a is the correct answer.


Ques 5 COA


For computers based on three-address instruction formats, each address field can be used to specify which of the following:

S1: A memory operand
S2: A processor register
S3: An implied accumulator register

A

Either S1 or S2

B

Either S2 or 3

C

Only S2 and  3

D

All of S1, S2 and S3



Ques 6 Compiler Design


Which one of the following is True at any valid state in shift-reduce parsing?

A

Viable prefixes appear only at the bottom of the stack and not inside

B

Viable prefixes appear only at the top of the stack and not inside

C

The stack contains only a set of viable prefixes

D

The stack never contains viable prefixes



Ques 7 Compiler Design


A variable x is said to be live at a statement Si in a program if the following three conditions hold simultaneously:
i. There exists a statement Sj that uses x
ii. There is a path from Si to Sj in the flow graph corresponding to the program
iii. The path has no intervening assignment to x including at Si and Sj

The variables which are live both at the statement in basic block 2 and at the statement in basic block 3 of the above control flow graph are

A

p, s, u

B

r, s, u

C

r, u

D

q, v



Ques 8 Compiler Design


The least number of temporary variables required to create a three-address code in static single assignment form for the expression q + r / 3 + s - t * 5 + u * v / w is _______.



Ques 9 Computer Network


Consider a LAN with four nodes S1, S2, S3 and S4. Time is divided into fixed-size slots, and a node can begin its transmission only at the beginning of a slot. A collision is said to have occurred if more than one node transmit in the same slot. The probabilities of generation of a frame in a time slot by S1, S2, S3 and S4 are 0.1, 0.2, 0.3 and 0.4, respectively. The probability of sending a frame in the first slot without any collision by any of these four stations is_________


a is the correct answer.


Ques 10 Computer Network


Suppose two hosts use a TCP connection to transfer a large file. Which of the following statements is/are False with respect to the TCP connection?

I. If the sequence number of a segment is m, then the sequence number of the subsequent segment is always m+1.
II. If the estimated round trip time at any given point of time is t sec, the value of the retransmission timeout is always set to greater than or equal to t sec.
III. The size of the advertised window never changes during the course of the TCP connection.
IV. The number of unacknowledged bytes at the sender is always less than or equal to the advertised window.


a is the correct answer.


Ques 11 Computer Network


Which one of the following fields of an IP header is NOT modified by a typical IP router?

A

Checksum

B

Source address

C

Time to Live (TTL)

D

Length



Ques 12 Computer Network


Suppose that everyone in a group of N people wants to communicate secretly with the N–1 others using symmetric key cryptographic system. The communication between any two persons should not be decodable by the others in the group. The number of keys required in the system as a whole to satisfy the confidentiality requirement is

A

2N

B

N(N – 1)

C

N(N – 1)/2

D

(N – 1)2



Ques 13 Computer Network


In one of the pairs of protocols given below, both the protocols can use multiple TCP connections between the same client and the server. Which one is that?

A

HTTP, FTP

B

HTTP, TELNET

C

FTP, SMTP

D

HTTP, SMTP



Unique Visitor Count

Total Unique Visitors

Loading......