GATE / CS ARCHIVE

PAPER / ORIGINAL ORDER

GATE 2010

65 questions

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

03:00:00
1 mark · MCQ
Report issue

Casual remarks reveal seriousness

Vocabulary & Verbal Analogies

Question 56, GATE 2010: Choose the most appropriate completion: “His rather casual remarks on politics ______ his lack of seriousness about the subject.”
Options: (A) masked; (B) belied; (C) betrayed; (D) suppressed.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

The remarks reveal, rather than hide or contradict, the lack of seriousness. In this context betrayed means inadvertently revealed. Hence C; masked, belied and suppressed have the wrong relationship to the evidence.

The sentence treats the casual remarks as evidence of a lack of seriousness. “Betray” can mean reveal something unintentionally, as a nervous voice betrays anxiety. “Masked” and “suppressed” would hide the lack, while “belied” would contradict it. The contextual sense is revelation, not the separate sense of disloyalty.

Original paper, page 15

1 mark · MCQ
Report issue

Meaning of circuitous

Vocabulary & Verbal Analogies

Question 57, GATE 2010: Choose the word closest in meaning to “circuitous.”
Options: (A) cyclic; (B) indirect; (C) confusing; (D) crooked.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Circuitous means taking a roundabout rather than direct route, literally or figuratively. Indirect is therefore the closest synonym, B. Cyclic means repeating in a cycle, which is not required.

A circuitous explanation reaches its point by a roundabout route; a circuitous road reaches its destination indirectly. “Cyclic” instead means recurring in cycles, “confusing” describes difficulty understanding, and “crooked” can mean physically bent or dishonest. These may sometimes accompany a circuitous route, but indirect is the closest direct synonym.

Original paper, page 15

1 mark · MCQ
Report issue

Preserving natural resources

Vocabulary & Verbal Analogies

Question 58, GATE 2010: Choose the most appropriate completion: “If we manage to ______ our natural resources, we would leave a better planet for our children.”
Options: (A) uphold; (B) restrain; (C) cherish; (D) conserve.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Conserve means protect resources from waste or depletion, fitting the consequence of leaving a better planet for children. Uphold ordinarily takes a principle or decision, restrain means hold back, and cherish means value emotionally. D is the appropriate verb.

The consequence about future children points to protecting resources for later use. “Conserve” directly expresses reducing waste and preserving availability. “Cherish” conveys affection but not necessarily preservation; “uphold” normally applies to principles or decisions; “restrain” means hold back a person, force or action. Only conserve supplies the intended environmental action.

Original paper, page 15

1 mark · MCQ
Report issue

Neither hockey nor football

Counting, Probability & Sets

Question 59, GATE 2010: Of 25 people in a room, 15 play hockey, 17 play football and 10 play both. How many play neither sport?
Options: (A) 2; (B) 17; (C) 13; (D) 3.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Inclusion–exclusion gives 15+17−10=22 people playing at least one of the two sports. The complement in the 25-person room has size 25−22=3, option D. Subtracting the intersection once avoids double counting.

A disjoint-region check gives hockey only 15−10=5, football only 17−10=7 and both=10. Together these account for 22 people, leaving three outside both circles. The tempting 15+17=32 double-counts the ten people in the overlap and cannot be subtracted directly from 25.

Original paper, page 15

1 mark · MCQ
Report issue

Unemployed worker analogy

Vocabulary & Verbal Analogies

Question 60, GATE 2010: Choose the pair with the same relationship as “Unemployed : Worker.”
Options: (A) fallow : land; (B) unaware : sleeper; (C) wit : jester; (D) renovated : house.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

An unemployed worker is available for work but not currently employed. Fallow land is land left uncultivated rather than actively used for crops. This shared relation of productive capacity temporarily unused makes A the closest analogy.

Preserve both the order and the nature of the relation: an adjective describes a noun whose normal productive use is temporarily absent. Fallow land is not currently cultivated, just as an unemployed worker is not currently employed. The other pairs describe awareness, a characteristic associated with a performer, or a completed improvement rather than unused productive capacity.

Original paper, page 15

2 marks · MCQ
Report issue

Inferring a positional number base

Algebra, Equations & Number Patterns

Question 61, GATE 2010: If 137+276=435, how much is 731+672? Use the intended interpretation that all numerals are written in a common positional base.
Options: (A) 534; (B) 1403; (C) 1623; (D) 1513.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step through it (2 parts)

Assume the numerals use one positional integer base b. Expanding 137_b+276_b=435_b gives 3b²+10b+13=4b²+3b+5, so (b−8)(b+1)=0. The valid base is 8. Then 731_8+672_8 has units 3, tens 3+7=10 decimal giving digit 2 and carry 1, and hundreds 7+6+1=14 decimal giving digit 6 and carry 1. The result is 1623_8, option C. This uses the intended common-base interpretation; an arbitrary invented operation would not be uniquely determined.

A base must exceed every digit used, so b>7 rules out the negative root −1 of the quadratic. Carrying is then in base eight: the tens-column sum 10 in decimal is 12 in octal, and the hundreds-column sum 14 in decimal is 16 in octal. As a check, the addends are 473 and 442 in decimal, totaling 915, whose octal representation is 1623.

Original paper, page 15

2 marks · MCQ
Report issue

Ordering four siblings

Data Interpretation & Logical Reasoning

Question 62, GATE 2010: Hari (H), Gita (G), Irfan (I), and Saira (S) are siblings, all born on January 1, with no twins. Successive siblings differ in age by less than three years. H’s age+G’s age>I’s age+S’s age. G and S differ by one year; G is not oldest and S is not youngest. Find their order, oldest first.
Options: (A) HSIG; (B) SGHI; (C) IGSH; (D) IHSG.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Since all birthdays are January 1 and there are no twins, adjacent age gaps are positive integers 1 or 2. Gita and Saira differ by one year, so they are adjacent in birth order. A places Irfan between them. In C, the order Irfan–Gita–Saira–Hari gives I>G and S>H, hence I+S>G+H, contradicting condition (i). D gives Irfan oldest and Hari second, also forcing H+G<I+S. Only B, Saira–Gita–Hari–Irfan, can satisfy the inequalities: ages 5,4,3,1 give H+G=7>I+S=6 and all adjacent gaps are below 3. Thus B.

For option D, I>H>S>G and the difference I−H is positive while S−G=1, so (I+S)−(H+G)>0, contradicting the required inequality. Option A already violates the one-year G–S gap because another sibling lies between them. The ages used for B are only a feasibility witness; adding the same constant to all four ages preserves every condition.

Original paper, page 16

2 marks · MCQ
Report issue

Main point of warfare passage

Reading Comprehension & Verbal Reasoning

Question 63, GATE 2010: A passage says modern warfare has shifted from large army clashes to suppression of civilians. Silent chemical agents appear suited to this warfare, and “regretfully” some military personnel consider them useful tools. Which statement best sums up the passage?
Options: (A) Modern warfare has resulted in civil strife; (B) Chemical agents are useful in modern warfare; (C) Use of chemical agents in warfare would be undesirable; (D) People in military establishments like to use chemical agents in war.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

The writer describes chemical warfare against civilians and explicitly says regretfully when noting support for it. The best summary must preserve that disapproval: use of chemical agents in warfare would be undesirable, C. B and D omit the author’s evaluative point, and A substitutes civil strife for suppression of civilians.

A main-point answer should capture both subject matter and the author’s stance. The word “regretfully” signals disapproval of using chemical agents against civilians. Option B turns an attributed military belief into the author’s endorsement, while D reports that belief without the evaluative point. C preserves the central negative judgment.

Original paper, page 16

2 marks · MCQ
Report issue

Combined worker rates

Time, Work, Speed & Distance

Question 64, GATE 2010: Five skilled workers build a wall in 20 days; eight semi-skilled workers build it in 25 days; ten unskilled workers build it in 30 days. How long will two skilled, six semi-skilled and five unskilled workers together take?
Options: (A) 20 days; (B) 18 days; (C) 16 days; (D) 15 days.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

One skilled worker builds 1/(5·20)=1/100 wall per day; one semi-skilled worker builds 1/(8·25)=1/200; one unskilled worker builds 1/(10·30)=1/300. The team rate is 2/100+6/200+5/300=1/15 wall per day. Therefore completion takes 15 days, D, assuming additive constant productivity as in the question.

Convert each class to per-worker productivity before combining headcounts. Two skilled workers contribute 2/100=6/300 walls/day; six semi-skilled contribute 6/200=9/300; five unskilled contribute 5/300. Their sum is 20/300=1/15 wall/day, so the reciprocal is 15 days. Adding or averaging the three completion times would ignore team size and differing productivity.

Original paper, page 16

2 marks · MCQ
Report issue

Four-digit numbers from a multiset

Counting, Probability & Sets

Question 65, GATE 2010: Using digits from the multiset {2,2,3,3,3,4,4,4,4}, how many distinct four-digit numbers greater than 3000 can be formed? A digit cannot be used more often than it occurs.
Options: (A) 50; (B) 51; (C) 52; (D) 54.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

The available digits are two 2s, three 3s and four 4s. A number above 3000 starts with 3 or 4. After a leading 3, the remaining three positions have 3³ possibilities except 222 and 333, giving 25. After a leading 4, only 222 is forbidden, giving 26; 444 is allowed because four 4s are available overall. Total 25+26=51, B. Equal copies are not distinguished.

