GATE / CS ARCHIVE

PAPER / ORIGINAL ORDER

GATE 2014 · Set 2

65 questions

Paper analysis: marks by subject, top topics and repeated questions →

03:00:00
1 mark · MCQ
Report issue

Vocabulary & Verbal Analogies

Question 1, GATE 2014: Complete the sentence with the most appropriate reason: “India is a post-colonial country because …”. A It was a former British colony. B Indian Information Technology professionals have colonized the world. C India does not follow any colonial practices. D India has helped other countries gain freedom.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. Interpret the compound adjective before considering the choices: “post” means after, and “colonial” refers to a period of colonial rule.

2. Derive the result. Post-colonial describes the period after colonial rule. India was a British colony, so A supplies the relevant historical reason. The other options do not define this term.

3. Check the interpretation. Do not confuse a historical classification with a claim that all colonial practices have disappeared. C is stronger than the definition, while B and D concern unrelated activities.

Original paper, page 28 · Answer key

1 mark · MCQ
Report issue

English Grammar & Usage

Question 2, GATE 2014: Fill the blank: “Who ______ was coming to see us this evening?” A you said; B did you say; C did you say that; D had you said.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Set up the reasoning. Identify the outer question as “Who did you say …?” and the embedded clause as “… was coming to see us this evening”. The missing words must fit both clauses.

2. Derive the result. The natural question is Who did you say was coming to see us this evening? The auxiliary did forms the main question, while who supplies the subject of was coming. Thus B.

3. Check the interpretation. In this construction, who is the subject of the embedded verb was coming. Inserting that immediately before that subject gap is not the standard form intended by the question; the interrogative auxiliary belongs with say.

Original paper, page 28 · Answer key

1 mark · MCQ
Report issue

Vocabulary & Verbal Analogies

Question 3, GATE 2014: Match words 1 eradicate, 2 distort, 3 saturate, 4 utilize to meanings P misrepresent, Q soak completely, R use, S destroy utterly. A 1:S,2:P,3:Q,4:R; B 1:P,2:Q,3:R,4:S; C 1:Q,2:R,3:S,4:P; D 1:S,2:P,3:R,4:Q.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. Resolve the least ambiguous pairs first: utilize means use, and saturate means soak completely. These require 4:R and 3:Q.

2. Derive the result. Eradicate means destroy utterly; distort means misrepresent; saturate means soak completely; utilize means use. Hence1-S, 2-P, 3-Q, 4-R, option A.

3. Check the interpretation. A useful elimination check is that A and D agree on the first two pairs, so the meanings of saturate and utilize distinguish them. Check all four matches rather than selecting a choice from just one familiar word.

Original paper, page 28 · Answer key

1 mark · MCQ
Report issue

Arithmetic, Ratios & Percentages

Question 4, GATE 2014: Find the average of all multiples of 10 between 2 and 198. A 90; B 100; C 110; D 120.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Set up the reasoning. The eligible endpoints are 10 and 190, not 2 and 198. There are 19 equally spaced terms, so use the arithmetic-progression mean rather than enumerating a large sum.

2. Derive the result. The multiples are 10, 20,..., 190, an arithmetic progression. Its mean is(10+190)/2=100, B.

3. Check the interpretation. Pair 10 with 190, 20 with 180, and so on: every pair has mean 100 and the unpaired middle term is also 100. This verifies the result independently of the summation formula.

Original paper, page 28 · Answer key

1 mark · MCQ
Report issue

Algebra, Equations & Number Patterns

Question 5, GATE 2014: Evaluate the infinite nested radical sqrt(12+sqrt(12+sqrt(12+…))). A 3.464; B 3.932; C 4.000; D 4.444.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. Let x1=sqrt(12) and x(k+1)=sqrt(12+xk). Establish that these finite approximations increase and stay below 4 before replacing the infinite tail by its limit.

2. Derive the result. Finite nested radicals form an increasing sequence bounded by 4, since x≤4 implies√(12+x)≤4. Its limit L satisfies L=√(12+L), or(L−4)(L+3)=0. Nonnegativity selects 4, C.

3. Check the interpretation. Solving the resulting quadratic alone produces both 4 and -3. A radical cannot be negative, so the negative algebraic root is extraneous. Convergence is what makes substitution of the infinite tail legitimate.

Original paper, page 28 · Answer key

2 marks · MCQ
Report issue

Reading Comprehension & Verbal Reasoning

Question 6, GATE 2014: A passage says Koenigsberg had a German-majority population before World War 2. Now called Kaliningrad, it is Russian territory with a predominantly Russian population, bordered by the Baltic Sea to the north, Poland to the south and west, and Lithuania to the east. What follows? A It was historically Russian in ethnicity. B It belongs to Russia although it is not contiguous with the rest of Russia. C Kaliningrad was its original Russian name. D Poland and Lithuania are on the route from Kaliningrad to the rest of Russia.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Set up the reasoning. Separate the stated historical, political, and geographic facts. Being politically Russian does not require sharing a land boundary with the rest of Russia.

2. Derive the result. The passage identifies the area as Russian while listing sea and other countries around it, supporting its geographical separation from the rest of Russia, B. It does not establish an original Russian name or historical Russian majority.

3. Check the interpretation. A conflicts with the supplied pre-war majority. C invents a naming history. D asserts a particular route not established by the passage. B is the intended inference from the surrounding sea and named foreign countries.

Original paper, page 28 · Answer key

2 marks · MCQ
Report issue

Reading Comprehension & Verbal Reasoning

Question 7, GATE 2014: North India's diagnosed dengue cases have doubled since last year. Municipal authorities conclude mosquito-control measures failed. Which statement, if true, does NOT contradict this conclusion? A Many affected people returned from neighboring dengue-prevalent countries. B More cases are reported because municipal administration is more efficient. C A new effective diagnostic test detects many more cases. D Cases of malaria, another mosquito-borne disease, have increased this year.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Set up the reasoning. Distinguish an increase in locally acquired disease from an increase in recorded diagnoses. Imported infections, better reporting, and improved tests can raise recorded dengue counts without greater local mosquito exposure.

2. Derive the result. A rise in another mosquito-borne illness supports, rather than undermines, the failure-of-control explanation. Imported infections and better reporting/testing provide alternative explanations for the dengue count. Thus D is the intended answer. Here contradict is used loosely as weaken: A–C do not logically rule out simultaneous local control failure.

3. Check the interpretation. The question's “does not contradict” should be read as “does not weaken” in this reasoning exercise. D is corroborative, not proof of causation; none of A-C logically excludes local mosquito-control failure occurring at the same time.

Original paper, page 29 · Answer key

2 marks · MCQ
Report issue

Algebra, Equations & Number Patterns

Question 8, GATE 2014: For real x satisfying abs(x²-2x+3)=11, which pair gives possible values of abs(-x³+x²-x)? A 2,4; B 2,14; C 4,52; D 14,52.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Set up the reasoning. Complete the square inside the first absolute value. Since (x-1)²+2 is strictly positive, only the equation x²-2x+3=11 is possible, not its negative counterpart.

2. Derive the result. x²−2x+3=(x−1)²+2 is positive, so x²−2x+3=11 gives x=4 or−2. Substitution into|−x³+x²−x| gives 52 or 14, respectively, D.

3. Check the interpretation. Retain both roots x=4 and x=-2. At x=-2 the cubic expression is 8+4+2=14; at x=4 it is -64+16-4=-52, whose absolute value is 52.

Original paper, page 29 · Answer key

2 marks · NAT
Report issue

Data Interpretation & Logical Reasoning

Question 9, GATE 2014: A graph gives the male:female enrollment ratio as 2.5 in 2008, 3.0 in 2009, 2.0 in 2010, 1.0 in 2011, and 1.5 in 2012. If female enrollment doubled in 2009 relative to 2008, find the percentage increase in male enrollment in 2009.
Tap to enlarge
Answer & solution

Official answer: 140

1. Set up the reasoning. Use an arbitrary initial female count F; ratios alone do not give absolute enrollment. Convert each ratio into a male count using the female count in the same year.

2. Derive the result. Let female enrollment in 2008 be F. Male enrollment was 2.5F. In2009 females became2F and the ratio became3, so males became6F. The relative increase is(6−2.5)/2.5=1.4, or 140%.

3. Check the interpretation. The ratio rises by 20%, but male enrollment rises by a factor 1.2×2=2.4 because the denominator also doubles. A 2.4-fold final count means a 140% increase, not 240%.

Original paper, page 29 · Answer key

