CS/IT Gate Yearwise
CS/IT Gate 2022
CS/IT Gate 2021
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)
Computer Science Gate 2016 Set 1 Questions
Ques 1Aptitude
In a process, the number of cycles to failure decreases exponentially with an increase in load. At a load of 80 units, it takes 100 cycles for failure. When the load is halved, it takes 10000 cycles for failure. The load for which the failure will happen in 5000 cycles is ________.
a) 40.00
b) 46.02
c) 60.01
d) 92.02
Aptitude is the correct answer.
Ques 2Aptitude
Consider the following statements relating to the level of poker play of four players P, Q, R, and S.
I P always beats Q
II. R always beats S
III. S loses to P only sometimes
IV. R always loses to Q
Which of the following can be logically inferred from the above statements?
(i) P is likely to beat all the three other players
(ii) S is the absolute worst player in the set
a) (i) only
b) (ii) only
c) (i) and (ii)
d) neither (i) nor (ii)
Reasoning is the correct answer.
Ques 3Aptitude
Indian currency notes show the denomination indicated in at least seventeen languages. If this is not an indication of the nation’s diversity, nothing else is. Which of the following can be logically inferred from the above sentences?
a) India is a country of exactly seventeen languages.
b) Linguistic pluralism is the only indicator of a nation’s diversity.
c) Indian currency notes have sufficient space for all the Indian languages.
d) Linguistic pluralism is strong evidence of India’s diversity.
English Grammar is the correct answer.
Ques 4Aptitude
A cube is built using 64 cubic blocks of side one unit. After it is built, one cubic block is removed from every corner of the cube. The resulting surface area of the body (in square units) after the removal is __________.
a) 56
b) 64
c) 72
d) 96
Aptitude is the correct answer.
Ques 5Aptitude
If ‘relftaga’ means carefree, ‘otaga’ means careful and ‘fertaga’ means careless, which of the following could mean ‘aftercare’?
a) zentaga
b) tagafer
c) tagazen
d) relffer
English Grammar is the correct answer.
Ques 6Aptitude
Archimedes said, “Give me a lever long enough and a fulcrum on which to place it, and I will move the world.” The sentence above is an example of a ___________ statement.
a) figurative
b) collateral
c) literal
d) figurine
English Grammar is the correct answer.
Ques 7Aptitude
A rewording of something written or spoken is a ______________.
a) paraphrase
b) paradox
c) paradigm
d) paraffin
English Grammar is the correct answer.
Ques 8Aptitude
Out of the following four sentences, select the most suitable sentence with respect to grammar and usage.
a) I will not leave the place until the minister does not meet me.
b) I will not leave the place until the minister doesn’t meet me.
c) I will not leave the place until the minister meet me.
d) I will not leave the place until the minister meets me.
English Grammar is the correct answer.
Ques 9Automata
Let X be a recursive language and Y be a recursively enumerable but not recursive language. Let W and Z be two languages such that Y reduces to W, and Z reduces to X (reduction means the standard many-one reduction). Which one of the following statements is TRUE?
a) W can be recursively enumerable and Z is recursive.
b) W an be recursive and Z is recursively enumerable.
c) W is not recursively enumerable and Z is recursive.
d) W is not recursively enumerable and Z is not recursive
Recursive Language is the correct answer.
Ques 10Automata
Consider the following context-free grammars:
G2: S → aA|bB, A → aA|B|ε, B → bB|ε
a) {ambn |m > 0 or n > 0} and {ambn |m > 0 and n > 0}
b) {ambn |m > 0 and n > 0} and {ambn |m > 0 or n ≥ 0}
c) {ambn |m ≥ 0 or n > 0} and {ambn |m > 0 and n > 0}
d) {ambn |m ≥ 0 and n > 0} and {a mbn |m > 0 or n > 0}
CGF is the correct answer.
Ques 11Automata
Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s?
a) (0+1)*0011(0+1)* + (0+1)*1100(0+1)*
b) (0+1)* (00(0+1) *11+11(0+1)*00)(0+1)*
c) (0+1)*00(0+1) *+ (0+1) *11(0+1) *
d) 00(0+1) *11+11(0+1)*00
Regular Language is the correct answer.
Ques 12Automata
Which of the following decision problems are undecidable?
I. Given NFAs N1 and N2, is L(N1)∩L(N2) = Φ?
II. Given a CFG G = (N,Σ,P,S) and a string x ∈ Σ*, does x ∈ L(G)?
III. Given CFGs G1 and G2, is L(G1) = L(G2)?
IV. Given a TM M, is L(M) = Φ?
a) I and IV only
b) II and III only
c) III and IV only
d) II and IV only
decidablility is the correct answer.
Ques 13Automata
Which of the following languages is generated by the given grammar?
S → aS|bS| ε
a) {anbm | m,n >= 0}
b) {w∈{a,b}* | w has equal number of a's and b's}
c) {an | n>=0} U {anbn | n>=0}
d) {a,b}*
Grammar is the correct answer.
Ques 14C
The attributes of three arithmetic operators in some programming language are given below.
Operator | Precedence | Associativity | Arity |
---|---|---|---|
+ | High | Left | Binary |
- | Medium | Right | Binary |
* | Low | Left | Binary |
The value of the expression 2 - 5 + 1 - 7 * 3 in this language is __________ ?
a is the correct answer.
Ques 15C
Consider the following C program
void mystery(int *ptra, int *ptrb)
{
int *temp;
temp = ptrb;
ptrb = ptra;
ptra = temp;
}
int main()
{
int a=2016, b=0, c=4, d=42;
mystery(&a, &b);
if (a < c)
mystery(&c, &a);
mystery(&a, &d);
printf("%dn", a);
}
The output of the program _____________
a is the correct answer.
Ques 16C
Consider the following proposed solution for the critical section problem. There are n
processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than anyof its arguments. For all i, t[i] is initialized to zero.
:
do {
c[i]=1; t[i] = pmax(t[0],...,t[n-1])+1; c[i]=0;
for every j 6= i in {0,...,n-1} {
while (c[j]);
while (t[j] != 0 && t[j]<=t[i]);
}
Critical Section;
t[i]=0;
Remainder Section;
} while (true);
Which one of the following is TRUE about the above solution?
a) At most one process can be in the critical section at any time
b) The bounded wait condition is satisfied
c) The progress condition is satisfied
d) It cannot cause a deadlock
Code is the correct answer.
Ques 17C
What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed?
void n(x) {x = x * a; print(x);}
void m(y) {a = 1; a = y - a; n(a); print(a);}
void main() {m(a);}
a) 6, 2
b) 6, 6
c) 4, 2
d) 4, 4
C code is the correct answer.
Ques 18C
The following function computes the maximum value contained in an integer array p[] of size n (n >= 1)
int max(int *p, int n)
{
int a=0, b=n-1;
while (__________)
{
if (p[a] <= p[b])
{
a = a+1;
}
else
{
b = b-1;
}
}
return p[a];
}
The missing loop condition is
a) a != n
b) b != 0
c) b > (a + 1)
d) b != a
Functions is the correct answer.
Ques 19C
Consider the following C program.
void f(int, short);
void main()
{
int i = 100;
short s = 12;
short *p = &s;
__________ ; // call to f()
}
Which one of the following expressions, when placed in the blank above, will NOT result in a type checking error?
a) f(s, *s)
b) i = f(i,s)
c) f(i,*s)
d) f(i,*p)
Functions is the correct answer.
Ques 20COA
The stage delays in a 4-stage pipeline are 800, 500, 400 and 300 picoseconds. The first stage (with delay 800 picoseconds) is replaced with a functionally equivalent design involving two stages with respective delays 600 and 350 picoseconds. The throughput increase of the pipeline is _______ percent.
a is the correct answer.
Ques 21COA
The size of the data count register of a DMA controller is 16 bits. The processor needs to transfer a file of 29,154 kilobytes from disk to main memory. The memory is byte addressable. The minimum number of times the DMA controller needs to get the control of the system bus from the processor to transfer the file from the disk to main memory is _________
a is the correct answer.
Ques 22COA
A processor can support a maximum memory of 4 GB, where the memory is word-addressable (a word consists of two bytes). The size of the address bus of the processor is at ____ least bits.
a is the correct answer.
Ques 23Compiler
Consider the following code segment.
y = x * v;
x = y + w;
y = t - z;
y = x * y;
The minimum number of total variables required to convert the above code segment to static single assignment form is ____
a is the correct answer.
Ques 24Compiler
Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals
{S, A} and terminals {a, b}.
S −→ a { print 2 }
A −→ Sb { print 3 }
Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:
a) 1 3 2
b) 2 2 3
c) 2 3 1
d) Syntax Error
SDT is the correct answer.
Ques 25Computer Network
A sender uses the Stop-and-Wait ARQ protocol for reliable transmission of frames. Frames are of size 1000 bytes and the transmission rate at the sender is 80 Kbps (1Kbps = 1000 bits/second). Size of an acknowledgement is 100 bytes and the transmission rate at the receiver is 8 Kbps. The one-way propagation delay is 100 milliseconds. Assuming no frame is lost, the sender throughput is __________ bytes/second.
a is the correct answer.
Ques 26Computer Network
An IP datagram of size 1000 bytes arrives at a router. The router has to forward this packet on a link whose MTU (maximum transmission unit) is 100 bytes. Assume that the size of the IP header is 20 bytes. The number of fragments that the IP datagram will be divided into for transmission is________
a is the correct answer.
Ques 27Computer Network
For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of 1 megabyte and the maximum output rate is 20 megabytes per second. Tokens arrive at a rate to sustain output at a rate of 10 megabytes per second. The token bucket is currently full and the machine needs to send 12 megabytes of data. The minimum time required to transmit the data is _________________ seconds.
a is the correct answer.
Ques 28Computer Network
Consider that B wants to send a message m that is digitally signed to A. Let the pair of private
and public keys for A and B be denoted by K-x
and K+x
for x = A,B, respectively. Let Kx(m)
represent the operation of encrypting m with a key Kx and H(m) represent the message digest.
Which one of the following indicates the CORRECT way of sending the message m along
with the digital signature to A?
a) {m,K+B (H(m))}
b) {m,K-B (H(m))}
c) {m,K-A (H(m))}
d) {m,K+A (H(m))}
Cryptography is the correct answer.
Ques 29Computer Network
Which of the following is/are example(s) of stateful application layer protocols?
(i) HTTP
(ii) FTP
(iii) TCP
(iv) POP3
a) (i) and (ii) only
b) (ii) and (iii) only
c) (ii) and (iv) only
d) (iv) only
Protocal is the correct answer.
Ques 30Computer Network
Which one of the following protocols is NOT used to resolve one form of address to another one?
a) DNS
b) ARP
c) DHCP
d) RARP
IP Address is the correct answer.
Ques 31Computer Network
Which one of the following protocols is NOT used to resolve one form of address to another one?
a) DNS
b) ARP
c) DHCP
d) RARP
IP Address is the correct answer.
Ques 32DAA
The worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are:
a) Θ(n log n), Θ(n log n) and Θ(n2)
b) Θ(n2), Θ(n22) and Θ(n Log n)
c) Θ(n2), Θ(n log n) and Θ(n log n)
d) Θ(n2), Θ(n log n) and Θ(n2)
Complexity is the correct answer.
Ques 33Data Structure
Let Q denote a queue containing sixteen numbers and S be an empty stack. Head(Q) returns
the element at the head of the queue Q without removing it from Q. Similarly Top(S) returns
the element at the top of S without removing it from S. Consider the algorithm given below.
if S is Empty OR Top(S) ≤ Head(Q) then
x := Dequeue(Q);
Push(S, x);
else
x := Pop(S);
Enqueue(Q, x);
end
end
The maximum possible number of iterations of the while loop in the algorithm is_____
a is the correct answer.
Ques 34Data Structure
Let G be a complete undirected graph on 4 vertices, having 6 edges with weights being 1, 2, 3, 4, 5, and 6. The maximum possible weight that a minimum weight spanning tree of G can have is_____
a is the correct answer.
Ques 35Data Structure
G = (V, E) is an undirected simple graph in which each edge has a distinct weight, and e is a particular edge of G. Which of the following statements about the minimum spanning trees (MSTs) of G is/are TRUE
I. If e is the lightest edge of some cycle in G,
then every MST of G includes e
II. If e is the heaviest edge of some cycle in G,
then every MST of G excludes e
a) I only
b) II only
c) both I and II
d) neither I nor II
Graph Theory is the correct answer.
Ques 36Data Structure
An operator delete(i) for a binary heap data structure is to be designed to delete the item in the i-th node. Assume that the heap is implemented in an array and i refers to the i-th index of the array. If the heap tree has depth d (number of edges on the path from the root to the farthest leaf), then what is the time complexity to re-fix the heap efficiently after the removal of the element?
a) O(1)
b) O(d) but not O(1)
c) O(2d) but not O(d)
d) O(d2d) but not O(2d)
Binary Heap is the correct answer.
Ques 37Data Structure
What will be the output of the following C program?
{
static int d = 1;
printf("%d ", n);
printf("%d ", d);
d++;
if(n > 1) count(n-1);
printf("%d ", d);
}
int main()
{
count(3);
}
a) 3 1 2 2 1 3 4 4 4
b) 3 1 2 1 1 1 2 2 2
c) 3 1 2 2 1 3 4
d) 3 1 2 1 1 1 2
C code is the correct answer.
Ques 38Data Structure
What will be the output of the following C program?
{
static int d = 1;
printf("%d ", n);
printf("%d ", d);
d++;
if(n > 1) count(n-1);
printf("%d ", d);
}
int main()
{
count(3);
}
a) 3 1 2 2 1 3 4 4 4
b) 3 1 2 1 1 1 2 2 2
c) 3 1 2 2 1 3 4
d) 3 1 2 1 1 1 2
C code is the correct answer.
Ques 39Data Structure
Let G be a weighted connected undirected graph with distinct positive edge weights. If every edge weight is increased by the same value, then which of the following statements is/are TRUE?
Q: Shortest path between any pair of vertices does not change
a) P only
b) Q only
c) Both P and Q
d) Neither P nor Q
Graph Theory is the correct answer.
Ques 40Data Structure
A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT (n refers to the number of items in the queue)?
a) Both operations can be performed in O(1) time
b) At most one operation can be performed in O(1) time but the worst case time for the other operation will be Ω(n)
c) The worst case time complexity for both operations will be Ω(n)
d) Worst case time complexity for both operations will be Ω(logn)
Queue is the correct answer.
Ques 41DBMS
Consider the following two phase locking protocol. Suppose a transaction T accesses (for read or write operations), a certain set of objects {O1,...,Ok}. This is done in the following manner:
Step 1. T acquires exclusive locks to O1,...,Ok in increasing order of their addresses.
Step 2. The required operations are performed.
Step 3. All locks are released.
This protocol will
a) guarantee serializability and deadlock-freedom
b) guarantee neither serializability nor deadlock-freedom
c) guarantee serializability but not deadlock-freedom
d) guarantee deadlock-freedom but not serializability
Transactions is the correct answer.
Ques 42DBMS
A database of research articles in a journal uses the following schema.
(VOLUME, NUMBER, STARTPGE, ENDPAGE, TITLE, YEAR, PRICE)
The primary key is (VOLUME, NUMBER, STARTPAGE, ENDPAGE) and the following functional dependencies exist in the schema.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> TITLE
(VOLUME, NUMBER) -> YEAR
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> PRICE
The database is redesigned to use the following schemas.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)
(VOLUME, NUMBER, YEAR)
Which is the weakest normal form that the new database satisfies, but the old one does not?
a) 1NF
b) 2NF
c) 3NF
d) BCNF
Normalization is the correct answer.
Ques 43DBMS
Which one of the following is NOT a part of the ACID properties of database transactions?
a) Atomicity
b) Consistency
c) Isolation
d) Deadlock-freedom
Transactions is the correct answer.
Ques 44DBMS
Which of the following is NOT a superkey in a relational schema with attributes V, W, X, Y, Z and primary key V Y ?
a) V X Y Z
b) V W X Z
c) V W X Y
d) V W X Y Z
Superkeys is the correct answer.
Ques 45Digital Logic
We want to design a synchronous counter that counts the sequence 0-1-0-2-0-3 and then repeats. The minimum number of J-K flip-flops required to implement this counter is
a is the correct answer.
Ques 46Digital Logic
The 16-bit 2’s complement representation of an integer is 1111 1111 1111 0101; its decimal representation is
a is the correct answer.
Ques 47Digital Logic
Consider a carry lookahead adder for adding two n-bit integers, built using gates of fan-in at most two. The time to perform addition using this adder is
a) Θ(1)
b) Θ(log (n))
c) Θ(√ n)
d) Θ(n)
Full Adder is the correct answer.
Ques 48Digital Logic
Consider the Boolean operator # with the following properties:
x#0 = x, x#1 = x', x#x = 0 and x#x'= 1
Then x#y is equivalent to
a) x'y + xy'
b) xy' + (xy)
c) x'y + xy
d) xy + (xy)'
Boolean operator is the correct answer.
Ques 49Discrete Mathematics
Consider the recurrence relation
a1 = 8, an = 6n2 + 2n + an-1.
Let a99 = k x 104.
The value of K is _____
a is the correct answer.
Ques 50Discrete Mathematics
Let p, q, r, s represent the following propositions.
p: {8, 9, 10, 11, 12}
q: x is a composite number
r: x is a perfect square
s: x is a prime number
The integer x ≥ 2 which satisfies ¬((p ⇒ q)∧(¬r∨ ¬s)) is .
a is the correct answer.
Ques 51Discrete Mathematics
Let an be the number of n-bit strings that do NOT contain two consecutive 1s. Which one of the following is the recurrence relation for an?
a) an = an−1 +2an-2
b) an= an−1 +an-2
c) an= 2an−1 +an-2
d) an= 2an−1 +2an-2
Recurrence Relation is the correct answer.
Ques 52Mathematics
Consider the following experiment.
Step 1. Flip a fair coin twice.
Step 2. If the outcomes are (TAILS, HEADS) then output Y and stop.
Step 3. If the outcomes are either (HEADS, HEAD) or (HEADS, TAILS), then output N and stop.
Step 4. If the outcomes are (TAILS, TAILS), then go to Step 1.
The probability that the output of the experiment is Y is (up to two decimal places).
a is the correct answer.
Ques 53Mathematics
A function f : N+ → N+, defined on the set of positive integers N+, satisfies the following
properties:
f(n) = f(n/2) if nis even
f(n) = f(n+5) if nis odd
Let R = {i|∃ j : f(j) = i} be the set of distinct values that f takes. The maximum possible size
of R is .
a is the correct answer.
Ques 54Mathematics
The coefficient of x12 in (x3 + x4 + x5 + x6 + ...)3 is_________
a is the correct answer.
Ques 55Mathematics
Two eigenvalues of a 3 x 3 real matrix P are (2 + √ -1) and 3. The determinant of P is _____
a is the correct answer.
Ques 56Mathematics
A probability density function on the interval [a, 1] is given by 1 / x2 and outside this interval the value of the function is zero. The value of a is :
a is the correct answer.
Ques 57Mathematics
If f(x) = 2x7 + 3x - 5 Which of the following is a factor of f(x)?
a) (x3 + 8)
b) (x - 1)
c) (2x - 5)
d) (x + 1)
Quardratic Equation is the correct answer.
Ques 58OS
Consider a computer system with ten physical page frames. The system is provided with an access sequence a1, a2, ..., a20, a1, a2, ..., a20), where each ai number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is __________
a is the correct answer.
Ques 59OS
Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these requests is______
a is the correct answer.
Ques 60OS
Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one-level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is _________megabytes.
a is the correct answer.
Ques 61OS
Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready queue?
a) Shortest remaining time first
b) Round-robin with time quantum less than the shortest CPU burst
c) Uniform random
d) Highest priority first with priority proportional to CPU burst length
Scheduling Algorithm is the correct answer.