Count arrangements of digit values, not permutations of distinguishable physical copies. There are initially 27 suffixes for either allowed leading digit. With leading 3, suffix 333 would require four 3s and 222 would require three 2s; with leading 4, only 222 exceeds supply. No leading 2 can produce a number above 3000, so the two cases are exhaustive.

Original paper, page 16

1 mark · MCQ
Report issue

Degree sum of two trees

Trees & Connectivity

Question 1, GATE 2010: For a graph G=(V,E), define ξ(G)=Σ_d i_d·d, where i_d is the number of vertices of degree d. S and T are two different trees satisfying ξ(S)=ξ(T). Which relation holds between their numbers of vertices |S| and |T|?
Options: (A) |S|=2|T|; (B) |S|=|T|−1; (C) |S|=|T|; (D) |S|=|T|+1.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

The defined sum counts every vertex degree and hence equals 2|E| by the handshake lemma. A tree with v vertices has v−1 edges, so ξ=2(v−1). Equal ξ for S and T implies equal vertex counts |S|=|T|, C; the trees need not be isomorphic.

Why the degree sum works: each edge has two endpoints, so contributes exactly two to Σ_d id d. Writing s=|S| and t=|T| gives 2(s−1)=2(t−1), hence s=t. “Different” need not mean different sizes: two nonisomorphic trees can have the same vertex count and therefore the same degree sum.

Original paper, page 2

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

One Newton–Raphson iteration

Numerical Methods

Question 2, GATE 2010: Apply one Newton–Raphson iteration to x²−13=0, starting from x₀=3.5. What is the resulting approximation?
Options: (A) 3.575; (B) 3.677; (C) 3.667; (D) 3.607.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

For f(x)=x²−13, Newton’s update is x₁=x₀−(x₀²−13)/(2x₀). With x₀=3.5, x₁=3.5−(12.25−13)/7=3.607142857…, which rounds to 3.607, D. This is one iteration, not the exact square root.

Newton’s method replaces the curve locally by its tangent: f(x₀)+f′(x₀)(x₁−x₀)=0. Here f′(x)=2x and the negative residual f(3.5)=−0.75 makes the update increase x by 0.75/7. As a reasonableness check, 3.6²=12.96<13 and 3.61²=13.0321>13, so 3.607 lies in the expected interval.

Original paper, page 2

1 mark · MCQ
Report issue

Counting reflexive relations

Sets, Relations & Functions

Question 3, GATE 2010: How many reflexive relations exist on a set with five elements?
Options: (A) 2^10; (B) 2^15; (C) 2^20; (D) 2^25.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

A relation on five elements is a subset of 25 ordered pairs. Reflexivity forces the five diagonal pairs to be present. Each of the other 20 pairs can independently be present or absent, giving 2²⁰ relations, C.

Label the elements 1,…,5 and draw a 5×5 Boolean relation matrix. All diagonal entries must be 1; the 20 off-diagonal entries are free binary choices. The answer is not 225 because that counts all relations, including nonreflexive ones. Reflexivity does not impose symmetry, so (i,j) and (j,i) remain independent choices.

Original paper, page 2

1 mark · MCQ
Report issue

Cube roots of unity under multiplication

Algebraic Structures

Question 4, GATE 2010: Let S={1,ω,ω²}, where ω and ω² are the nonreal cube roots of unity. With * denoting multiplication, which algebraic structure does (S,*) form?
Options: (A) A group; (B) A ring; (C) An integral domain; (D) A field.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

The set {1,ω,ω²} is closed under multiplication because exponents reduce modulo 3. Multiplication is associative, 1 is the identity, and ω and ω² are inverses of each other. Hence it forms a cyclic group of order 3, A. A ring, integral domain or field additionally requires an additive operation and its associated axioms, not just this multiplicative structure.

A generator is ω: its powers are 1,ω,ω²,ω³=1. The multiplication table therefore cycles through these three elements. In particular, ω·ω²=1 and (ω²)²=ω. A field would require closure under an addition making an abelian group, including an additive identity; the specified single operation supplies no such structure.

Original paper, page 2

1 mark · MCQ
Report issue

Exponential limit

Calculus

Question 5, GATE 2010: Evaluate lim as n→∞ of (1−1/n)^(2n).
Options: (A) 0; (B) e^(−2); (C) e^(−1/2); (D) 1.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Let Ln=(1−1/n)2n. Its logarithm is 2n log(1−1/n), which tends to −2 since log(1−x)/x tends to −1 as x tends to zero. Exponentiating yields e−2, option B.

A shorter route is the standard limit (1−1/n)n→e−1; squaring it gives e−2. It is incorrect to replace the base by its limit 1 first and conclude 1: the exponent also tends to infinity, producing the indeterminate form 1^∞. Taking logarithms resolves that interaction.

Original paper, page 2

1 mark · MCQ
Report issue

Minterms of a Boolean expression

Logic Minimization & Karnaugh Maps

Question 6, GATE 2010: Find the minterm expansion of f(P,Q,R)=PQ+Q¬R+P¬R. Use P,Q,R as the most-significant to least-significant bits of each minterm index.
Options: (A) m₂+m₄+m₆+m₇; (B) m₀+m₁+m₃+m₅; (C) m₀+m₁+m₆+m₇; (D) m₂+m₃+m₄+m₅.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (11 steps)

The expression is PQ+Q R̄+P R̄, with variable order P,Q,R. PQ covers minterms 6 and 7; Q R̄ covers 2 and 6; P R̄ covers 4 and 6. Taking their union gives m₂+m₄+m₆+m₇, option A. Repeated minterm 6 is included only once.

To convert products to minterms, include missing variables: PQ=PQ¬R+PQR, Q¬R=¬PQ¬R+PQ¬R, and P¬R=P¬Q¬R+PQ¬R. Their binary assignments are 110,111; 010,110; and 100,110. OR is idempotent, so duplicate 110 is not counted again. The resulting truth vector in index order 0 through 7 is 00101011.

Original paper, page 2

1 mark · MCQ
Report issue

Refreshing a bank of DRAM chips

Memory Organization & Address Translation

Question 7, GATE 2010: A 4-megabyte main memory is built from 1M×1-bit DRAM chips. Each chip has 1K rows with 1K cells in each row. One refresh operation takes 100 ns. How long does one complete refresh of all memory cells take?
Options: (A) 100 ns; (B) 100×2^10 ns; (C) 100×2^20 ns; (D) 3200×2^20 ns.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

A refresh operation refreshes one row in each chip in parallel. Each chip has 1K=2¹⁰ rows, requiring 2¹⁰ refresh operations to cover all its cells. At 100 ns each, the total is 100·2¹⁰ ns, B. The memory needs 32 chips for 4 MiB, but the standard parallel-bank refresh model does not multiply the refresh time by 32.

The row count, rather than the total cell count, determines the number of refresh commands: all 1024 cells on the selected row are refreshed together. Memory capacity determines how many chips are needed, but chips sharing refresh control perform that command concurrently in the model used here. Multiplying by 220 would incorrectly refresh individual cells separately.

Original paper, page 2

1 mark · MCQ
Report issue

Multiplying a signed hexadecimal integer

Number Systems & Computer Arithmetic

Question 8, GATE 2010: A signed 16-bit integer P has two’s-complement hexadecimal representation F87B. What is the 16-bit two’s-complement representation of 8P?
Options: (A) C3D8; (B) 187B; (C) F878; (D) 987B.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (5 steps)

The 16-bit pattern F87B represents 0xF87B−0x10000=−1925. Multiplication by 8 gives −15400, which is within the signed 16-bit range. Its two’s-complement encoding is 65536−15400=50136=0xC3D8, A; equivalently shift F87B left three positions and retain 16 bits.

The top hexadecimal digit F sets the sign bit, so interpreting F87B as an unsigned positive number without subtracting 216 gives the wrong signed value. The range check −32768≤−15400≤32767 confirms that multiplying by eight does not overflow here. Hexadecimal shifting also gives F87B×8=7C3D8, whose low four digits are C3D8.

Original paper, page 2

1 mark · MCQ
Report issue

Four-to-one multiplexer parity

Combinational Circuits

Question 9, GATE 2010: A 4-to-1 multiplexer has data inputs I₀=R, I₁=¬R, I₂=¬R, I₃=R. The select inputs are S₁=P and S₀=Q (S₁ is the more significant selection bit). Find its output f.
Options: (A) ¬(P⊕Q⊕R); (B) P⊕Q⊕R; (C) P+Q+R; (D) ¬(P+Q+R).
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

The select bits are S₁=P and S₀=Q. Inputs 0 and 3 equal R, while inputs 1 and 2 equal R̄. Thus f=R when P=Q and f=R̄ when P≠Q, exactly f=P⊕Q⊕R, option B.

The four select combinations are PQ=00→R, 01→¬R, 10→¬R, 11→R. XOR with P⊕Q flips R exactly in the middle two cases, establishing the answer for both possible R values. For example P=Q=R=0 yields f=0, immediately excluding the complemented-XOR and complemented-OR choices.

Original paper, page 3

1 mark · MCQ
Report issue

Odd subtree sizes in a binary tree

Tree Properties & Traversals

Question 10, GATE 2010: A binary tree has n nodes. Every node has an odd number of descendants, counting the node itself as its own descendant. How many nodes have exactly one child?
Options: (A) 0; (B) 1; (C) (n−1)/2; (D) n−1.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