2 marks · MCQ
Report issue

Geometry & Spatial Aptitude

Question 10, GATE 2014: Among the following times between 6 a.m. and 7 a.m., when is the angle between the clock hands closest to 60 degrees? A 6:22 a.m.; B 6:27 a.m.; C 6:38 a.m.; D 6:45 a.m.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. At 6:m, the hour hand is at 180+0.5m degrees from 12 and the minute hand at 6m degrees. Their relative angular speed is 5.5 degrees per minute.

2. Derive the result. At6: m the unwrapped hand difference is|180−5.5m| degrees. For m=22, 27, 38, 45 the smaller angles are 59, 31.5, 29, 67.5 degrees. The closest to 60 is 59 at 6: 22, A.

3. Check the interpretation. Evaluate the listed choices rather than rounding an exact solution arbitrarily. Their deviations from 60 degrees are 1, 28.5, 31, and 7.5 degrees respectively, making A the closest.

Original paper, page 29 · Answer key

1 mark · NAT
Report issue

Probability & Random Variables

Question 1, GATE 2014: An office security system has 10 computers, exactly 4 working. Four are inspected uniformly at random without replacement. The system is declared functional if at least 3 inspected computers work. If this probability is p, find 100p.
Tap to enlarge
Answer & solution

Official answer: 11.85 to 11.95

Our answer: 11.9047619

1. Set up the reasoning. Use a hypergeometric count because selections are without replacement. A successful sample has either exactly three working computers and one failed computer, or four working computers.

2. Derive the result. There are C(10, 4)=210 equally likely subsets. Favorable subsets contain 3 working and 1 failed computer, C(4, 3)C(6, 1)=24, or all 4 working, one more. Thus p=25/210 and 100p≈11.9048, inside the key interval.

3. Check the interpretation. The two favorable cases are disjoint, so add their counts. Do not use four independent trials with success probability 4/10: the composition changes after each draw. The question requests the percentage-scale number 100p, not p.

Original paper, page 30 · Answer key

1 mark · NAT
Report issue

Probability & Random Variables

Question 2, GATE 2014: Each of the nine words in “The quick brown fox jumps over the lazy dog” is written on its own slip. One of the nine slips is chosen uniformly. Find the expected word length, rounded to one decimal place.
Tap to enlarge
Answer & solution

Official answer: 3.8 to 3.9

Our answer: 3.9

1. Set up the reasoning. Every slip has probability 1/9, including both occurrences of the word the. Count letters in each word and use the probability-weighted average.

2. Derive the result. The nine word lengths are 3, 5, 5, 3, 5, 4, 3, 4, 3, totaling 35. Uniform selection gives expectation 35/9≈3.8889, rounded to one decimal place 3.9.

3. Check the interpretation. The random choice is of words, not individual letters and not distinct word spellings. Therefore repeated words must retain their separate slips in the denominator and numerator.

Original paper, page 30 · Answer key

1 mark · NAT
Report issue

Graph Theory

Question 3, GATE 2014: What is the maximum number of edges in a bipartite graph with 12 vertices?
Tap to enlarge
Answer & solution

Official answer: 36

1. Set up the reasoning. For a simple bipartite graph with partition sizes a and b, edges can join only opposite parts. Thus at most ab edges exist, with equality for the complete bipartite graph.

2. Derive the result. If the two parts have a and 12−a vertices, at most a(12−a)=36−(a−6)² edges are possible. K6, 6 attains 36. This is the standard simple-graph convention.

3. Check the interpretation. The total-vertex constraint a+b=12 makes the product largest when the parts are balanced. Exhibiting K6,6 is necessary to show the upper bound 36 can actually be attained; a general complete graph is not bipartite.

Original paper, page 30 · Answer key

1 mark · NAT
Report issue

Linear Algebra

Question 4, GATE 2014: The matrix A is the outer product of column vector (2,-4,7)ᵀ and row vector (1,9,5). Find det(A).
Tap to enlarge
Answer & solution

Official answer: 0

1. Set up the reasoning. Expand the product conceptually as rows (2,18,10), (-4,-36,-20), and (7,63,35). Each row is a scalar multiple of (1,9,5).

2. Derive the result. The matrix is the outer product of a 3-vector and a row3-vector, so its rank is 1. A3×3 rank-deficient matrix has determinant 0.

3. Check the interpretation. A determinant is zero whenever rows are linearly dependent. There is no need to expand nine cofactors, and det(uvᵀ) is not a product of ordinary determinants of the nonsquare factors.

Original paper, page 30 · Answer key

1 mark · MCQ
Report issue

Other / Mixed Topics

Question 5, GATE 2014: A nonzero cubic polynomial f(x) has roots 1, 2, and 3. Which must hold? A f(0)f(4)<0; B f(0)f(4)>0; C f(0)+f(4)>0; D f(0)+f(4)<0.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. All three roots exhaust the degree, so f(x)=c(x-1)(x-2)(x-3) for a nonzero real leading coefficient c. Keep c symbolic because its sign is unspecified.

2. Derive the result. Write f(x)=c(x−1)(x−2)(x−3), where real c≠0. Then f(0)=−6c and f(4)=6c, whose product is−36c²<0. Their sum is 0, so only A is forced.

3. Check the interpretation. The two endpoint values have opposite signs regardless of c, but their sum is exactly zero. Thus neither positive-sum nor negative-sum statements can be forced by the roots alone.

Original paper, page 30 · Answer key

1 mark · MCQ
Report issue

Boolean Algebra & Logic Gates

Question 6, GATE 2014: The dual Fᴰ of a Boolean expression F(x1,…,xn,+,·,′) swaps OR and AND. F is self-dual if F=Fᴰ. How many self-dual n-variable Boolean functions are there? A 2^n; B 2^(n-1); C 2^(2^n); D 2^(2^(n-1)).
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Set up the reasoning. Use the truth-table characterization F(x)=NOT F(NOT x). For n≥1, every input bit vector is paired with a different bitwise-complement vector.

2. Derive the result. By Boolean duality, self-duality means F(x)=¬F(¬x). The2n assignments partition into 2n−1 complementary pairs. Choosing either value on one member determines the opposite value on its partner independently, giving 2^(2n−1) functions, D.

3. Check the interpretation. There are 2n-1 pairs, not n pairs. Each pair permits two independent output assignments, 01 or 10; exponentiating two by the number of pairs gives the function count rather than the number of truth-table rows.

Original paper, page 30 · Answer key

1 mark · MCQ
Report issue

Counters & Timing

Question 7, GATE 2014: Let k=2^n. Feed an n-bit binary counter into an n-to-2^n decoder. The resulting circuit is equivalent to which counter? A k-bit binary up; B k-bit binary down; C k-bit ring; D k-bit Johnson.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. For each binary counter state, the decoder raises exactly the corresponding one of its k outputs. Advancing the binary state moves this single active output to the next position.

2. Derive the result. The decoder activates exactly one of k=2n outputs for each binary count. As the count cycles, the active position circulates through the k outputs, matching the one-hot sequence of a k-bit ring counter, C.

3. Check the interpretation. A ring counter circulates a one-hot pattern through k positions. A k-bit binary counter has 2k states and a Johnson counter normally has 2k states, unlike this decoder's k-state one-hot cycle.

Original paper, page 31 · Answer key

1 mark · NAT
Report issue

Number Systems & Computer Arithmetic

Question 8, GATE 2014: In the numeral equation (123) base 5 = (x8) base y, x is a leading digit and y is an integer base. How many pairs (x,y) are possible?
Tap to enlarge
Answer & solution

Official answer: 3

Step through it (9 steps)

1. Set up the reasoning. Convert the known numeral to decimal: 1×5²+2×5+3=38. The other numeral equals xy+8, so admissible pairs must satisfy xy=30.

2. Derive the result. (123)₅=25+10+3=38, so xy+8=38 and xy=30. A valid base y>8 and a leading digit 1≤x<y leave(x, y)=(1, 30),(2, 15),(3, 10). Thus3 solutions.

3. Check the interpretation. Digit validity is essential: the digit 8 requires y≥9, and x must satisfy 1≤x<y. Check the factor pairs of 30 against these constraints rather than counting every factorization.

Original paper, page 31 · Answer key

1 mark · NAT
Report issue

Cache Memory

Question 9, GATE 2014: A 16 KB cache is 4-way set associative. A block contains 8 words, each 32 bits. Physical address space is 4 GB. Find the number of tag bits.
Tap to enlarge
Answer & solution

Official answer: 20

Step through it (7 steps)

