CS/IT Gate Yearwise
CS/IT Gate 2025 (Set 2)
CS/IT Gate 2024 (Set 1)
CS/IT Gate 2024 (Set 2)
CS/IT Gate 2023
CS/IT Gate 2022
CS/IT Gate 2021 (Set 1)
CS/IT Gate 2021 (Set 2)
CS/IT Gate 2020
CS/IT Gate 2019
CS/IT Gate 2018
CS/IT Gate 2017 (Set 1)
CS/IT Gate 2017 (Set 2)
CS/IT Gate 2016 (Set 1)
CS/IT Gate 2016 (Set 2)
CS/IT Gate 2015 (Set 1)
CS/IT Gate 2015 (Set 2)
CS/IT Gate 2015 (Set 3)
CS/IT Gate 2014 (Set 1)
CS/IT Gate 2014 (Set 2)
CS/IT Gate 2014 (Set 3)
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
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
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?
Ques 5 Aptitude
A generic term that includes various items of clothing such as a skirt, a pair of trousers and a shirt is
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.
Ques 7 Aptitude
Choose the statement where underlined word is used correctly.
Ques 8 Aptitude
We __________ our friend’s birthday and we ________ how to make it up to him.
Ques 9 C Programming
Consider the following C function.
{
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.
{
if (*a && *a != ` `)
{
foo(a+1);
putchar(*a);
}
}
The output of the above function on input “ABCD EFGH” is
Ques 11 Compiler Design
In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is True?
Ques 12 Compiler Design
Match the following:

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

Total Unique Visitors