The descendants of a node, including itself, form its subtree. If a node had exactly one child, its subtree size would be 1 plus the child’s odd subtree size, hence even. This contradicts the condition at that node. Therefore no node has exactly one child: 0, A.

The parity condition applies to every child subtree as well as the root. A leaf has subtree size 1, which is allowed. A node with two children has size 1+odd+odd, also odd. Exactly one child gives 1+odd, even, which is impossible; thus the hypothesis forces a full binary tree, although it need not be balanced or perfect.

Original paper, page 3

1 mark · MCQ
Report issue

Pointer parameters passed by value

Pointers & Memory

Question 11, GATE 2010: What does this C program print?
#include <stdio.h>
void f(int *p, int *q) { p=q; *p=2; }
int i=0, j=1;
int main(void) { f(&i,&j); printf("%d %d\n",i,j); return 0; }
Options: (A) 2 2; (B) 2 1; (C) 0 1; (D) 0 2.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Initially i=0 and j=1. The local parameter assignment p=q redirects p to j, without altering i or the caller’s pointer arguments. Then *p=2 writes j=2. The printed values are 0 2, option D.

C passes the pointer values by value. At entry p contains &i and q contains &j; p=q copies &j into the local pointer p. It does not copy j into i. The later dereference acts on the new pointee j. Distinguish p=q, which redirects a pointer, from *p=*q, which would copy an integer.

Original paper, page 3

1 mark · MCQ
Report issue

Comparing quadratic and log-linear costs

Asymptotic Analysis & Recurrences

Question 12, GATE 2010: A database contains 10^k records. To process n records, package A takes 0.0001n² time units and B takes 10n log₁₀n time units. What is the smallest offered value of k for which B is preferred to A?
Options: (A) 12; (B) 10; (C) 6; (D) 5.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Put n=10k. Package B is faster when 10·10k·k < 0.0001·102k, equivalently 10k−5>k. At k=5 this is 1>5, false; at k=6 it is 10>6, true. For positive integer k≤5, 10k−5≤1≤k, so 6 is the smallest positive integer exponent, C. The meaningful growing-database interpretation excludes the degenerate n=1 case k=0.

The inequality compares actual running-time formulas, not only asymptotic orders. At k=5, A=106 and B=5×106 time units, so A wins. At k=6, A=108 and B=6×107, so B wins. This illustrates why the smaller-growth algorithm need not be faster at small inputs when its constant factor is much larger.

Original paper, page 3

1 mark · MCQ
Report issue

Compiler variable attributes

Semantic Analysis & Type Checking

Question 13, GATE 2010: Which compiler data structure manages information about variables and their attributes?
Options: (A) Abstract syntax tree; (B) Symbol table; (C) Semantic stack; (D) Parse table.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

A symbol table stores identifier entries and attributes such as type, scope, storage location and parameter information. An abstract syntax tree represents program structure, a parse table guides parsing, and a semantic stack supports intermediate parser actions. Therefore the data structure asked for is the symbol table, B.

For example, a declaration “int count” can create a symbol-table entry recording the name count, integer type and scope. Later uses look up that entry for type checking and storage access. The syntax tree may refer to the entry but is not itself the lookup structure; a parse table instead maps parser states/lookahead to parsing actions.

Original paper, page 3

1 mark · MCQ
Report issue

Runtime heap allocation

Runtime Environments & Parameter Passing

Question 14, GATE 2010: Which class of programming languages necessarily needs heap allocation in its runtime environment?
Options: (A) Languages supporting recursion; (B) Languages using dynamic scoping; (C) Languages allowing dynamic data structures; (D) Languages using global variables.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Dynamically created data structures can have sizes and lifetimes unrelated to the last-in-first-out nesting of procedure activations, so their runtime storage requires heap-style allocation in the standard implementation model. Recursion and dynamic scope can be supported with activation stacks; global variables can use static storage. C is the intended distinction. A language implementation may realize the allocator through a preallocated arena, but that is still heap-style management rather than a counterexample to the storage-lifetime distinction.

A recursive call creates a new activation record that can be popped when the call returns, so recursion alone needs a stack, not a heap. A linked node returned to a caller may have to survive its creator’s return and be freed in an arbitrary order. That non-LIFO lifetime is the key distinction tested by dynamic data structures.

Original paper, page 3

1 mark · MCQ
Report issue

Purpose of IP TTL

IP Addressing, Fragmentation & Address Resolution

Question 15, GATE 2010: Which statement best explains why an IP datagram has a Time-to-Live (TTL) header field?
Options: (A) To prioritize packets; (B) To reduce delays; (C) To optimize throughput; (D) To prevent packet looping.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Routers decrement TTL as a datagram is forwarded and discard it when the limit is exhausted. A packet caught in a routing loop therefore cannot circulate indefinitely. This bounds packet lifetime rather than prioritizing traffic, directly reducing delay or optimizing throughput: D.

If routers A and B mistakenly route a destination through each other, the same packet can alternate indefinitely without a hop/lifetime bound. TTL makes each traversal consume part of a finite budget. It does not repair the routing error itself; it limits the damage by eventually dropping the circulating datagram.

Original paper, page 4

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Ping versus client-server applications

Application Protocols

Question 16, GATE 2010: Which is not a client–server application in the conventional networking classification?
Options: (A) Internet chat; (B) Web browsing; (C) E-mail; (D) Ping.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Ping uses ICMP echo requests and replies handled by the network protocol stack, rather than a conventional application-layer client talking to an application server. Web browsing, ordinary email and server-based Internet chat use client-server application models. Thus D is the intended classification; request–reply alone does not make a utility an application-layer client-server service.

The relevant distinction is the protocol layer and service model, not merely whether one machine sends and another responds. A web server, mail server or chat server implements an application service. Ping normally asks the remote IP/ICMP stack to generate an echo reply, without a separately running user-level application server.

Original paper, page 4

1 mark · MCQ
Report issue

Differences of recursive and enumerable languages

Closure Properties & Language Hierarchy

Question 17, GATE 2010: L₁ is recursive. L₂ and L₃ are recursively enumerable but not recursive. Which statement is not necessarily true?
Options: (A) L₂−L₁ is recursively enumerable; (B) L₁−L₃ is recursively enumerable; (C) L₂∩L₃ is recursively enumerable; (D) L₂∪L₃ is recursively enumerable.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

L₂−L₁=L₂∩complement(L₁) is recursively enumerable because L₁ is decidable and its complement is decidable. Recursively enumerable languages are also closed under union and intersection, proving C and D. But take L₁=Σ* and L₃ an undecidable recursively enumerable language: L₁−L₃ is its complement and cannot be recursively enumerable, or L₃ would be decidable by dovetailing both recognizers. Therefore B is not necessarily true.

To recognize an intersection of two recursively enumerable languages, simulate both recognizers in parallel and accept only after both accept; for a union accept after either does. For L₂−L₁, first decide nonmembership in L₁, then run the L₂ recognizer. This construction fails for L₁−L₃ because nonmembership in undecidable L₃ cannot generally be recognized.

Original paper, page 4

1 mark · MCQ
Report issue

Minimum nonroot B+ tree keys

Indexing, Storage & Query Processing

Question 18, GATE 2010: In a B+ tree, the maximum number of keys in a node is five. What is the minimum number of keys in any nonroot node?
Options: (A) 1; (B) 2; (C) 3; (D) 4.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

With at most five keys, an internal node has at most six child pointers. A nonroot internal node must have at least ceil(6/2)=3 children and therefore at least two separator keys. Such an internal node attains the minimum, giving 2, B. Under the usual leaf convention a leaf with capacity five has at least three data keys; the requested minimum over nonroot nodes is still two, not a claim that every leaf may have two.

An internal search node with c child pointers has c−1 separator keys. The maximum of five keys therefore corresponds to order six, whose half-full lower bound is three children, not three keys. The root is exempt from the ordinary minimum occupancy rule. Keeping child counts distinct from key counts avoids the common off-by-one error.

Original paper, page 4

1 mark · MCQ
Report issue

Correlated SQL EXISTS filter

SQL & Queries

Question 19, GATE 2010: Schemas: Passenger(pid,pname,age) and Reservation(pid,class,tid).
Passenger rows: (0,Sachin,65), (1,Rahul,66), (2,Sourav,67), (3,Anil,69).
Reservation rows: (0,AC,8200), (1,AC,8201), (2,SC,8201), (5,AC,8203), (1,SC,8204), (3,AC,8202).
Which pids does this query return?
SELECT pid FROM Reservation
WHERE class='AC' AND EXISTS
 (SELECT * FROM Passenger WHERE age>65 AND Passenger.pid=Reservation.pid);
Options: (A) 1,0; (B) 1,2; (C) 1,3; (D) 1,5.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

The outer query first keeps AC reservation rows, whose passenger IDs are 0,1,5,3. The correlated EXISTS requires a Passenger row with the same pid and age greater than 65. ID 0 has age exactly 65 and fails; ID 5 has no Passenger row and fails. IDs 1 and 3 have ages 66 and 69 and pass, giving 1,3, option C.

EXISTS tests whether at least one matching subquery row exists; it does not require every Passenger row to meet the age condition. Passenger 2 is old enough but its only reservation is SC, so the outer AC filter removes it. Passenger 1’s additional SC reservation also does not add another output row. No ORDER BY is present, so 1,3 describes the result members rather than a guaranteed row order.

Original paper, page 4

1 mark · MCQ
Report issue

Serializability without deadlock

Transactions & Concurrency Control