1. Set up the reasoning. Use the textbook binary KB/GB and byte-addressing convention. Convert words to bytes first: one line has 8×4=32 bytes; compute line count, set count, and their base-two logarithms.

2. Derive the result. A block is 8×4=32 bytes, requiring 5 offset bits. The cache has 16384/32=512 lines and 128 sets, requiring 7 index bits. A4GB byte address is 32 bits, leaving 32−7−5=20 tag bits.

3. Check the interpretation. Do not allocate only three offset bits: those identify the eight words but miss the two byte-within-word bits. The tag, set index, and byte offset together must total the 32 physical-address bits.

Original paper, page 31 · Answer key

1 mark · NAT
Report issue

Control Flow & Loop Tracing

Question 10, GATE 2014: For the C function int func(int num){int count=0; while(num){count++; num>>=1;} return count;}, find func(435).
Tap to enlarge
Answer & solution

Official answer: 9

1. Set up the reasoning. The input is positive, so repeated right shifts discard low bits until the most significant 1 has also been shifted away. The return value is binary length, not population count.

2. Derive the result. For positive num, each right shift divides by 2 and discards the remainder. The sequence 435, 217, 108, 54, 27, 13, 6, 3, 1 has 9 nonzero values before 0, so the loop returns 9.

3. Check the interpretation. Since 28≤435<29, exactly nine shifts are needed. This gives a compact independent check of the explicit sequence and avoids confusing shifts-to-zero with the number of set bits.

Original paper, page 31 · Answer key

1 mark · MCQ
Report issue

Expressions, Operators & Types

Question 11, GATE 2014: Unsigned int variables n and p are used in C to compute p=n choose 3. For large n, which statement is most likely to work correctly? A p=n*(n-1)*(n-2)/6; B p=n*(n-1)/2*(n-2)/3; C p=n*(n-1)/3*(n-2)/2; D p=n*(n-1)*(n-2)/6.0;
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Set up the reasoning. Consider two separate hazards: overflow of intermediate unsigned products and truncation by integer division. Adjacent integers n and n-1 always have an even product, permitting an exact early division by two.

2. Derive the result. B divides the always-even product n(n−1) by 2 before multiplying by n−2, reducing intermediate magnitude without truncation. The final division by 3 is exact for the integer binomial product. A and D form the larger full product before division, while C may divide n(n−1) by 3 prematurely, truncating when n≡2 mod3. B is less overflow-prone, not guaranteed correct for arbitrarily large unsigned n; even its intermediate can wrap.

3. Check the interpretation. Multiplication and division associate left to right. The final floating divisor in D does not retroactively convert preceding integer products to floating point. B mitigates risk but cannot guarantee correctness for every representable n or for results too large to fit p.

Original paper, page 31 · Answer key

1 mark · MCQ
Report issue

Heaps & Priority Queues

Question 12, GATE 2014: A max-heap initially has level order 10,8,5,3,2. Insert 1 and then 7. What is the new level order? A 10,8,7,3,2,1,5; B 10,8,7,2,3,1,5; C 10,8,7,1,2,3,5; D 10,8,7,5,3,2,1.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (5 steps)

1. Set up the reasoning. Represent the heap as a one-based array. Append each item at the first available position to preserve the complete-tree shape, then compare it only with its ancestors while restoring max-heap order.

2. Derive the result. Appending1 puts it below 5 and requires no swap. Appending7 puts it below 5, so exchange 7 and 5; 7 is below root10 and stops. The resulting level order is 10, 8, 7, 3, 2, 1, 5, A.

3. Check the interpretation. Heap insertion does not sort an entire level. Inserting 7 affects the path through its parent 5; it does not exchange the existing siblings 3 and 2. This distinguishes A from other arrays that might still satisfy some heap inequalities.

Original paper, page 32 · Answer key

1 mark · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 13, GATE 2014: Solve asymptotically T(n)=2T(n/2)+log n with T(1)=1. A Θ(n); B Θ(n log n); C Θ(n²); D Θ(log n).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. Apply the Master theorem with a=2 and b=2: nlogb a=n. The extra work log n grows polynomially more slowly than n, for example log n=O(n1/2).

2. Derive the result. For T(n)=2T(n/2)+log n, the leaf contribution is n. At level i, extra cost is 2i(log₂n−i); its total over levels is O(n). Equivalently log n is polynomially smaller than n in the Master theorem. Therefore T(n)=Θ(n), A.

3. Check the interpretation. There are n constant-cost leaves, which already force an Ω(n) lower bound. The logarithmic work is not multiplied by n at every level; subproblem sizes shrink, and summing the level costs gives O(n).

Original paper, page 32 · Answer key

1 mark · MCQ
Report issue

Graph Algorithms

Question 14, GATE 2014: Run BFS from W in a connected, undirected, unweighted graph and retain its tree edges in T. This tree supports which task? A shortest paths between every vertex pair; B shortest paths from W to every vertex; C shortest paths from W only to leaves of T; D a longest path in the graph.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Set up the reasoning. BFS assigns a vertex to the earliest reachable distance layer. When a vertex is first discovered, its parent is one layer closer to W, so following parents yields a path of exactly that shortest distance.

2. Derive the result. BFS explores vertices in increasing edge-distance from W. Parent pointers in the BFS tree therefore reconstruct a shortest path from W to every vertex. They need not preserve shortest paths between arbitrary other pairs. Thus B.

3. Check the interpretation. The guarantee is rooted at W and covers internal vertices as well as leaves. A non-tree edge may shorten the route between two other vertices, so one BFS tree is not an all-pairs shortest-path representation.

Original paper, page 32 · Answer key

1 mark · MCQ
Report issue

Regular Expressions & Languages

Question 15, GATE 2014: Let L1={a^n:n≥0} and L2={b^n:n≥0}. Statements: I L1·L2 is regular; II L1·L2={a^n b^n:n≥0}. Which are correct? A only I; B only II; C both; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. The variable n in each set definition is locally bound. Concatenation independently chooses any word from L1 and any word from L2, so it does not require their lengths to agree.

2. Derive the result. The concatenation is a*b*: choose the number of a symbols and the number of b symbols independently. This is regular, but it includes ab² and so is not the equal-count language. Only I holds, A.

3. Check the interpretation. The regular expression a*b* describes the concatenation. The witness abb belongs to it but not to the equal-count language in II, immediately separating the two claims.

Original paper, page 32 · Answer key

1 mark · MCQ
Report issue

Decidability & Computability

Question 16, GATE 2014: Write A≤mB for a computable many-to-one reduction from language A to B. Which claim is false? A If A≤mB and B is recursive, A is recursive. B If A≤mB and A is undecidable, B is undecidable. C If A≤mB and B is recursively enumerable, A is recursively enumerable. D If A≤mB and B is not recursively enumerable, A is not recursively enumerable.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Set up the reasoning. A reduction f satisfies x∈A iff f(x)∈B and halts on every input. Compose f with a decider or recognizer for B to transfer positive algorithmic properties backward to A.

2. Derive the result. A computable mapping followed by a decider or recognizer for B supplies the corresponding algorithm for A, proving A and C; B is the contrapositive of A. D reverses this implication. For example, an empty decidable language can reduce by a constant map to a fixed nonmember of a non-r.e. language. Thus D is false.

3. Check the interpretation. Hardness transfers forward: if A is undecidable then B cannot be decidable. It does not transfer backward from a hard B to an easy A. For D, choose A empty and map every input to one fixed nonmember of a non-r.e. B.

Original paper, page 32 · Answer key

1 mark · MCQ
Report issue

Parsing & Syntax Analysis

Question 17, GATE 2014: Grammar: S→T*P; T→U or T*U; P→Q+P or Q; Q→Id; U→Id. Which associativity statement is true? A + left, * right; B + right, * left; C both right; D both left.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Set up the reasoning. Inspect the recursive side of each operator production. T recurs on the left of *, while P recurs on the right of +.

2. Derive the result. The rule T→T*U is left-recursive and groups multiplication to the left. P→Q+P is right-recursive and groups addition to the right. Thus + is right associative and * left associative, B.

3. Check the interpretation. Expanding T twice gives (Id*Id)*Id, whereas expanding P twice gives Id+(Id+Id). Associativity concerns grouping of repeated operators, not which operator has greater precedence.

Original paper, page 33 · Answer key

1 mark · MCQ
Report issue

Compiler Phases, Linking & Loading

