CS and IT GATE 2015 Set-2 Questions with Answer

Ques 1 Aptitude


If p, q, r, s are distinct integers such that:

f(p, q, r, s) = max (p, q, r, s)
g(p, q, r, s) = min (p, q, r, s)
h(p, q, r, s) = remainder of (p × q) / (r × s) if (p × q) > (r × s) OR remainder of (r × s) / (p × q) if (r × s) > (p × q)
Also a function fgh (p, q, r, s) = f(p, q, r, s) × g(p, q, r, s) × h(p, q, r, s).

Also the same operation are valid with two variable functions of the form f(p, q).

What is the value of fg(h(2, 5, 7, 3), 4, 6, 8)?


a is the correct answer.


Ques 2 Aptitude


Out of the following four sentences, select the most suitable sentence with respect to grammar and usage

A

Since the report lacked needed information, it was of no use to them

B

The report was useless to them because there were no needed information in it

C

Since the report did not contain the needed information, it was not real useful to them

D

Since the report lacked needed information, it would not had been useful to them



Ques 3 Aptitude


If the list of letters, P, R, S, T, U is an arithmetic sequence, which of the following are also in arithmetic sequence?

I. 2P, 2R, 2S, 2T, 2U
II. P–3, R–3, S–3, T–3, U–3
III. P2, R2, S2, T2, U2

A

I only

B

I and II

C

II and III

D

I and III



Ques 4 Aptitude


Four branches of a company are located at M, N, O and P. M is north of N at a distance of 4 km; P is south of O at a distance of 2 km; N is southeast of O by 1 km. What is the distance between M and P in km?

A

5.34

B

6.74

C

28.5

D

45.49



Ques 5 Aptitude


A generic term that includes various items of clothing such as a skirt, a pair of trousers and a shirt is

A

fabric

B

textile

C

fibre

D

apparel



Ques 6 Aptitude


Based on the given statements, select the most appropriate option to solve the given question. What will be the total weight of 10 poles each of same weight?

Statements:

(I) One fourth of the weight of a pole is 5 kg
(II) The total weight of these poles is 160 kg more
than the total weight of two poles.

A

Statement I alone is not sufficient

B

Statement II alone is not sufficient

C

Either I or II alone is sufficient

D

Both statements I and II together are not sufficient.



Ques 7 Aptitude


Choose the statement where underlined word is used correctly.

A

The industrialist had a personnel jet

B

I write my experience in my personnel diary

C

All personnel are being given the day off

D

Being religious is a personnel aspect



Ques 8 Aptitude


We __________ our friend’s birthday and we ________ how to make it up to him.

A

Completely forgot --- don’t just know

B

Forgot completely --- don’t just know

C

Completely forgot --- just don’t know

D

Completely forgot --- just don’t know



Ques 9 C Programming


Consider the following C function.

int fun (int n)
{
    int x=1, k;
    if (n==1) return x;
    for (k=1; k < n; ++k)
        x = x + fun(k) * fun(n – k);
    return x;
}


The return value of fun(5) is __________.


a is the correct answer.


Ques 10 C Programming


Consider the following function written in the C programming language.

void foo (char *a)
{
    if (*a && *a != ` `)
    {
        foo(a+1);
        putchar(*a);
    }
}


The output of the above function on input “ABCD  EFGH” is

A

ABCD EFGH

B

ABCD

C

HGFE DCBA

D

DCBA



Ques 11 Compiler Design


In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is True?

A

In both AST and CFG, let node N2 be the successor of node N1. In the input program, the code corresponding to N2 is present after the code corresponding to N1.

B

For any input program, neither AST nor CFG will contain a cycle.

C

The maximum number of successors of a node in an AST and a CFG depends on the input program.

D

Each node in AST and CFG corresponds to at most one statement in the input program.



Ques 12 Compiler Design


Match the following:

A

P-2, Q-3, R-1, S-4

B

P-2, Q-1, R-4, S-3

C

P-2, Q-4, R-1, S-3

D

P-2, Q-3, R-4, S-1



Ques 13 Compiler Design


Consider the intermediate code given below.
(1) i = 1
(2) j = 1
(3) t1 = 5 * i
(4) t2 = t1 + j
(5) t3 = 4 * t2
(6) t4 = t3
(7) a[t4] = -1
(8) j = j + 1
(9) if j ≤ 5 goto (3)
(10) i = i + 1
(11) if i < 5 goto (2)
The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are

A

5 and 7

B

6 and 7

C

5 and 5

D

7 and 8



Unique Visitor Count

Total Unique Visitors

Loading......