Question 20, GATE 2010: Which concurrency-control protocols ensure both conflict serializability and freedom from deadlock? I: two-phase locking. II: timestamp ordering.
Options: (A) I only; (B) II only; (C) Both I and II; (D) Neither I nor II.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Two-phase locking guarantees conflict serializability but can create a cycle of transactions waiting for locks, so I does not guarantee deadlock freedom. Basic timestamp ordering enforces conflicts in timestamp order and rejects/aborts violating operations rather than making transactions wait on locks. It is conflict serializable and deadlock-free, although retries can still starve a transaction. Thus II only, B.

A simple 2PL deadlock is T1 holding lock X while requesting Y and T2 holding Y while requesting X; neither needs to violate the two-phase rule. Timestamp ordering instead disallows an operation inconsistent with the fixed transaction order. Deadlock freedom does not imply starvation freedom: repeated abort/restart of one transaction is still possible.

Original paper, page 5

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Cyclomatic complexity of sequential composition

Software Engineering

Question 21, GATE 2010: Modules A and B each have cyclomatic complexity 10. The combined flow executes A and then B in sequence, with no additional branch between them. What is the cyclomatic complexity of this sequential integration?
Options: (A) 19; (B) 21; (C) 20; (D) 10.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

For a connected single-entry/single-exit flow graph, cyclomatic complexity is the number of decision points plus one. Complexity 10 in each component means nine independent decisions each. Sequentially composing them adds their decision counts but introduces only one overall baseline path: 9+9+1=19. Equivalently V(A;B)=V(A)+V(B)−1, so A.

The flow-graph formula gives the same result. Connecting A’s exit to B’s entry adds one edge while leaving N_A+N_B vertices. Thus E−N+2=(E_A−N_A+2)+(E_B−N_B+2)−1=19. Simply adding 10+10 counts the straight-through baseline path twice.

Original paper, page 5

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Matching software lifecycle activities

Software Engineering

Question 22, GATE 2010: Match software-life-cycle activities P Requirements capture, Q Design, R Implementation, S Maintenance with: 1 Module development and integration; 2 Domain analysis; 3 Structural and behavioral modeling; 4 Performance tuning.
Options: (A) P–3,Q–2,R–4,S–1; (B) P–2,Q–3,R–1,S–4; (C) P–3,Q–2,R–1,S–4; (D) P–2,Q–3,R–4,S–1.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Requirements capture includes domain analysis (P–2); design includes structural and behavioral modeling (Q–3); implementation covers module development and integration (R–1); and maintenance includes performance tuning (S–4). Thus the matching is P–2,Q–3,R–1,S–4, option B.

The pairing follows what each phase produces: requirements establish the domain problem; design models the proposed system; implementation creates and combines executable modules; maintenance improves or repairs an existing system. Performance tuning may occur elsewhere in practice, but among these offered one-to-one mappings its intended lifecycle association is maintenance.

Original paper, page 5

1 mark · MCQ
Report issue

Boolean-turn mutual exclusion

Synchronization & Concurrency

Question 23, GATE 2010: Processes P1 and P2 use shared Boolean variables S1,S2 whose initial values are assigned randomly. Whenever they need their critical sections they execute:
P1: while (S1==S2); critical section; S1=S2;
P2: while (S1!=S2); critical section; S2=not(S1);
Which properties are achieved?
Options: (A) Mutual exclusion but not progress; (B) Progress but not mutual exclusion; (C) Neither mutual exclusion nor progress; (D) Both mutual exclusion and progress.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

P1 passes its guard only when S1≠S2; P2 passes only when S1=S2. Neither changes the shared state until leaving its critical section, so while one is inside the other’s guard stays blocking: mutual exclusion holds. Progress fails: if S1=S2 and only P1 wants to enter, P1 spins forever unless P2 participates and changes S2. The symmetric case also occurs. This is strict alternation, so A, assuming atomic sequentially consistent accesses as the pseudocode model does.

After P1 exits it sets S1=S2, making P2 eligible and itself ineligible; after P2 exits it makes S2 the opposite of S1, restoring P1’s turn. Consequently the processes alternate even if one no longer wants the critical section. Mutual exclusion is a safety property; progress additionally requires that an uninterested process not prevent an interested one from entering.

Original paper, page 5

1 mark · MCQ
Report issue

FIFO forward and reverse page scan

Virtual Memory & Paging

Question 24, GATE 2010: A FIFO page-replacement system has four frames, initially empty. It accesses 100 distinct pages in some order, then accesses those same 100 pages in the reverse order. How many page faults occur?
Options: (A) 196; (B) 192; (C) 197; (D) 195.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

The first 100 distinct references all fault. The four resident pages are then the last four in forward order, and the reverse scan hits these four first. Every one of the other 96 reverse references is to a page not yet resident; those faults evict only pages already visited in the reverse scan. Therefore faults total 100+96=196, option A. Hits do not refresh FIFO order.

Name the forward sequence p₁,…,p₁₀₀. The reverse sequence starts p₁₀₀,p₉₉,p₉₈,p₉₇, all already resident. Then p₉₆,…,p₁ must each fault because none remains from the forward scan. There are 200 total references and exactly four hits, giving 200−4=196 independently of the original ordering.

Original paper, page 5

1 mark · MCQ
Report issue

Scheduling starvation and responsiveness

CPU Scheduling

Question 25, GATE 2010: Which statements about CPU scheduling are true? I: shortest-remaining-time-first may cause starvation. II: preemptive scheduling may cause starvation. III: round robin is better than FCFS in response time.
Options: (A) I only; (B) I and III only; (C) II and III only; (D) I,II and III.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

SRTF may indefinitely postpone a long job when shorter jobs keep arriving, so I is true. SRTF is itself preemptive, establishing that preemptive scheduling may cause starvation, so II is true. Round robin’s time slices let waiting jobs receive CPU service without waiting for a long earlier job to finish, which is the conventional interactive response-time advantage asserted by III. The intended answer is all three, D. III is a qualitative textbook comparison, not a strict improvement for every workload and quantum; for a quantum exceeding all bursts, RR reduces to FCFS.

Starvation means unbounded waiting, not merely a long finite delay. Under SRTF, a long job can be repeatedly preempted by a stream of shorter jobs. Round robin uses a bounded quantum to distribute service opportunities among ready jobs, which improves typical interactive first-response behavior, while potentially increasing context-switch cost. The word “may” in I and II is essential.

Original paper, page 6

2 marks · MCQ
Report issue

Fault declarations with an imperfect test

Probability & Random Variables

Question 26, GATE 2010: A computer assembly is faulty with probability p. A test gives the correct result for any computer with probability q. What is the probability that a computer is declared faulty?
Options: (A) pq+(1−p)(1−q); (B) (1−q)p; (C) (1−p)q; (D) pq.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Partition computers into faulty with probability p and nonfaulty with probability 1−p. The test declares a faulty computer faulty with conditional probability q, while it incorrectly declares a nonfaulty computer faulty with probability 1−q. Total probability gives pq+(1−p)(1−q), option A. The phrase correct result for any computer supplies the same conditional accuracy q in each class.

A probability tree has two paths ending in “declared faulty”: truly faulty then correctly identified, probability pq; or truly sound then incorrectly classified, probability (1−p)(1−q). These events are disjoint, so add them. Checks: if q=1 the result is p; if q=0 the result is 1−p; if q=1/2 it is 1/2 regardless of p.

Original paper, page 6

2 marks · MCQ
Report issue

Random divisor divisible by a large power

Probability & Random Variables

Question 27, GATE 2010: A positive divisor of 10^99 is selected uniformly at random. What is the probability that it is a multiple of 10^96?
Options: (A) 1/625; (B) 4/625; (C) 12/625; (D) 16/625.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Since 10⁹⁹=2⁹⁹5⁹⁹, every positive divisor is uniquely 2a5b with 0≤a,b≤99, giving 100² equally likely divisors. Being a multiple of 10⁹⁶ requires a,b≥96, leaving four choices for each exponent. Probability=16/10000=1/625, option A. Uniform choice is over divisors, not over integers up to 10⁹⁹.

The admissible exponents for each prime are 96,97,98,99, so the favorable divisors number 4×4=16. Divisibility requires both prime exponents to be large enough; satisfying only the exponent of 2 or only the exponent of 5 is insufficient. Reducing 16/10000 gives the offered 1/625.

Original paper, page 6

2 marks · MCQ
Report issue

Testing graph degree sequences

Graph Theory

Question 28, GATE 2010: Which sequences cannot be degree sequences of any simple graph? I: (7,6,5,4,4,3,2,1); II: (6,6,6,6,3,3,2,2); III: (7,6,6,4,4,3,2,2); IV: (8,7,7,6,4,2,1,1).
Options: (A) I and II; (B) III and IV; (C) IV only; (D) II and IV.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

IV has eight vertices but a degree of 8, impossible in a simple graph. For II, the four highest degrees sum to 24; their vertices can contribute at most 4·3=12 internally and at most 3+3+2+2=10 from the other vertices, totaling only 22. Thus II also fails. Havel–Hakimi reduces I via (5,4,3,3,2,1,0) to (3,2,2,1,0,0), then (1,1,0,0,0), then zeros. III reduces via (5,5,3,3,2,1,1) to (4,2,2,1,1,0), then (1,1,0,0,0), then zeros. Hence I and III are graphical and exactly II and IV fail: D.