Question 18, GATE 2014: Which is not performed during compilation of a program? A dynamic memory allocation; B type checking; C symbol-table management; D inline expansion.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. Distinguish work done on the source representation by a compiler from operations performed by the compiled program when it runs. A dynamic allocation creates runtime objects whose sizes or lifetimes may depend on execution.

2. Derive the result. Allocation of the running program’s dynamic objects occurs at runtime. Type checking, symbol-table construction and inline expansion are compiler tasks. Thus A. A compiler may itself allocate memory while running, but that is not the intended meaning of program dynamic allocation.

3. Check the interpretation. The compiler may emit allocation calls and itself allocate memory while compiling; those facts do not make allocation of the target program's runtime objects a compilation phase. Type checks, names, and inlining are standard compile-time concerns.

Original paper, page 33 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Software Engineering

Question 19, GATE 2014: Which requirements-engineering statement is true? A A requirements document also describes efficient implementation of its listed requirements. B Functional requirements are always consistent and complete in practice. C Prototyping is a requirements-validation method. D A requirements review is conducted to find errors in system design.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. Requirements validation asks whether the proposed requirements reflect users' actual needs. A prototype allows users to try representative behavior before committing to the full implementation.

2. Derive the result. Prototypes let users and developers test whether proposed requirements match needs, so they are a validation technique. Requirements specify what is wanted, not efficient implementation details; completeness is not guaranteed, and requirement reviews are not primarily design-error reviews. Thus C.

3. Check the interpretation. A confuses requirements with design, B makes an unrealistic guarantee, and D confuses review of requirements with review of a later design. C identifies a practical validation technique without claiming it proves all requirements correct.

Original paper, page 33 · Answer key

1 mark · NAT
Report issue

File Systems

Question 20, GATE 2014: A FAT-based filesystem has 4-byte FAT entries. The disk size is 100×10^6 bytes and the data-block size is 10^3 bytes. Under the stated FAT-overhead model, find the largest file size in units of 10^6 bytes.
Tap to enlarge
Answer & solution

Official answer: 99.55 to 99.65

Our answer: 99.6

1. Set up the reasoning. First count the nominal blocks on the disk, then reserve one four-byte FAT entry per block. The question's units are decimal, so retain powers of 10 rather than substituting powers of 2.

2. Derive the result. The simplified model gives 100×10⁶/10³=100000 disk blocks and one 4-byte FAT entry per block, totaling 400000 bytes. Subtracting FAT space leaves 99.6×10⁶bytes for one file, within the accepted range. This neglects boot sectors, directories, duplicate FAT copies and other metadata, as no such overhead is specified.

3. Check the interpretation. Subtract the specified overhead from disk capacity before converting to millions of bytes. This simplified maximum assumes one file can occupy all remaining data storage and ignores unmentioned directories, boot structures, and redundant FAT copies.

Original paper, page 33 · Answer key

1 mark · NAT
Report issue

Functional Dependencies & Keys

Question 21, GATE 2014: For relation schema R(E,F,G,H), with E as the key, find the maximum number of superkeys.
Tap to enlarge
Answer & solution

Official answer: 8

Our answer: 8 if E is the sole candidate key

1. Set up the reasoning. A superkey uniquely identifies tuples and may contain redundant attributes. Starting from E, independently include or omit each of the three remaining attributes F, G, and H.

2. Derive the result. Every superset of E is a superkey; choosing any subset of F, G, H gives 2³=8. Reading E as the only candidate key gives exactly this count. If it merely says E is one candidate key, additional keys could increase the count, up to all 15 nonempty attribute subsets when every singleton is a key. Thus the official 8 relies on the sole-key reading of the key.

3. Check the interpretation. The intended count treats E as the sole candidate key: E, EF, EG, EH, EFG, EFH, EGH, EFGH. If the phrase only grants that E is one key, other candidate keys are not ruled out; preserve that ambiguity rather than claiming eight follows unconditionally.

Original paper, page 33 · Answer key

1 mark · NAT
Report issue

Functional Dependencies & Keys

Question 22, GATE 2014: STUDENTS has columns StudentID, StudentName, StudentEmail, StudentAge, CPI and rows (2345,Shankar,shankar@math,X,9.4), (1287,Swati,swati@ee,19,9.5), (7853,Shankar,shankar@cse,19,9.4), (9876,Swati,swati@mech,18,9.3), (8765,Ganesh,ganesh@civil,19,8.7). For (StudentName,StudentAge) to be a key of this instance, what value must X NOT equal?
Tap to enlarge
Answer & solution

Official answer: 19

1. Set up the reasoning. Project each row to the proposed key columns. Distinct names cannot collide, so only rows sharing a name need to be compared.

2. Derive the result. The two Shankar rows would have the same(Name, Age) pair if X=19. Other repeated names already have different ages, and neither name nor age alone is unique. Hence X must not equal 19 for the pair to be a key of this instance.

3. Check the interpretation. The two Swati ages already differ. The Shankar ages would coincide at X=19, creating two different rows with the same key pair. Other columns such as unique emails do not repair a collision in the specified pair.

Original paper, page 34 · Answer key

1 mark · MCQ
Report issue

Routing Algorithms

Question 23, GATE 2014: Which statement about RIP and OSPF is true? A RIP uses distance-vector routing; OSPF uses link-state routing. B OSPF uses distance-vector; RIP uses link-state. C both use link-state. D both use distance-vector.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. Classify the information routers exchange: distance-vector protocols communicate distance estimates via neighbors, while link-state protocols advertise local links so routers can reconstruct a topology.

2. Derive the result. RIP exchanges distance vectors and uses hop counts. OSPF floods link-state information and computes shortest paths over topology. Thus A.

3. Check the interpretation. RIP's standard hop-count updates fit the first model. OSPF uses link-state advertisements and shortest-path computation, fitting the second. Both are interior gateway protocols, but that shared role does not imply a shared routing algorithm.

Original paper, page 34 · Answer key

1 mark · MCQ
Report issue

Transport, Congestion Control & Traffic Shaping

Question 24, GATE 2014: Which socket API call changes an unconnected active TCP socket into a passive socket? A connect; B bind; C listen; D accept.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. A server first creates a socket and binds its local address, then marks it as a listener. The change of role occurs before an incoming connection is accepted.

2. Derive the result. listen marks a bound, unconnected TCP socket as passive, ready to receive incoming connection requests. accept then creates a connected socket for one accepted connection; bind sets a local address. Thus C.

3. Check the interpretation. connect initiates an outgoing connection; bind assigns a local endpoint; accept obtains a connected socket for an arriving client. listen is the call that establishes the passive listening role.

Original paper, page 34 · Answer key

1 mark · NAT
Report issue

IP Addressing, Fragmentation & Address Resolution