The even degree-sum condition alone cannot settle this question: all four sums are even. Sequence II fails an Erdős–Gallai bound on its four degree-six vertices: a vertex inside that set has only three possible neighbors inside it, while vertices outside cannot supply more incidences than their own degrees. Sequence IV already violates the individual maximum n−1=7.

Original paper, page 6

2 marks · MCQ
Report issue

Matrix entries from eigenvalues

Linear Algebra

Question 29, GATE 2010: The matrix A=[[2,3],[x,y]] has eigenvalues 4 and 8. Find x,y.
Options: (A) x=4,y=10; (B) x=5,y=8; (C) x=−3,y=9; (D) x=−4,y=10.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

The trace equals the eigenvalue sum: 2+y=4+8=12, giving y=10. The determinant equals the eigenvalue product: 2y−3x=4·8=32. Substituting y=10 gives x=−4. Thus x=−4,y=10, option D.

Trace and determinant avoid solving the characteristic polynomial from scratch. Equivalently det(λI−A)=λ²−(2+y)λ+(2y−3x), and the desired polynomial is (λ−4)(λ−8)=λ²−12λ+32. Matching coefficients gives the same two linear equations. Substituting x=−4,y=10 verifies both invariants.

Original paper, page 6

2 marks · MCQ
Report issue

Negated universal fooling claim

Propositional & Predicate Logic

Question 30, GATE 2010: F(x,y,t) means person x can fool person y at time t. Which sentence best expresses ∀x∃y∃t ¬F(x,y,t)?
Options: (A) Everyone can fool some person at some time; (B) No one can fool everyone all the time; (C) Everyone cannot fool some person all the time; (D) No one can fool some person at some time.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

The formula ∀x∃y∃t ¬F(x,y,t) says that for each person x there is at least one person y and time t when x cannot fool y. Equivalently, ∀x ¬∀y∀t F(x,y,t): no one can fool everyone all the time. That is B. It does not prohibit fooling some people at some times.

Negating “x can fool everyone all the time” moves the negation across two universal quantifiers: ¬∀y∀t F becomes ∃y∃t ¬F. The outer ∀x then says this failure occurs for every would-be deceiver. The witnesses y and t may depend on x; the formula does not assert a single universally unfoolable person or a single common time.

Original paper, page 6

2 marks · MCQ
Report issue

Simplifying a NOR network

Boolean Algebra & Logic Gates

Question 31, GATE 2010: A combinational circuit consists entirely of 2-input NOR gates. Define NOR(x,y)=¬(x+y). Its wiring is a=NOR(P,Q), b=NOR(Q,R), c=NOR(P,R), d=NOR(Q,R), u=NOR(a,b), v=NOR(c,d), and f=NOR(u,v). What is f?
Options: (A) ¬(Q+R); (B) ¬(P+Q); (C) ¬(P+R); (D) ¬(P+Q+R).
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

The top second-level NOR gives complement(complement(P+Q)+complement(Q+R))=(P+Q)(Q+R)=Q+PR. The bottom gives (P+R)(Q+R)=R+PQ. The final NOR complements their sum: f=complement(Q+PR+R+PQ)=complement(Q+R), since PR is absorbed by R and PQ by Q. Thus A.

De Morgan’s law turns a NOR of two complemented OR expressions into an AND of the original OR expressions. The identity (X+Y)(X+Z)=X+YZ then simplifies the two intermediate branches. Finally Q+PQ=Q and R+PR=R remove the terms containing P entirely, so the output is independent of P despite P appearing in the wiring.

Original paper, page 7

2 marks · MCQ
Report issue

Positive-edge ripple T flip-flops

Counters & Timing

Question 32, GATE 2010: Two positive-edge-triggered T flip-flops have both T inputs tied to logic 1. The external clock drives the first, whose output is Q₀; Q₀ directly clocks the second, whose output is Q₁. Starting from Q₁Q₀=00, what are the next four settled values after successive external positive clock edges?
Options: (A) 11,10,01,00; (B) 10,11,01,00; (C) 10,00,01,11; (D) 11,10,00,01.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Both T inputs are tied to 1, so each flip-flop toggles on a positive clock edge. Q₀ toggles on every external edge; Q₁ is clocked by Q₀ and therefore toggles only on Q₀ transitions 0→1. Starting at Q₁Q₀=00, the settled states after successive external edges are 11,10,01,00. Option A; the ripple clock is not a common synchronous clock.

Trace the clock-sensitive events: on edge 1, Q₀ rises 0→1 and triggers Q₁, giving 11. On edge 2, Q₀ falls 1→0, so Q₁ stays 1, giving 10. Edge 3 raises Q₀ and toggles Q₁ back to 0, giving 01. Edge 4 only lowers Q₀, returning to 00. Ripple propagation delays are ignored when listing settled states.

Original paper, page 7

2 marks · MCQ
Report issue

Variable-latency pipeline execution

Pipelining & Hazards

Question 33, GATE 2010: A five-stage pipeline has IF, ID, OF, PO and WO stages. IF, ID, OF and WO each take one cycle. PO takes one cycle for ADD/SUB, three for MUL and six for DIV. Operand forwarding is used. How many cycles execute this instruction sequence?
I₀: MUL R₂,R₀,R₁   (R₂←R₀×R₁)
I₁: DIV R₅,R₃,R₄   (R₅←R₃/R₄)
I₂: ADD R₂,R₅,R₂   (R₂←R₅+R₂)
I₃: SUB R₅,R₂,R₆   (R₅←R₂−R₆)
Options: (A) 13; (B) 15; (C) 17; (D) 19.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (6 steps)

With the single shared PO stage, the first MUL occupies PO in cycles 4–6 after IF,ID,OF in cycles 1–3. DIV occupies PO in cycles 7–12; the dependent ADD then uses the forwarded DIV result in PO cycle 13, and SUB uses PO cycle 14. The last WO is cycle 15. Earlier stages stall as necessary while PO is occupied, but forwarding avoids waiting for an extra writeback before dependent execution. Total 15, B. This assumes the ordinary unpipelined multi-cycle PO unit implicit in this question, not separate independently pipelined arithmetic units.

A compact timing schedule is MUL: PO 4–6, WO 7; DIV: PO 7–12, WO 13; ADD: PO 13, WO 14; SUB: PO 14, WO 15. PO is the bottleneck and its occupied cycles sum to 3+6+1+1=11. Three initial stages plus eleven PO cycles plus the final writeback give 3+11+1=15. Forwarding handles the DIV→ADD and ADD→SUB true dependencies.

Original paper, page 8

2 marks · MCQ
Report issue

Maximum weighted subsequence recurrence

Dynamic Programming

Question 34, GATE 2010: The weight of a real sequence a₀,…,aₙ₋₁ is a₀+a₁/2+⋯+aₙ₋₁/2^(n−1). A subsequence deletes elements without changing the order. X is the maximum subsequence weight of a₀,…,aₙ₋₁ and Y is that of a₁,…,aₙ₋₁. What is X?
Options: (A) max(Y,a₀+Y); (B) max(Y,a₀+Y/2); (C) max(Y,a₀+2Y); (D) a₀+Y/2.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Split subsequences according to whether they include a₀. If not, their optimum weight is Y, the optimum on the suffix. If they do, a₀ contributes with weight 1 and each selected suffix element shifts one position, halving its contribution; the best such weight is a₀+Y/2. Thus X=max(Y,a₀+Y/2), B. The usual subsequence convention permits the empty subsequence, ensuring this also works with negative inputs.

The split is exhaustive and disjoint: every candidate either omits a₀ or contains it. Including a₀ shifts every chosen suffix element one weight position to the right, multiplying the entire suffix weight by 1/2; its internal order and relative weights are unchanged. Since 1/2 is positive, the suffix maximizing its own weight also maximizes the scaled weight. The outer maximum is necessary because including a negative a₀ can be harmful.

Original paper, page 8

2 marks · MCQ
Report issue

Recursive alternating arithmetic

Recursion

Question 35, GATE 2010: What value does this C program print?
#include <stdio.h>
int f(int *a,int n) {
 if(n<=0) return 0;
 else if(*a%2==0) return *a+f(a+1,n-1);
 else return *a-f(a+1,n-1);
}
int main(void) { int a[]={12,7,13,4,11,6}; printf("%d",f(a,6)); return 0; }
Options: (A) −9; (B) 5; (C) 15; (D) 19.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step through it (17 steps)

Evaluate from the last array element backward. The empty suffix returns 0; f([6])=6; f([11,6])=11−6=5; f([4,11,6])=4+5=9; f([13,4,11,6])=13−9=4; f([7,13,4,11,6])=7−4=3; finally 12+3=15. The function tests each current element’s parity, not its index. Printed value 15, C.

The recurrence is not a flat alternating sum of the original elements: subtraction applies to the entire recursively computed suffix. Parentheses make the evaluation explicit: 12+(7−(13−(4+(11−6))))=15. Pointer arithmetic a+1 advances to the next integer and n−1 shrinks the remaining array; the parity test examines the value *a at each call.

Original paper, page 8

2 marks · MCQ
Report issue

Moving the last linked-list node first

Pointers & Memory

Question 36, GATE 2010: Complete this C function so it moves the last node of a singly linked list to the front and returns the new head.
typedef struct node { int value; struct node *next; } Node;
Node *move_to_front(Node *head) {
 Node *p,*q;
 if(head==NULL || head->next==NULL) return head;
 q=NULL; p=head;
 while(p->next!=NULL) { q=p; p=p->next; }
 /* BLANK */
 return head;
}
Options: (A) q=NULL; p->next=head; head=p;; (B) q->next=NULL; head=p; p->next=head;; (C) head=p; p->next=q; q->next=NULL;; (D) q->next=NULL; p->next=head; head=p;.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