Question 25, GATE 2014: An IP packet follows the illustrated path from sender S on Ethernet LAN L1, through ISP1 and ISP2, to receiver R on Token-Ring LAN L2. Textual diagram equivalent: the drawn path traverses six forwarding router boxes (including two adjacent boxes at L1's exit), with additional LAN stations shown as non-router symbols. Links inside and between ISPs are point-to-point optical links. Starting TTL is 32. What is the maximum TTL on arrival at R?
Tap to enlarge
Answer & solution

Official answer: 26

1. Set up the reasoning. Count IP forwarding routers rather than hosts, link-layer stations, or physical link segments. Each router must decrement TTL by at least one; maximum remaining TTL uses a decrement of exactly one at every forwarding step.

2. Derive the result. The drawn path crosses six router boxes between the source and receiver, including the LAN-facing router before the first ISP. Each forwarding router reduces TTL by at least 1. Ordinary link-layer traversal does not reduce it, so the maximum final TTL is 32−6=26.

3. Check the interpretation. The Ethernet and Token-Ring media do not by themselves consume TTL. Counting the six boxes on the actual path gives six decrements, so the different LAN technologies do not alter the arithmetic.

Original paper, page 34 · Answer key

2 marks · MCQ
Report issue

Physical Layer & Transmission

Question 26, GATE 2014: A store-and-forward path A→R1→R2→B has three links, each 10^6 bytes/s. A sends a 10^3-byte file as: one packet (time T1), 10 equal payload packets (T2), or 20 equal payload packets (T3). Each packet adds a 100-byte header. Ignore propagation, processing, queuing, errors. Which holds? A T1<T2<T3; B T1>T2>T3; C T2=T3<T1; D T1=T3>T2.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Set up the reasoning. For p equal packets, one packet takes (1000/p+100)/106 seconds per link. Store-and-forward needs three such intervals for the first packet, then one additional interval for each remaining packet.

2. Derive the result. With p equal-sized packets over 3 store-and-forward links, the pipelined time is(p+2) times one packet’s transmission time. T1=3·1100/10⁶=.0033s; T2=12·200/10⁶=.0024s; T3=22·150/10⁶=.0033s. Thus T1=T3>T2, D.

3. Check the interpretation. The pipeline therefore occupies p+2 packet-transmission intervals, not 3p intervals. More packets improve pipelining but increase header overhead; this trade-off explains why twenty packets are not automatically faster than ten.

Original paper, page 35 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Network Security

Question 27, GATE 2014: Q downloads a file over HTTP from H via routers Q→R1→R2→R3→H. Session-layer encryption uses DES with a shared key. Information items: I1 file URL; I2 TCP port numbers at Q and H; I3 IP addresses of Q and H; I4 link-layer addresses of Q and H. By sniffing only at R2, which can an intruder learn? A only I1,I2; B only I1; C only I2,I3; D only I3,I4.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. Track which protocol headers remain visible after encrypting the session payload. The HTTP URL is in the protected content, while TCP and IP routing information must remain available to carry the packet.

2. Derive the result. Session-layer encryption hides the HTTP URL payload, while TCP and IP headers still reveal endpoint ports and IP addresses. Link-layer headers at R2 identify its neighboring hops, not the remote hosts Q and H. Thus I2 and I3 only, C, under the stated encrypted-payload model without cryptanalysis.

3. Check the interpretation. Link-layer addresses change from hop to hop. A frame observed at an intermediate router need not contain either end host's hardware address. The answer assumes the stated encryption model, not successful DES cryptanalysis or other side channels.

Original paper, page 35 · Answer key

2 marks · MCQ
Report issue

Application Protocols

Question 28, GATE 2014: A graphical browser at client Q loads an uncached static HTML page from HTTP server S. The page contains exactly one separate static embedded image, also on S. Which is correct for loading both? A At least two HTTP requests, necessarily on separate TCP connections. B At least two HTTP requests, but one TCP connection suffices. C One HTTP request suffices, and one TCP connection is necessary. D One HTTP request suffices without a TCP connection.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Set up the reasoning. The document and separately referenced image are two resources. A browser first obtains HTML and then requests the image URL, but a persistent HTTP connection can carry multiple requests.

2. Derive the result. The HTML document and its separate image require two HTTP requests when neither is cached. HTTP persistent connections can carry both requests on one TCP connection. Thus B under the conventional separate-resource HTTP-over-TCP model.

3. Check the interpretation. Do not equate request count with connection count. The intended conventional HTTP-over-TCP setting permits connection reuse, so one connection is sufficient even though one request is not.

Original paper, page 36 · Answer key

2 marks · MCQ
Report issue

Transactions & Concurrency Control

Question 29, GATE 2014: Schedule S, in chronological order: T2 reads X; T3 writes X and commits; T1 writes X and commits; T2 writes Y, reads Z, and commits; T4 reads X, reads Y, and commits. Classify S. A conflict-serializable, not recoverable; B not conflict-serializable, recoverable; C both; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (13 steps)

1. Set up the reasoning. Construct a precedence graph for conflicting operations on the same item, and separately inspect the commit order of transactions whose values are read. Serializability and recoverability are different tests.

2. Derive the result. Conflicts on X impose T2→T3→T1→T4, and Y adds T2→T4; the graph is acyclic. T2 reads initial X/Z; T4 reads X from already committed T1 and Y from already committed T2. Thus the schedule is both conflict-serializable and recoverable, C.

3. Check the interpretation. The graph order T2,T3,T1,T4 respects every conflict, including direct T2→T1 and T2→T4 edges. T4 reads only committed results, while T2 reads initial values, so there is no commit-before-writer recovery violation.

Original paper, page 36 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Indexing, Storage & Query Processing

Question 30, GATE 2014: A nested-loop relational join combines r(R) and s(S), with size(r)<size(s). There are three disk-block-sized buffers, one reserved for intermediate output. Which yields fewer disk-block accesses? A r in the outer loop; B s in the outer loop; C join selectivity above 0.5; D join selectivity below 0.5.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. With two input buffers, scan the inner relation once for each outer block. For block counts br and bs, compare br+br·bs with bs+bs·br, ignoring common output writes.

2. Derive the result. With one input-block buffer for each relation and one output buffer, block nested loops cost b_outer+b_outer·b_inner reads, excluding common output cost. The product is unchanged by swapping, but the initial outer scan is smaller when r is outer. Thus A, interpreting size as disk-block count.

3. Check the interpretation. The product cost is symmetric, but the one-time outer scan is not. The smaller block-count relation is therefore the better outer input. Selectivity can change result size but does not remove the specified nested-loop input scans.

Original paper, page 37 · Answer key

2 marks · MCQ
Report issue

Synchronization & Concurrency

Question 31, GATE 2014: Producer-consumer pseudocode starts with semaphores n=0, s=1. Producer repeats produce(); wait(s); addToBuffer(); signal(s); signal(n). Consumer repeats wait(s); wait(n); removeFromBuffer(); signal(s); consume(). Which is true? A Producer can add but consumer can never consume. B Consumer removes at most one item. C Deadlock occurs if consumer acquires s when the buffer is empty. D n must start at 1 rather than 0 for deadlock-free operation.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. Interpret s as the mutex and n as the number of available items. Trace the particular interleaving where the consumer runs first and locks the empty buffer.

2. Derive the result. If the consumer acquires s while n=0, it blocks on n while retaining s. The producer needs s before adding an item and signaling n, so neither can proceed. That is the deadlock in C. Correct ordering is to wait for n before acquiring the buffer mutex; inventing an initial item by setting n=1 is not a valid repair.

3. Check the interpretation. The consumer holds the very lock the producer requires to make n positive. The proper repair is to wait on n before locking s, not to pretend that an item exists by setting n=1.

Original paper, page 37 · Answer key

2 marks · NAT
Report issue

CPU Scheduling

Question 32, GATE 2014: Processes A,B,C each repeat 100 iterations of a CPU burst followed by independent-device I/O. CPU burst times are A 100 ms, B 350 ms, C 200 ms; all I/O operations take 500 ms. They arrive at 0,5,10 ms respectively. With round-robin scheduling, 50 ms quantum, no scheduling overhead, and sufficient independent I/O devices, when does C finish its first I/O, in ms from time 0?
Tap to enlarge
Answer & solution

Official answer: 1000

Step through it (16 steps)

1. Set up the reasoning. Maintain the ready queue at quantum boundaries. Later arrivals join the queue but do not preempt A's already running time slice. Remove a process from the ready queue as soon as its CPU burst finishes and it blocks on I/O.

2. Derive the result. The50ms slices are A0–50, B50–100, C100–150, A150–200, B200–250, C250–300, B300–350, C350–400, B400–450, C450–500. A starts I/O at 200; C completes its 200ms CPU burst at 500 and its independent 500ms I/O at 1000.

3. Check the interpretation. C needs four 50-ms slices, not four consecutive slices. Its I/O can overlap A's and other CPU activity because separate devices are available; add 500 ms to C's CPU completion time rather than to its arrival.

Original paper, page 38 · Answer key

2 marks · MCQ
Report issue

Virtual Memory & Paging

Question 33, GATE 2014: Twenty physical frames initially contain pages 101 through 120. A program references pages 1,2,…,100 in order and repeats that access sequence THRICE. Which replacement policy has the same fault count as optimal replacement? A LRU; B FIFO; C LIFO; D MRU. Retain the source's occupied-frame condition and its wording about repetitions.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Our answer: Official D needs initially reclaimable frames; literal initial occupancy makes no listed policy optimal

1. Set up the reasoning. Analyze the initially occupied frames before using the familiar result that MRU works well on repeated scans. After MRU loads page 1, that new page becomes the most recently used frame and is the next victim.

2. Derive the result. MRU is often optimal for cyclic scans larger than memory when frames initially fill with the scan’s pages. Here all 20 frames already contain irrelevant 101–120. Literal MRU evicts one old page for 1, then evicts the newly referenced 1 for 2, and so on, retaining 19 irrelevant pages forever. Every requested page therefore faults. LIFO likewise keeps 19 irrelevant pages; LRU/FIFO also fault on every pass because the cycle exceeds 20 frames. OPT discards the never-used initial pages and retains useful pages for later passes: for three total passes an explicit farthest-future simulation gives 260 faults instead of 300. Even simply preserving 19 useful pages across passes beats all-fault behavior. Official D requires treating the initial frames as free/reclaimable before MRU, a missing convention.

3. Check the interpretation. The official D cannot simply be explained by an initially empty-cache simulation. Literal occupied-frame MRU leaves nineteen irrelevant pages resident, unlike OPT. The inherited discrepancy remains open; the phrase about repetitions also needs a clearly stated pass-count convention when numerical simulations are quoted.

Original paper, page 38 · Answer key

2 marks · MCQ
Report issue

Intermediate Code

Question 34, GATE 2014: A compiler accesses X[i][j][k] using byte-offset code t0=i*1024; t1=j*32; t2=k*4; t3=t1+t0; t4=t3+t2; t5=X[t4]. Integers are 32 bits, characters 8 bits. Which declaration matches? A int X[32][32][8]; B int X[4][1024][32]; C char X[4][32][8]; D char X[32][16][2].
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. For a row-major three-dimensional array with element size e and trailing dimensions d2,d3, the offset is e·(i·d2·d3+j·d3+k). Match its three coefficients to the generated code.

2. Derive the result. The byte strides show 4-byte int elements, 8 elements in the last dimension(32/4), and 32 in the middle dimension(1024/32). The first dimension is not recoverable from strides alone, but among the listed declarations only int X[32][32][8] matches. Thus A.

3. Check the interpretation. The innermost coefficient identifies e=4 bytes; j then gives d3=8 and i gives d2=32. The leading dimension is not encoded in these strides, so select the matching offered declaration without claiming that 32 as its first dimension was derived.

Original paper, page 38 · Answer key

2 marks · MCQ
Report issue

Decidability & Computability

Question 35, GATE 2014: Let ⟨M⟩ be a binary encoding of a Turing machine. Define L={⟨M⟩:M accepts at least one string of length 2014}. What is L? A decidable and recursively enumerable; B undecidable but recursively enumerable; C undecidable and not recursively enumerable; D decidable but not recursively enumerable.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Set up the reasoning. Although there are finitely many length-2014 inputs, a simulation on one may never halt. To recognize L, interleave steps of all 22014 simulations rather than running them to completion one at a time.

2. Derive the result. Dovetail M on all finitely many binary strings of length 2014; accept its encoding when any simulation accepts, so L is r.e. It is undecidable: from machine N and input w, build M that on one fixed 2014-bit string simulates N(w), accepting iff that simulation accepts, and rejects all other inputs. A decider for L would decide acceptance. Thus B.

3. Check the interpretation. Finiteness of the input set does not decide nonacceptance. For undecidability, encode an arbitrary acceptance problem into a machine that simulates that problem on one fixed length-2014 word and rejects other words. A decision procedure for L would decide the original acceptance problem.

Original paper, page 39 · Answer key

2 marks · MCQ
Report issue

Regular Expressions & Languages

Question 36, GATE 2014: L1 consists of binary strings with at least as many occurrences of substring 110 as 011. L2 consists of binary strings with at least as many occurrences of 000 as 111. Which is true? A L1 regular, L2 not; B L2 regular, L1 not; C both regular; D neither regular.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. Count overlapping occurrences. For L1, examine maximal runs of at least two 1s: an entering 0 produces one 011 and a leaving 0 produces one 110. Every internal run contributes one of each.

2. Derive the result. For each maximal run of at least two 1s, an entering 0 contributes one 011 and a leaving 0 contributes one 110. Internal runs cancel; hence #110−#011 equals the indicator that the string starts 11 minus the indicator that it ends 11. A finite automaton can track these boundary facts, so L1 is regular. Intersect L2 with 0³0*1³1*: the resulting language is{0m1n: m≥n≥3}, because occurrences number m−2 and n−2. This is not regular: pumping down a zero in 0p1p violates m≥n. Thus L2 is not regular, A.

3. Check the interpretation. Only boundary runs can leave an imbalance, requiring finite memory. For L2, intersect with the regular pattern 0m1n, m,n≥3; counts become m-2 and n-2, demanding the unbounded comparison m≥n. Pumping zeros down from 0p1p contradicts regularity.

Original paper, page 39 · Answer key

2 marks · NAT
Report issue

Other / Mixed Topics

Question 37, GATE 2014: For A="qpqrr" and B="pqprqrp", let x be the length of a longest common subsequence, not necessarily contiguous, and y the number of distinct such longest subsequence strings. Find x+10y. The source says “number of such longest common subsequences”; the distinct-string convention is used by the keyed result.
Tap to enlarge
Answer & solution

Official answer: 34

Step through it (37 steps)

1. Set up the reasoning. Try to embed the entire five-letter A in B first. After choosing q,p,q in order in B, only one trailing r remains, so no length-five common subsequence exists. Then enumerate the distinct strings obtained by deleting one character from A.

2. Derive the result. The longest common subsequence length for qpqrr and pqprqrp is 4. The distinct length 4 common strings are pqrr, qpqr, qprr. The entire 5-letter first string is not a subsequence of the second, so no longer one exists. Therefore x+10y=4+30=34, counting distinct subsequence strings rather than embeddings.

3. Check the interpretation. Deleting the first, second, or third character gives pqrr, qqrr, qprr; deleting either final r gives qpqr. Of these, qqrr is not a subsequence of B, leaving three distinct length-four strings. Repeated embeddings of one string are not counted separately.

Original paper, page 39 · Answer key

2 marks · NAT
Report issue

Greedy Algorithms

Question 38, GATE 2014: Sorted sequences P,Q,R,S,T have lengths 20,24,30,35,50. Merge two sequences at a time until one remains. Find the minimum possible worst-case total number of comparisons.
Tap to enlarge
Answer & solution

Official answer: 358

1. Set up the reasoning. A merge of lengths a and b needs a+b-1 comparisons in the worst case. The optimal merge-pattern rule repeatedly joins the two currently shortest sequences, reinserting the combined length.

2. Derive the result. Optimal merging repeatedly combines the two shortest lists: 20+24=44, 30+35=65, 44+50=94, 65+94=159. A merge of lengths a, b uses at most a+b−1 comparisons, so total 43+64+93+158=358. The shortest-pair rule minimizes weighted leaf depth, as in Huffman coding.

3. Check the interpretation. Track lengths after each merge: 44 joins the queue after 20 and 24; 65 after 30 and 35; then combine 44 and 50. Subtract one comparison for each of the four merges, not just once from the final length.

Original paper, page 39 · Answer key

2 marks · NAT
Report issue

Tree Properties & Traversals

Question 39, GATE 2014: An expression tree has root +. Its left child is -, with children +(a,b) and -(c,d); its right child is +, with children -(e,f) and +(g,h). Every leaf a,b,c,d,e,f,g,h independently takes value 0 or 1. Find the maximum value of ((a+b)-(c-d))+((e-f)+(g+h)).
Tap to enlarge
Answer & solution

Official answer: 6

1. Set up the reasoning. Expand parentheses carefully, especially the subtraction of (c-d). This turns the tree into a linear expression with independent binary variables.

2. Derive the result. Label leaves left-to-right a,..., h. The expression expands as(a+b)−(c−d)+(e−f)+(g+h)=a+b−c+d+e−f+g+h. Set the six positive-coefficient leaves to 1 and the two negative-coefficient leaves to 0. The maximum is 6.

3. Check the interpretation. The d term is positive because it is subtracted twice. Set positive-coefficient leaves to one and negative-coefficient leaves to zero. The resulting assignment attains the coefficient upper bound, so it proves a maximum rather than only an example value.

Original paper, page 40 · Answer key

2 marks · NAT
Report issue

Functions & Parameter Passing

Question 40, GATE 2014: Consider the printed function double f(double x){if(abs(x*x-3)<0.01) return x; else return f(x/2+1.5/x);}. Give a value q, to two decimal places, such that f(q) returns q. Preserve the printed abs rather than silently replacing it with fabs.
Tap to enlarge
Answer & solution

Official answer: 1.72 to 1.74

Our answer: 1.73 in the intended real-absolute-value model

1. Set up the reasoning. For immediate return under the intended mathematical absolute-value interpretation, test whether the chosen two-decimal q satisfies abs(q²-3)<0.01. The recursive expression is a Newton update for a square root, but no iteration is needed if the starting value already passes.

2. Derive the result. For mathematical absolute value, immediate return requires|q²−3|<.01. q=1.73 gives q²=2.9929 and error.0071<.01, so it returns immediately (as does−1.73). The positive value is within the official range. Literal C abs takes an int: with declarations in scope, the double difference is truncated before testing, so every q with|q²−3|<1 returns immediately, including 1.50. The source should use fabs for floating absolute value if that is intended; the negative solution is also valid without a positivity restriction. Official1.72 to 1.74 is retained, with these distinct semantics explicit.

3. Check the interpretation. The distinction between mathematical absolute value and C's integer abs is substantive. The latter converts the double argument to int before testing, broadening immediate-return values. Also the source does not require q positive, so -1.73 is mathematically valid despite the positive official interval; retain the existing discrepancy.

Original paper, page 40 · Answer key

2 marks · MCQ
Report issue

Stacks & Queues

Question 41, GATE 2014: A stack supports PUSH, POP, and REVERSE, which reverses its current element order. Which statement about implementing a queue is true? A impossible; B ENQUEUE takes one instruction and DEQUEUE two; C ENQUEUE takes three and DEQUEUE one; D both take one.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. Choose and maintain an invariant: the queue's front is always at the stack top. Then removing the front is simply POP; a newly enqueued item must be placed at the bottom without disturbing the old order.

2. Derive the result. Keep the queue front at the stack top. ENQUEUE(x) performs REVERSE, PUSH(x), REVERSE, placing x at the bottom while preserving the previous order. DEQUEUE performs POP. Thus three and one instructions respectively, C. A single reversal followed by a pop would leave the remaining stack in the wrong orientation for an arbitrary future operation sequence.

3. Check the interpretation. REVERSE, PUSH, REVERSE inserts at the bottom and restores the invariant. Counting only the reversal and pop needed for one isolated removal ignores the orientation needed by later queue operations.

Original paper, page 40 · Answer key

2 marks · MCQ
Report issue

Recursion

Question 42, GATE 2014: For C function int f(int j){static int i=50; int k; if(i==j){printf("something"); k=f(i); return 0;} else return 0;}, which is true? A returns 0 for every j; B prints something for every j; C returns 0 for j=50; D exhausts the runtime stack or loops indefinitely when j=50.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Set up the reasoning. The static variable is initialized once and never modified. Split the trace into j≠50, which returns immediately, and j=50, which repeats exactly the same call state.

2. Derive the result. The static i remains 50 across calls. If j≠50, the function immediately returns 0. If j=50, it prints and calls f(50) again without changing the condition; no call reaches its following return. With ordinary recursive frames the stack is exhausted; an optimization eliminating redundant frames could instead run indefinitely. Thus D, assuming normal successful output operations.

3. Check the interpretation. The return statement after the recursive call is unreachable unless that call returns, and the recursion has no changing measure or base case for 50. Optimizations may affect stack growth but do not create the missing termination condition.

Original paper, page 41 · Answer key

2 marks · MCQ
Report issue

Cache Memory

Question 43, GATE 2014: In cache design, which statement is correct? A Smaller blocks imply better spatial locality. B Smaller blocks imply smaller tags and lower tag overhead. C Smaller blocks imply larger tags and lower hit time. D Smaller blocks incur a lower miss penalty.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Set up the reasoning. Use the conventional miss-penalty decomposition: fixed access latency plus time to transfer the fetched block. With finite transfer bandwidth, fetching fewer bytes reduces the transfer component.

2. Derive the result. A smaller cache block requires fewer bytes to refill, reducing the transfer component of a miss penalty under the usual fixed-latency, finite-bandwidth memory model. Thus D is the intended statement. It does not improve the program’s inherent spatial locality, and smaller blocks do not justify a shorter tag or guaranteed lower hit time. If critical-word-first timing or fixed-size physical bursts dominate, the measured penalty need not strictly decrease; the answer uses the textbook full-block refill model.

3. Check the interpretation. Spatial locality describes a program's access pattern, not a benefit created by making blocks smaller. Tag size and hit latency require other cache parameters; D is the intended full-block-refill statement, not a universal guarantee under critical-word-first or fixed-burst timing.

Original paper, page 41 · Answer key

2 marks · MCQ
Report issue

Cache Memory

Question 44, GATE 2014: A cache's associativity doubles while its total capacity and block size stay fixed. Which is guaranteed not to be affected? A tag-comparator width; B set-index-decoder width; C way-selection-multiplexor width; D processor-to-main-memory data-bus width.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Set up the reasoning. Let capacity be C, line size B, and associativity A. The set count is C/(AB), so doubling A halves the number of sets without changing the line-offset field.

2. Derive the result. With capacity C and block size B fixed, doubling associativity halves the set count C/(AB). The set index loses one bit and the tag gains one. The way-selection fan-in doubles, while the processor-to-main-memory data-bus width need not change. Therefore D. Here multiplexor width means its way-selection configuration/fan-in, not the unchanged data-word output width.

3. Check the interpretation. The index loses a bit and the tag gains a bit. More ways require greater selection fan-in, but internal cache organization does not dictate a new external data-bus width. The keyed interpretation of multiplexor “width” is its selection configuration, not its unchanged output-word width.

Original paper, page 41 · Answer key

2 marks · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 45, GATE 2014: IEEE-754 binary32 uses 1 sign bit, 8 biased-exponent bits and 23 fraction bits. A float X is assigned -14.25. What is its hexadecimal representation? A C1640000H; B 416C0000H; C 41640000H; D C16C0000H.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (6 steps)

1. Set up the reasoning. Convert the magnitude exactly: 14 is 1110₂ and 0.25 is .01₂. Normalize to 1.11001₂×2³, then encode sign, biased exponent, and the fraction after the implicit leading 1.

2. Derive the result. 14.25=1110.01₂=1.11001₂×2³. The negative sign gives sign bit1, the biased exponent is 127+3=130=10000010₂, and the fraction is 11001000000000000000000. Combining fields gives binary11000001011001000000000000000000, hexadecimalC1640000, A.

3. Check the interpretation. The leading 1 is not stored in the fraction field. The negative sign changes the top bit only; exponent bias is 127, so exponent 3 becomes 130. Group the final 32 bits into nibbles to distinguish C164 from the similar distractor C16C.

Original paper, page 41 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Numerical Methods

Question 46, GATE 2014: Newton-Raphson starts at x0=2 for f(x)=0.75x³-2x²-2x+4=0. Consider I x3=0; II the iteration converges to a root in finitely many steps. Which holds? A only I; B only II; C both; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. Use x(k+1)=xk-f(xk)/f′(xk), where f′(x)=2.25x²-4x-2. Evaluate exact values at the first two iterates to detect a possible cycle.

2. Derive the result. Let f(x)=0.75x³−2x²−2x+4, with f′(x)=2.25x²−4x−2. At x=2, f=−2 and f′=−1, so the next iterate is 0. At0, f=4 and f′=−2, so the next is 2. The sequence cycles 2, 0, 2, 0,...; x3=0 but it never converges to a root. Only I holds, A.

3. Check the interpretation. At x=2 the next point is 0, and at x=0 the next point is 2. Neither is a root because their function values are -2 and 4. Returning to the same point after two iterations establishes repetition forever, not convergence.

Original paper, page 42 · Answer key

2 marks · NAT
Report issue

Linear Algebra

Question 47, GATE 2014: Find the product of the nonzero eigenvalues of the matrix with rows (1,0,0,0,1), (0,1,1,1,0), (0,1,1,1,0), (0,1,1,1,0), (1,0,0,0,1).
Tap to enlarge
Answer & solution

Official answer: 6

1. Set up the reasoning. Reorder the coordinate indices as 1,5,2,3,4, applying the same permutation to rows and columns. This similarity transformation preserves eigenvalues and reveals two all-ones diagonal blocks.

2. Derive the result. Permuting coordinates to group indices 1, 5 and 2, 3, 4 makes the matrix block diagonal with all-one blocks J2 and J3. Their spectra are{2, 0} and{3, 0, 0}. The two nonzero eigenvalues multiply to 6.

3. Check the interpretation. An m×m all-ones block has eigenvalue m on the all-ones vector and eigenvalue zero on vectors whose coordinates sum to zero. The full matrix's determinant is zero, but the requested product excludes those zero eigenvalues.

Original paper, page 42 · Answer key

2 marks · NAT
Report issue

Probability & Random Variables

Question 48, GATE 2014: Choose an integer uniformly from 1 through 100 inclusive. What is the probability it is divisible by none of 2,3,5?
Tap to enlarge
Answer & solution

Official answer: 0.259 to 0.261

Our answer: 0.26

1. Set up the reasoning. Count the complement using inclusion-exclusion. Multiples of two or more divisors are counted repeatedly in the initial sum and must be corrected using their least common multiples.

2. Derive the result. Among1..100, counts divisible by 2, 3, 5 are 50, 33, 20. Pair intersections contribute 16, 10, 6 and the triple contributes 3. Their union has 50+33+20−16−10−6+3=74, leaving 26 integers. Under uniform selection the probability is 26/100=0.26, inside the official interval.

3. Check the interpretation. Use floor(100/d) for each divisor d. Subtract pair intersections for 6,10,15 and add back the triple intersection for 30, then subtract the union count from 100. The integer 1 is eligible and must not be excluded.

Original paper, page 42 · Answer key

2 marks · NAT
Report issue

Proof Techniques & Number Theory

Question 49, GATE 2014: How many distinct positive integer divisors does 2014 have?
Tap to enlarge
Answer & solution

Official answer: 8

1. Set up the reasoning. Factor completely: 2014=2×1007=2×19×53. The factors 2,19,53 are distinct primes, each with exponent one.

2. Derive the result. 2014=2·19·53, three distinct primes. Each positive divisor selects exponent 0 or 1 for each prime, giving 2³=8 divisors.

3. Check the interpretation. Every divisor independently chooses whether to contain each prime. The divisor-count formula is the product of exponent-plus-one values; include both 1 and 2014 among the eight divisors.

Original paper, page 42 · Answer key

2 marks · MCQ
Report issue

Partial Orders & Lattices

Question 50, GATE 2014: Let S={1,2,…,2014}. For distinct subsets U,V define U<V when the smallest element of their symmetric difference lies in U. Statements: S1 some subset is larger than every other subset; S2 some subset is smaller than every other subset. Which is correct? A both; B only S1; C only S2; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. The symmetric difference consists of elements belonging to exactly one of the sets. Compare an arbitrary nonempty set with the empty set, then compare the full set with an arbitrary proper subset.

2. Derive the result. For every nonempty U, the minimum element of U symmetric-difference empty lies in U, so U<empty: the empty set is greatest. For every proper subset V of S, the minimum element of S symmetric-difference V lies in S, so S<V: the full set is least. Both extrema therefore exist, A. This ordering reverses the usual lexicographic indicator convention with 0<1.

3. Check the interpretation. The smallest differing element belongs to the set on the left in the definition, so this ordering ranks presence before absence. That direction makes the full set least and the empty set greatest, the reverse of a common indicator-vector lexicographic convention.

Original paper, page 42 · Answer key

2 marks · NAT
Report issue

Graph Theory

Question 51, GATE 2014: A simple cycle with n vertices is isomorphic to its complement. Find n.
Tap to enlarge
Answer & solution

Official answer: 5

1. Set up the reasoning. Isomorphic graphs have matching vertex degrees. Every vertex of a cycle has degree 2; in its complement it is adjacent to all vertices except itself and its two cycle neighbors.

2. Derive the result. Every cycle vertex has degree 2, whereas its complement has degree n−3. Isomorphism forces 2=n−3, hence n=5. The complement of C5 is indeed another five-cycle, realized by stepping two vertices at a time around the original cycle.

3. Check the interpretation. The equation 2=n-3 is necessary. Verify sufficiency at n=5: if the original cycle visits vertices 0,1,2,3,4, its complement cycle can visit 0,2,4,1,3,0. Degree counting alone would not prove existence without this check.

Original paper, page 43 · Answer key

2 marks · NAT
Report issue

Graph Algorithms

Question 52, GATE 2014: How many distinct MSTs does the illustrated undirected weighted graph have? Textual equivalent: label left cluster vertices A top-left, B top-right, C middle-left, D center, E middle-right, F bottom-left; right triangle G bottom-left, H top, I bottom-right. Edges: AB=2, AC=2, AD=1, BD=2, BE=1, CD=2, CF=1, DE=2, DF=1, FG=2, GH=2, HI=1, GI=2. No other edges exist.
Tap to enlarge
Answer & solution

Official answer: 6

Step through it (15 steps)

1. Set up the reasoning. Run Kruskal by weight groups. Weight-one edges AD,BE,CF,DF,HI form a forest, so include them and contract each connected component before counting choices among weight-two edges.

2. Derive the result. The weight 1 edges form an acyclic forest and all are included before any weight 2 edge by Kruskal. In the left component, contraction leaves three parallel weight 2 choices joining its two weight 1 components. The long horizontal bridge of weight 2 is mandatory. In the right triangle, the weight 1 edge is mandatory and either of the two weight 2 edges connects the third vertex. Thus independent choices give 3·2=6 MSTs. The remaining left weight 2 edges internal to contracted components cannot be used.

3. Check the interpretation. After contraction, the left cluster has three parallel choices AB,BD,DE between its two components. FG is the only connection to the right cluster and is compulsory. On the right choose GH or GI. The independent choices yield 3×1×2 trees, each with eight edges and total weight 11.

Original paper, page 43 · Answer key

2 marks · MCQ
Report issue

Propositional & Predicate Logic

Question 53, GATE 2014: Which Boolean formula is NOT a tautology? A ((a→b)∧(b→c))→(a→c); B (a↔c)→(¬b→(a∧c)); C (a∧b∧c)→(c∨a); D a→(b→a).
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Set up the reasoning. An implication fails only when its premise is true and conclusion false. To refute a proposed tautology, one such assignment is enough; proving the others can be done by their logical forms.

2. Derive the result. Set a=b=c=false. Then a↔c is true, NOT b is true, and a AND c is false, so B evaluates true→(true→false)=false. A is implication transitivity, C follows by conjunction elimination and disjunction introduction, and D is a→(b→a), all tautologies. Hence B alone is not a tautology.

3. Check the interpretation. For B, make a and c both false so their equivalence is true, and b false so ¬b is true. Then the final conjunction is false. A expresses transitivity, C weakens a conjunction, and D preserves an assumed a regardless of b.

Original paper, page 43 · Answer key

2 marks · MCQ
Report issue

SQL & Queries

Question 54, GATE 2014: SQL relations may contain duplicate tuples. Which query always matches SELECT * FROM R WHERE a IN (SELECT S.a FROM S)? A SELECT R.* FROM R,S WHERE R.a=S.a; B SELECT DISTINCT R.* FROM R,S WHERE R.a=S.a; C SELECT R.* FROM R,(SELECT DISTINCT a FROM S) AS S1 WHERE R.a=S1.a; D SELECT R.* FROM R,S WHERE R.a=S.a AND is unique R.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. IN is an existence test: a matching R occurrence survives once irrespective of how many matching S rows exist. Reproduce that effect by deduplicating only S's join-key values before joining.

2. Derive the result. IN tests membership, preserving each original occurrence of an R row once when at least one matching nonnull S.a exists. Joining to SELECT DISTINCT a FROM S creates exactly one matching S1 row per such value, preserving R’s multiplicities: C. A multiplies rows when S repeats a; B removes duplicate R rows. SQL null comparisons remain nontrue in both the IN filter and equality join, so nulls do not invalidate C.

3. Check the interpretation. A can multiply an R occurrence by duplicate S keys; B can erase distinct occurrences of the same R tuple. C keeps R's bag multiplicity while giving one matching right-side row. NULL does not satisfy either filter's equality test, so it does not break the equivalence.

Original paper, page 43 · Answer key

2 marks · NAT
Report issue

Memory Organization & Address Translation

Question 55, GATE 2014: Eight memory modules share a one-word-wide system bus. A store occupies the bus for 100 ns with data, address, and control. The target module accepts/stores during those 100 ns and for another 500 ns, totaling a 600 ns module cycle. Module operations may overlap, but the bus handles one request at a time. What is the maximum number of one-word stores that can be initiated in 1 ms?
Tap to enlarge
Answer & solution

Official answer: 10000

1. Set up the reasoning. Compute both throughput limits: the shared bus admits one initiation per 100 ns, while eight modules collectively can sustain eight per 600 ns if their cycles overlap. The slower resource is the bus.

2. Derive the result. The single bus admits at most one new store per 100 ns, so in a half-open 1ms interval the limit is 106/100=10000 initiations. Each module is busy 600 ns, so cycling among six of the eight modules already permits a request every 100 ns without revisiting a busy module. Thus the bus bound is achievable. The question counts stores initiated, not necessarily completed within the interval.

3. Check the interpretation. Show attainability by scheduling requests 100 ns apart and rotating through six or more modules. A module is free by its next use. Count initiations in the half-open observation interval [0,1 ms); requiring all stores to finish by its end would be a different question.

Original paper, page 44 · Answer key