At loop exit p points to the last node and q to its predecessor. First set q->next=NULL to detach p, then p->next=head to link p before the old first node, and finally head=p. This is option D. Updating head before p->next would lose the old head and can create a self-loop; the early return already handles lists shorter than two nodes.

For A→B→C, the loop ends with p=C and q=B. Detach B→C, point C→A and set head=C, obtaining C→A→B→NULL. Choice A only clears the local variable q and leaves B linked to C, producing a cycle. Choice B makes C point to itself. Choice C loses the old head connection by linking the last node to its predecessor instead.

Original paper, page 9

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Minimum registers without spilling

Code Generation & Register Allocation

Question 37, GATE 2010: All operations take operands from registers. What is the minimum number of registers needed to execute this program without spilling?
a=1; b=10; c=20;
d=a+b; e=c+d; f=c+e;
b=c+e; e=b+f; d=5+e;
return d+f;
Options: (A) 2; (B) 3; (C) 4; (D) 6.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Immediately after c=20, a,b,c are all live because a and b are needed for d=a+b while c is needed later. At least three registers are therefore necessary. Three suffice: put a,b,c in registers r1,r2,r3; overwrite r1 with d=a+b, then with e=c+d; overwrite r2 with f=c+e; overwrite r3 with b=c+e after c dies; overwrite r1 with e=b+f and then d=5+e. The final d+f uses r1 and r2. Thus 3, B, under the usual model allowing a destination to reuse a dead operand register.

One possible register state trace is (a,b,c)→(d,b,c)→(e,b,c)→(e,f,c)→(e,f,b)→(e,f,b)→(d,f,b), where dead values may be overwritten. At the middle expression f=c+e, both c and e must remain available for the following b=c+e, so the third register is still useful. The lower-bound argument assumes executing the given operations, rather than constant-folding the entire straight-line program.

Original paper, page 9

2 marks · MCQ
Report issue

Predictive and LR parsing of a grammar

Parsing & Syntax Analysis

Question 38, GATE 2010: Classify the grammar S→aSa | bS | c.
Options: (A) LL(1) but not LR(1); (B) LR(1) but not LL(1); (C) Both LL(1) and LR(1); (D) Neither LL(1) nor LR(1).
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step through it (3 parts)

The productions S→aSa, S→bS and S→c begin with distinct terminals a,b,c and none derives epsilon. Their FIRST sets are disjoint, so one lookahead symbol uniquely selects the production and the grammar is LL(1). Every LL(1) grammar is LR(1), so it is both, C. The trailing a in aSa does not cause a predictive conflict because the initial a already selects that alternative.

The predictive parsing table contains exactly S→aSa under lookahead a, S→bS under b and S→c under c. There are no epsilon productions, so no FIRST/FOLLOW conflict arises. Recursion does not by itself prevent LL(1); left recursion would, but here each recursive call is preceded by a terminal consumed from the input.

Original paper, page 9

2 marks · MCQ
Report issue

Regular expression for even parity

Regular Expressions & Languages

Question 39, GATE 2010: Let L be all binary strings with an even number of 1s, including zero 1s. Which regular expression represents L? Concatenation is implicit and * denotes Kleene star.
Options: (A) (0*10*1)*; (B) 0*(10*10*)*; (C) 0*(10*1)*0*; (D) 0*1(10*1)*10*.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

A binary string with an even number of 1s can be decomposed into initial zeros followed by zero or more pairs of 1s, with any number of zeros after each 1. This is exactly 0*(10*10*)*, option B. Each repeated block contributes two 1s, while any string with 2k ones can be split into k such blocks. The outer star includes the zero-ones case, including epsilon.

Why the alternatives fail: A cannot generate a nonempty all-zero string; C cannot generate 11011, whose zero separates two adjacent pairs of ones; D always has at least its two explicit outer ones and therefore misses epsilon and all-zero strings. B allows arbitrary zeros before, between and after every pair, and its repetition count can be zero.

Original paper, page 9

2 marks · MCQ
Report issue

Context-free linear counting constraints

Context-Free Grammars & Languages

Question 40, GATE 2010: For nonnegative integers i,j, let L₁={0^i1^j:i≠j}, L₂={0^i1^j:i=j}, L₃={0^i1^j:i=2j+1}, L₄={0^i1^j:i≠2j}. Which statement is true?
Options: (A) Only L₂ is context-free; (B) Only L₂ and L₃ are context-free; (C) Only L₁ and L₂ are context-free; (D) All are context-free.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

All four languages are context free, D. L₂ has grammar S→0S1|ε. L₃ has S→00S1|0. For L₁, split into i>j and i<j: matched pairs 0j1j can have a nonempty zero prefix or nonempty one suffix, respectively, and CFLs are closed under concatenation with regular languages and finite union. For L₄, let E={02j1j}, generated by S→00S1|ε. The part i>2j is 0⁺E. For i<2j, even i gives E1⁺, while odd i gives 0E1⁺. These are all CFLs by the same closure properties, proving the claim without incorrectly invoking closure of CFLs under complement.

For the strict-inequality cases, the closure argument is constructive. L₁=0⁺{0j1j} ∪ {0i1i}1⁺. For L₄, write E={02j1j}; the cases i>2j, i<2j with i even, and i<2j with i odd are respectively 0⁺E, E1⁺ and 0E1⁺. This separates the arithmetic conditions without relying on the generally false statement that context-free languages are closed under complement.

Original paper, page 10

2 marks · MCQ
Report issue

Minimum NFA for all substrings

Finite Automata

Question 41, GATE 2010: Let w be any binary string of length n, and L the set of all substrings of w. What is the minimum number of states in a nondeterministic finite automaton accepting L?
Options: (A) n−1; (B) n; (C) n+1; (D) 2^(n−1).
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

The answer is n+1. For a lower bound, take an accepting computation for w, which has n consuming transitions. If a state repeats at two different consumed-input positions, the nonempty intervening loop can be pumped, accepting a string longer than n. That contradicts the definition of L. Hence at least n+1 states occur. For an upper bound, use states q0,…,qn, all accepting, with q0 initial. For every j=1,…,n add q0 --w[j]--> qj, and for i=1,…,n−1 add qi --w[i+1]--> q(i+1). Every nonempty accepted string follows a contiguous segment of w, and every substring has such a run. Making q0 accepting includes the empty substring. This construction uses one initial state and no epsilon moves; C.

The lower bound applies even when w contains repeated symbols, because the finite language contains w itself but no string longer than n. Pumping a repeated state on that accepting computation would violate this maximum length. In the upper-bound construction, choosing q0→qj chooses the starting position of a substring; continuing along successive positions preserves contiguity, and accepting at any state permits any ending position.

Original paper, page 10

2 marks · MCQ
Report issue

Conflict-serializable schedule

Transactions & Concurrency Control

Question 42, GATE 2010: Transactions T1,T2,T3 execute this schedule, in time order: r1(X), r2(Y), r3(Y), w2(Y), w1(X), w3(X), r2(X), w2(X). Which serial order is equivalent to the schedule?
Options: (A) T1→T3→T2; (B) T2→T1→T3; (C) T2→T3→T1; (D) T3→T1→T2.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (10 steps)

In time order the schedule is r1(X), r2(Y), r3(Y), w2(Y), w1(X), w3(X), r2(X), w2(X). Conflicts on X impose T1→T3, T1→T2 and T3→T2; r3(Y) before w2(Y) also imposes T3→T2. There is no reverse edge. Its unique topological ordering is T1→T3→T2, option A.

Two operations conflict only if they belong to different transactions, access the same item, and at least one is a write. Reads r2(Y) and r3(Y) do not themselves create an edge. However r3(Y) before w2(Y) creates T3→T2. A topological ordering of the resulting acyclic graph gives a conflict-equivalent serial execution; source-code transaction numbering alone does not determine that order.

Original paper, page 10

2 marks · MCQ
Report issue

Maximum natural-join cardinality

Relational Algebra & Calculus

Question 43, GATE 2010: Relations R(A,B,C) and S(B,D,E) obey B→A and A→C in R. R contains 200 tuples and S contains 100 tuples. What is the maximum possible cardinality of their natural join R⋈S?
Options: (A) 100; (B) 200; (C) 300; (D) 2000.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Within R(A,B,C), B→A and A→C imply B→ABC, so B is a key under relational set semantics. In the natural join on common attribute B, each of the 100 tuples of S(B,D,E) matches at most one R tuple. Therefore the join has at most 100 tuples. This bound is attainable by choosing all S.B values among the 200 R.B values, so A. The cardinality of R does not multiply each S row because B is unique in R.

The bound is attained, for example, by choosing 100 S rows whose B values all occur in R, with distinct D,E as needed. Every S row then contributes exactly one join row. Different S rows may share a B value without violating any stated dependency, but none can match two R rows because B determines every attribute of R. This is a many-to-one join from S to R.

Original paper, page 10

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Statement-coverage test suite

Software Engineering

Question 44, GATE 2010: Find a test suite covering statements S1,S2,S3,S4 in:
begin
 if(a==b) { S1; exit; }
 else if(c==d) { S2; }
 else { S3; exit; }
 S4;
end
Available test properties: T1: a,b,c,d all equal; T2: all distinct; T3: a=b and c≠d; T4: a≠b and c=d.
Options: (A) T1,T2,T3; (B) T2,T4; (C) T3,T4; (D) T1,T2,T4.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

T1 and T3 both take a==b, execute S1, then exit. T2 takes a!=b and c!=d, executes S3, then exits. T4 takes a!=b and c==d, executes S2 and then S4. Full statement coverage therefore needs T2, T4 and either T1 or T3. Of the offered suites only T1,T2,T4 meets this condition, option D.

The crucial control-flow feature is exit: neither the S1 branch nor the S3 branch reaches S4. Only T4 covers S2 and S4 together. T2 is indispensable for S3, and one of T1/T3 is indispensable for S1. Thus three tests suffice and two cannot cover all three mutually exclusive branch outcomes.

Original paper, page 11

2 marks · MCQ
Report issue

Binary-semaphore print count

Synchronization & Concurrency

Question 45, GATE 2010: Three concurrent processes use binary semaphores initially S0=1,S1=0,S2=0:
P0: while(true) { wait(S0); print '0'; release(S1); release(S2); }
P1: wait(S1); release(S0);
P2: wait(S2); release(S0);
How many times will P0 print '0'?
Options: (A) At least twice; (B) Exactly twice; (C) Exactly thrice; (D) Exactly once.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

P0 consumes the initial S0 permit and prints once, then enables P1 and P2. Each of those processes releases S0 exactly once. If both releases occur before P0 next waits on S0, binary saturation coalesces them into one permit, allowing only one further print: total 2. If P0 consumes the first released permit before the other process releases S0, it receives two separate permits and prints three times total. Thus 2 or 3 prints are possible, so the only correct choice is A, at least twice. This assumes ordinary progress/eventual scheduling; an adversarial scheduler that permanently starves runnable processes defeats any eventual-print guarantee. A counting semaphore would instead give exactly three.

The distinction between binary and counting semaphores changes the answer. A binary semaphore stores at most one available permit; release on an already available semaphore does not accumulate a second permit. P1 and P2 have no loops, so they cannot supply unbounded future permits even though P0 keeps releasing S1 and S2. That bounds the total prints above by three.

Original paper, page 11

2 marks · MCQ
Report issue

Deadlock from opposite resource orders

Deadlocks

Question 46, GATE 2010: There are n single-instance resources R₀,…,Rₙ₋₁ and k processes P₀,…,Pₖ₋₁. Each process Pᵢ requests resources using:
if(i%2==0) {
 if(i<n) request Rᵢ;
 if(i+2<n) request Rᵢ₊₂;
} else {
 if(i<n) request Rₙ₋ᵢ;
 if(i−2<n) request Rₙ₋ᵢ₋₂;
}
For which offered n,k is deadlock possible? The odd-branch subscripts are faint in the scan; the explicit reading above preserves the inherited interpretation. The second odd-branch guard is printed i−2<n, not silently repaired.
Options: (A) n=40,k=26; (B) n=21,k=12; (C) n=20,k=10; (D) n=41,k=19.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Read the code as even i requesting Ri followed by R(i+2), and odd i requesting R(n−i) followed by R(n−i−2), subject to the printed guards. For n=21,k=12, P10 requests R10 then R12, while P9 requests R12 then R10. If each obtains its first resource, they wait on each other: deadlock is possible, B. For even n (A and C), even processes use only even-indexed resources in increasing order, while odd processes use only odd-indexed resources in decreasing order. Each parity class has a consistent order, so neither can cycle. For D, n=41,k=19: even processes use resources 0 through 20, whereas odd processes use even resources 22 through 40, so these opposite-order sets do not overlap and cannot form a cycle. This uses single-instance, non-preemptive resources held until completion, the standard deadlock model. The low-quality scan has faint minus signs/subscripts in the odd branch; the relevant R(n−i),R(n−i−2) reading is recorded explicitly.

The deadlocking B execution can be written explicitly: P10 acquires R10; P9 acquires R12; P10 blocks requesting R12; P9 blocks requesting R10. The resource-allocation graph now has a cycle with single-instance resources. Consistent increasing or decreasing order prevents cycles within one resource set, but opposing orders on overlapping resources can create the exhibited cycle.

Original paper, page 11

2 marks · MCQ
Report issue

Netmask separating two IPv4 hosts

IP Addressing, Fragmentation & Address Resolution

Question 47, GATE 2010: Hosts A and B have IP addresses 10.105.1.113 and 10.105.1.91, with a common netmask N. Which mask must not be used if they are to belong to the same network?
Options: (A) 255.255.255.0; (B) 255.255.255.128; (C) 255.255.255.192; (D) 255.255.255.224.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (6 steps)

The last octets are 113=01110001₂ and 91=01011011₂. A /24 mask gives the same network. A /25 mask (128) gives last-octet network 0 for both; a /26 mask (192) gives 64 for both. A /27 mask (224) gives 96 for 113 and 64 for 91, placing the hosts in different subnets. Therefore 255.255.255.224 must not be used, option D.

Network membership is determined by bitwise AND of address and mask. Since the first three octets agree, only the final octet matters. /26 partitions that octet into ranges 0–63,64–127,128–191,192–255, so both hosts are in 64–127. /27 splits it further into 64–95 and 96–127, separating 91 from 113.

Original paper, page 11

2 marks · MCQ
Report issue

L2-to-L1 block-transfer time

Cache Memory

Question 48, GATE 2010: An L1 cache connects to L2, which connects to main memory. Both connecting data buses are four words wide. L1 blocks contain four words; L2 blocks contain sixteen words. Access times are 2 ns for L1, 20 ns for L2 and 200 ns for main memory. On an L1 miss and L2 hit, one block is transferred from L2 to L1. What is the transfer time?
Options: (A) 2 ns; (B) 20 ns; (C) 22 ns; (D) 88 ns.
Question 48, GATE 2010: An L1 cache connects to L2, which connects to main memory. Both connecting data buses are four words wide. L1 blocks contain four words; L2 blocks contain sixteen words. Access times are 2 ns for L1, 20 ns for L2 and 200 ns for main memory. On an L1 miss and L2 hit, one block is transferred from L2 to L1. What is the transfer time?
Options: (A) 2 ns; (B) 20 ns; (C) 22 ns; (D) 88 ns.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

The L1 block is 4 words and the L2–L1 bus transfers 4 words, so one bus-width transfer suffices. Under the serial source-read plus destination-write model implicit in the offered transfer-time choices, reading L2 takes 20 ns and writing L1 takes 2 ns, giving 22 ns, C. This is the block movement time, not an extra sum including a previous failed lookup. Bus width alone does not specify pipelining, write overlap or timing semantics; the result relies on this conventional serialized model.

Do not use the entire 16-word L2 block as the transfer size here: the destination L1 line needs only four words, exactly one bus width. Under the stated serialized interpretation, 20 ns pays for the source access and 2 ns for the destination write. The 88 ns distractor is four times 22 ns and incorrectly moves four L1-sized pieces.

Original paper, page 12

2 marks · MCQ
Report issue

Main-memory refill through two cache levels

Cache Memory

Question 49, GATE 2010: An L1 cache connects to L2, which connects to main memory. Both connecting data buses are four words wide. L1 blocks contain four words; L2 blocks contain sixteen words. Access times are 2 ns for L1, 20 ns for L2 and 200 ns for main memory. On misses in both caches, a block is first transferred from main memory to L2, then a block from L2 to L1. What is the total transfer time?
Options: (A) 222 ns; (B) 888 ns; (C) 902 ns; (D) 968 ns.
Question 49, GATE 2010: An L1 cache connects to L2, which connects to main memory. Both connecting data buses are four words wide. L1 blocks contain four words; L2 blocks contain sixteen words. Access times are 2 ns for L1, 20 ns for L2 and 200 ns for main memory. On misses in both caches, a block is first transferred from main memory to L2, then a block from L2 to L1. What is the total transfer time?
Options: (A) 222 ns; (B) 888 ns; (C) 902 ns; (D) 968 ns.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

The L2 block has 16 words and the memory–L2 bus is 4 words wide, so filling it requires four transfers. Under the same non-overlapped read/write model as CS48, each costs 200 ns to read memory plus 20 ns to write L2: 4(200+20)=880 ns. The question says first fill L2, then transfer one 4-word block from L2 into L1, costing 20+2=22 ns. Total 902 ns, option C. No burst/pipelining/critical-word-first mechanism is specified; other timing models would require extra assumptions and are not used.

Keep the destination line size separate at each level: filling L2 moves sixteen words, hence four memory-bus transfers; filling L1 moves four words, hence one L2-bus transfer. The total is therefore 4×220+1×22, not four times the entire two-level path. The question explicitly orders the two fills, so their durations add in the model used.

Original paper, page 12

2 marks · MCQ
Report issue

Minimum spanning tree with a prescribed leaf

Graph Algorithms

Question 50, GATE 2010: A complete undirected graph has vertices 0,1,2,3,4 and symmetric weight matrix W, with rows/columns in that order: [[0,1,8,1,4],[1,0,12,4,9],[8,12,0,7,3],[1,4,7,0,2],[4,9,3,2,0]]. What is the minimum weight of a spanning tree in which vertex 0 is a leaf?
Options: (A) 7; (B) 8; (C) 9; (D) 10.
Question 50, GATE 2010: A complete undirected graph has vertices 0,1,2,3,4 and symmetric weight matrix W, with rows/columns in that order: [[0,1,8,1,4],[1,0,12,4,9],[8,12,0,7,3],[1,4,7,0,2],[4,9,3,2,0]]. What is the minimum weight of a spanning tree in which vertex 0 is a leaf?
Options: (A) 7; (B) 8; (C) 9; (D) 10.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (6 steps)

If vertex 0 is a leaf, removing it leaves a spanning tree on {1,2,3,4}; conversely any such tree plus one edge incident on 0 is feasible. Kruskal on the induced four-vertex graph chooses (3,4) of weight 2, (2,4) of weight 3, and (1,3) of weight 4, totaling 9. The cheapest edge from 0 has weight 1, either (0,1) or (0,3), hence the constrained minimum is 9+1=10, D. The unconstrained MST need not satisfy the leaf requirement.

The leaf constraint permits exactly one edge incident to 0. Therefore 0 cannot serve as a cheap connector joining vertices 1 and 3 through two weight-one edges. On vertices 1,2,3,4, the sorted edges begin 3–4:2, 2–4:3, 1–3:4; these three create no cycle and already connect all four vertices, proving the induced-tree minimum of 9.

Original paper, page 12

2 marks · MCQ
Report issue

Shortest path using at most three edges

Graph Algorithms

Question 51, GATE 2010: A complete undirected graph has vertices 0,1,2,3,4 and symmetric weight matrix W, with rows/columns in that order: [[0,1,8,1,4],[1,0,12,4,9],[8,12,0,7,3],[1,4,7,0,2],[4,9,3,2,0]]. What is the minimum weight of a path from vertex 1 to vertex 2 containing at most three edges?
Options: (A) 7; (B) 8; (C) 9; (D) 10.
Question 51, GATE 2010: A complete undirected graph has vertices 0,1,2,3,4 and symmetric weight matrix W, with rows/columns in that order: [[0,1,8,1,4],[1,0,12,4,9],[8,12,0,7,3],[1,4,7,0,2],[4,9,3,2,0]]. What is the minimum weight of a path from vertex 1 to vertex 2 containing at most three edges?
Options: (A) 7; (B) 8; (C) 9; (D) 10.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (14 steps)

The direct 1→2 path costs 12. With one intermediate vertex, costs via 0,3,4 are 9,11,12. With two distinct intermediate vertices, the six paths have costs: 1→0→3→2=9; 1→0→4→2=8; 1→3→0→2=13; 1→3→4→2=9; 1→4→0→2=21; 1→4→3→2=18. Thus minimum 8 is attained by 1→0→4→2, option B. All edge weights are positive, so adding a repeated-vertex cycle cannot improve a path within the edge limit.

An unconstrained shortest-path calculation is insufficient because it may return a path with four edges. Indeed 1→0→3→4→2 has weight 1+1+2+3=7 but violates the three-edge limit. Enumerating zero, one and two intermediate vertices is exhaustive for simple paths with at most three edges; the weight-eight candidate obeys the constraint.

Original paper, page 12

2 marks · MCQ
Report issue

Linear-probing insertion sequence

Hashing

Question 52, GATE 2010: A hash table has length ten, hash function h(k)=k mod 10, open addressing and linear probing. After six insertions into the initially empty table, slots 2,3,4,5,6,7 contain 42,23,34,52,46,33 respectively; slots 0,1,8,9 are empty. Which sequence could have produced this table?
Options: (A) 46,42,34,52,23,33; (B) 34,42,23,52,33,46; (C) 46,34,42,23,52,33; (D) 42,46,33,23,34,52.
Question 52, GATE 2010: A hash table has length ten, hash function h(k)=k mod 10, open addressing and linear probing. After six insertions into the initially empty table, slots 2,3,4,5,6,7 contain 42,23,34,52,46,33 respectively; slots 0,1,8,9 are empty. Which sequence could have produced this table?
Options: (A) 46,42,34,52,23,33; (B) 34,42,23,52,33,46; (C) 46,34,42,23,52,33; (D) 42,46,33,23,34,52.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Simulate option C: 46 hashes to slot 6, 34 to 4, 42 to 2, and 23 to 3. Then 52 starts at 2 and probes occupied slots 2,3,4, stopping at 5. Finally 33 starts at 3 and probes occupied slots 3,4,5,6, stopping at 7. This exactly reproduces the figure. In A, 52 is inserted before 23 and takes slot 3; in B, 33 is inserted before 46 and takes slot 6; in D, 33 takes slot 3 before 23. Those disagree with the shown table, leaving C.

Linear probing tests h(k),h(k)+1,… modulo ten until an empty slot is reached. This means final position depends on insertion order, not only on the hash value. In the valid order, the four home-slot keys 42,23,34,46 establish the required occupied run before the displaced keys arrive. Neither 52 nor 33 wraps around the table in this instance.

Original paper, page 13

2 marks · MCQ
Report issue

Count insertion sequences for a hash table

Hashing

Question 53, GATE 2010: A hash table has length ten, hash function h(k)=k mod 10, open addressing and linear probing. After six insertions into the initially empty table, slots 2,3,4,5,6,7 contain 42,23,34,52,46,33 respectively; slots 0,1,8,9 are empty. How many distinct insertion permutations of these six keys produce this table?
Options: (A) 10; (B) 20; (C) 30; (D) 40.
Question 53, GATE 2010: A hash table has length ten, hash function h(k)=k mod 10, open addressing and linear probing. After six insertions into the initially empty table, slots 2,3,4,5,6,7 contain 42,23,34,52,46,33 respectively; slots 0,1,8,9 are empty. How many distinct insertion permutations of these six keys produce this table?
Options: (A) 10; (B) 20; (C) 30; (D) 40.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

For 52 to reach slot 5, the final occupants 42,23,34 of slots 2,3,4 must already be present. For 33 to reach slot 7, occupants 23,34,52,46 of slots 3,4,5,6 must already be present. Together these constraints make 33 last, and require 42,23,34 before 52; 46 can be anywhere among the first five. Among permutations of the first five keys, 52 must be last among {42,23,34,52}, which happens in 1/4 of the 5! orders. Thus 5!/4=30, option C. These constraints are sufficient because the home-slot keys then occupy their intended slots. Exhaustive simulation of all 720 permutations independently yields 30.

A second count inserts 46 into a sequence containing the other five keys. The first three among those five are 42,23,34 in any of 3! orders, followed by 52 and then 33. The 46 key may be inserted in any of the five gaps before 33, giving 3!×5=30. Inserting it after 33 would allow 33 to occupy slot 6 instead of 7.

Original paper, page 13

2 marks · MCQ
Report issue

Unused links after distance-vector convergence

Routing Algorithms

Question 54, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. After routing tables stabilize, how many links are never used to carry data?
Options: (A) 4; (B) 3; (C) 2; (D) 1.
Question 54, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. After routing tables stabilize, how many links are never used to carry data?
Options: (A) 4; (B) 3; (C) 2; (D) 1.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

With positive link weights, an edge is unusable by any shortest path exactly when another path between its endpoints is strictly shorter. Link R1–R2 has weight 6 but R1–R3–R2 costs 3+2=5, so it is unused. Link R4–R6 has weight 8 but R4–R5–R6 costs 1+4=5, so it is also unused. Every remaining edge is itself a shortest path between its endpoints: R1–R3=3, R2–R3=2, R2–R4=7, R3–R5=9 and R4–R5=1, R5–R6=4. In particular the alternative to R3–R5 through R2,R4 costs 2+7+1=10, greater than 9. Thus exactly two links will never be selected, C. This assumes stabilized shortest-path routing, with data available for any source/destination pair.

To prove that an edge is never needed, replace it in any purported shortest route by the cheaper endpoint-to-endpoint route; the result is a shorter walk and, with positive weights, can be reduced to a path. Conversely, an edge strictly shortest between its own endpoints is needed for that endpoint pair. This avoids enumerating every source–destination routing table.

Original paper, page 14

2 marks · MCQ
Report issue

Unused links after weight changes

Routing Algorithms

Question 55, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. First determine the links never used after stabilization. Change every such link’s weight to 2 and rerun distance-vector routing until stable. How many links are now unused?
Options: (A) 0; (B) 1; (C) 2; (D) 3.
Question 55, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. First determine the links never used after stabilization. Change every such link’s weight to 2 and rerun distance-vector routing until stable. How many links are now unused?
Options: (A) 0; (B) 1; (C) 2; (D) 3.
Question 55, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. First determine the links never used after stabilization. Change every such link’s weight to 2 and rerun distance-vector routing until stable. How many links are now unused?
Options: (A) 0; (B) 1; (C) 2; (D) 3.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Change precisely the two previously unused links R1–R2 and R4–R6 to weight 2. Now R5–R6 has direct weight 4 but R5–R4–R6 costs 1+2=3, so it becomes unused. All other links remain shortest between their endpoints: the changed links have weight 2; R1–R3=3 beats R1–R2–R3=4; R2–R3=2; R2–R4=7 beats R2–R3–R5–R4=12; R3–R5=9 beats R3–R2–R4–R5=10; and R4–R5=1. Hence one link remains unused, B. Recompute routes after the weight changes rather than retaining the previous unused set.

Changing edge weights requires recomputing shortest paths globally. The former R4–R6 bypass is now the cheap direct edge of weight two; together with R4–R5 of weight one it undercuts R5–R6. The changed R1–R2 edge does not undercut R1–R3, since 2+2=4>3. These comparisons explain why the unused set changes rather than merely shrinking.

Original paper, page 14