GATE / CS ARCHIVE

PAPER / ORIGINAL ORDER

GATE 2026 · Set 2

65 questions

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

03:00:00
1 mark · MCQ
Report issue

Synonyms for speeding up

Vocabulary & Verbal Analogies

Question 1, GATE 2026: Complete the group Expedite, Hasten, Hurry with a word of similar meaning. Options: A Accelerate; B Retard; C Provide; D Disable.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

Complete the group Expedite, Hasten, Hurry with a word of similar meaning. Options: A Accelerate; B Retard; C Provide; D Disable.

Approach

Find the shared action, then compare each proposed meaning.

Step-by-step solution

1. Expedite means to make an action or process happen sooner. Hasten means to speed it up, and hurry means to proceed quickly. Their common feature is increased speed or reduced delay.
2. Accelerate means to increase speed. It preserves the shared meaning even though it may describe physical motion as well as a process.
3. Retard means to delay or slow something, which reverses the intended meaning. Provide means to supply something, and disable means to make something unable to function; neither expresses speeding up.
4. Therefore the completion is Accelerate, option A. Similarity of spelling is irrelevant; the comparison is between meanings.

Original paper, page 1 · Answer key

1 mark · MCQ
Report issue

Reconstructing a cut-out square

Geometry & Spatial Aptitude

Question 2, GATE 2026: A square has been cut into two pieces. Identify its missing piece among A (i), B (ii), C (iii), D (iv). On a 6×6 unit grid the retained piece has rows 111111 / 101100 / 100001 / 111011 / 100011 / 111111, where 1 denotes retained black material. Candidate outlines, aligned in a five-column bounding box, are: (i) 10011 / 11110 / 00100 / 11110; (ii) 10011 / 11110 / 00100 / 01110; (iii) 10011 / 11110 / 00100 / 11100; (iv) 10011 / 11110 / 00110 / 01100. The original page supplies the outlines.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

A square has been cut into two pieces. Identify its missing piece among A (i), B (ii), C (iii), D (iv). On a 6×6 unit grid the retained piece has rows 111111 / 101100 / 100001 / 111011 / 100011 / 111111, where 1 denotes retained black material. Candidate outlines, aligned in a five-column bounding box, are: (i) 10011 / 11110 / 00100 / 11110; (ii) 10011 / 11110 / 00100 / 01110; (iii) 10011 / 11110 / 00100 / 11100; (iv) 10011 / 11110 / 00110 / 01100. The original page supplies the outlines.

Approach

Treat the missing piece as the geometric complement of the retained piece, not as a merely similar silhouette.

Step-by-step solution

1. Overlay a unit grid following the equally spaced horizontal and vertical edges. The top and bottom full boundary strips and leftmost full column belong to the retained part. Complement the remaining cells and discard those empty outside rows and column to obtain a four-row, five-column missing-piece mask.
2. The first missing row needs one square on the left and two on the right. The next row requires the first four columns. These fix the arms and their connecting horizontal strip.
3. The third row needs only the central column. The fourth needs the first three columns, a bar extending left of that connection. Thus the exact mask is 10011 / 11110 / 00100 / 11100.
4. Candidate (iii) agrees cell by cell. Candidate (i) extends the last bar too far right, (ii) shifts that bar right, and (iv) adds a cell beside the middle connection and shortens the bottom-left extension.
5. Select C. Matching area alone would not prove a fit: every missing cell must be filled and no retained cell may be overlapped.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Exactly three cloudy days

Counting, Probability & Sets

Question 3, GATE 2026: Each day is independently cloudy with probability 0.5 and otherwise sunny. Find the probability of exactly three cloudy days in four days. Options: A 1/4; B 3/4; C 2/3; D 3/8.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

Each day is independently cloudy with probability 0.5 and otherwise sunny. Find the probability of exactly three cloudy days in four days. Options: A 1/4; B 3/4; C 2/3; D 3/8.

Approach

Count disjoint positions for the single sunny day.

Step-by-step solution

1. Independence means the probability of a particular four-day sequence is the product of its four daily probabilities. For example, CCCS has probability (1/2)3(1/2)=1/16.
2. The sunny day may occur in position 1, 2, 3, or 4. These give SCCC, CSCC, CCSC, and CCCS, four distinct outcomes.
3. Because the outcomes are mutually exclusive, add their probabilities: 4×1/16=1/4. Equivalently use the binomial formula C(4,3)(1/2)3(1/2).
4. Therefore A is correct. The value 3/4 is a fraction of days in a successful sequence, not the probability that such a sequence occurs.

Original paper, page 3 · Answer key

1 mark · MCQ
Report issue

Profit from two stock holdings

Arithmetic, Ratios & Percentages

Question 4, GATE 2026: Stocks A and B initially cost Rs.50 and Rs.80 per unit. An investor spends Rs.100 on A and Rs.80 on B, then sells everything at Rs.55 per A unit and Rs.70 per B unit. Find total profit in rupees: A 0; B 5; C 10; D 20.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

Stocks A and B initially cost Rs.50 and Rs.80 per unit. An investor spends Rs.100 on A and Rs.80 on B, then sells everything at Rs.55 per A unit and Rs.70 per B unit. Find total profit in rupees: A 0; B 5; C 10; D 20.

Approach

Compute units, sale proceeds, and net cash gain separately.

Step-by-step solution

1. The investor owns 100/50=2 units of A and 80/80=1 unit of B. Total purchase cost is 100+80=180 rupees.
2. The A units sell for 2×55=110 rupees, a gain of 110−100=10. The B unit sells for 70 rupees, a loss of 70−80=−10.
3. Total sale proceeds are 110+70=180. Net profit is proceeds minus cost: 180−180=0 rupees, option A.
4. Adding the per-unit changes 5 and −10 would incorrectly treat the two holdings as equal numbers of units. Percentage changes likewise require investment weights. The calculation assumes only the transactions specified, with no unmentioned fees.

Original paper, page 4 · Answer key

1 mark · MCQ
Report issue

Using a contrapositive

Data Interpretation & Logical Reasoning

Question 5, GATE 2026: Assume only that rain implies peacocks dance. Which must follow? A They dance only when it rains; B Dancing implies rain; C Not dancing implies no rain; D No rain implies not dancing.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

Assume only that rain implies peacocks dance. Which must follow? A They dance only when it rains; B Dancing implies rain; C Not dancing implies no rain; D No rain implies not dancing.

Approach

Translate the sentence as a one-way implication.

Step-by-step solution

1. Let R mean rain and D mean peacocks dance. The premise is R→D. Its only forbidden truth assignment is R=true and D=false.
2. If D is false, R cannot be true without violating the premise. Therefore ¬D→¬R follows. This is the contrapositive, option C.
3. Options A and B both require D→R. The original premise permits dancing without rain, so that converse is not guaranteed.
4. Option D is the inverse ¬R→¬D. A dry day on which the peacocks dance satisfies R→D but falsifies D, A, and B. This counterexample shows why a sufficient condition need not be necessary.

Original paper, page 4 · Answer key

2 marks · MCQ
Report issue

Keeping an analogy relationship consistent

Vocabulary & Verbal Analogies

Question 6, GATE 2026: Choose P and Q in Water:P :: Food:Q. Options: A Thirst,Hunger; B Drink,Hunger; C Thirst,Satiated; D Wet,Critic.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

Choose P and Q in Water:P :: Food:Q. Options: A Thirst,Hunger; B Drink,Hunger; C Thirst,Satiated; D Wet,Critic.

Approach

Use the same directional relationship in both pairs.

Step-by-step solution

1. Water is something used to relieve thirst. The analogous unmet need relieved by food is hunger. Thus the first pair and second pair both follow substance → need satisfied.
2. Option A supplies Thirst and Hunger, preserving this relationship and matching the grammatical role of both terms as needs.
3. B makes the first pair substance → action but the second substance → need. C pairs a need with a state after satisfaction. D gives a property associated with water and a person associated with evaluating things, not a parallel relation.
4. Therefore select A. A useful analogy test is to write one short sentence describing the first pair and substitute the second pair without changing the sentence structure.

Original paper, page 5 · Answer key

2 marks · MCQ
Report issue

Completing the dot-count square

Algebra, Equations & Number Patterns

Question 7, GATE 2026: In a 3×3 array of dot tiles, black-dot counts are 8,1,6 / 3,5,? / 4,9,?. Choose the upper/lower missing pair: A (i) 7,2; B (ii) 6,2; C (iii) 7,3; D (iv) 6,4. Each tile has nine positions; unfilled positions are hollow.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

In a 3×3 array of dot tiles, black-dot counts are 8,1,6 / 3,5,? / 4,9,?. Choose the upper/lower missing pair: A (i) 7,2; B (ii) 6,2; C (iii) 7,3; D (iv) 6,4. Each tile has nine positions; unfilled positions are hollow.

Approach

Test the common row, column, and diagonal total.

Step-by-step solution

1. The completed top row totals 8+1+6=15. The two complete columns total 8+3+4=15 and 1+5+9=15. This strongly suggests the familiar equal-sum 3×3 pattern.
2. The missing middle-row tile must therefore contain 15−3−5=7 black dots. The bottom-right tile must contain 15−4−9=2.
3. Check rather than stopping after the rows: the last column becomes 6+7+2=15. The diagonals are 8+5+2=15 and 6+5+4=15, so the proposed completion satisfies all these constraints.
4. The others fail at least one required count. This is the intended consistent magic-square rule; finite visual data cannot rule out every artificially invented alternative pattern.

Original paper, page 6 · Answer key

2 marks · MCQ
Report issue

Hamiltonian tours in two road graphs

Data Interpretation & Logical Reasoning

Question 8, GATE 2026: Graph (i) is the 4×4 grid: vertices (r,c), 1≤r,c≤4, joined to horizontal/vertical neighbors. Graph (ii) is K(2,3): two hubs each connected to the same three other vertices, with no other edges. Can a trip visit each city once and return to its start? A only (i); B only (ii); C both; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

Graph (i) is the 4×4 grid: vertices (r,c), 1≤r,c≤4, joined to horizontal/vertical neighbors. Graph (ii) is K(2,3): two hubs each connected to the same three other vertices, with no other edges. Can a trip visit each city once and return to its start? A only (i); B only (ii); C both; D neither.

Approach

Give a constructive Hamiltonian cycle for one graph and an impossibility proof for the other.

Step-by-step solution

1. The trip is a Hamiltonian cycle, not an Euler tour: vertices must be visited once, while edges need not all be used. At every vertex of a cycle exactly two incident edges are used.
2. For (i), take (1,1)→(1,2)→(1,3)→(1,4)→(2,4)→(2,3)→(2,2)→(3,2)→(3,3)→(3,4)→(4,4)→(4,3)→(4,2)→(4,1)→(3,1)→(2,1)→(1,1). Consecutive positions differ by one row or one column, so every move is a road.
3. This sequence contains all 16 vertices exactly once before returning. Thus it is a certificate of feasibility for (i).
4. In (ii), each of the three non-hub vertices has degree two. Including it in a Hamiltonian cycle forces both its edges, so including all three would require three cycle edges at each hub. A cycle has degree two, a contradiction. Equivalently, a bipartite cycle has even length but this graph has five vertices.
5. Only (i) is possible, so A. The graph structures were checked against the source drawing.

Original paper, page 7 · Answer key

2 marks · MCQ
Report issue

Checking shaded row and column totals

Data Interpretation & Logical Reasoning

Question 9, GATE 2026: A 4×4 grid must have row totals (3,1,2,2) and column totals (2,2,2,2). With 1 denoting shading, candidates have rows A (i): 1011/0101/0010/1100; B (ii): 1011/0100/0011/1100; C (iii): 1011/0110/0010/1100; D (iv): 1011/0100/0010/1101. Identify the correct candidate.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Givens and goal

A 4×4 grid must have row totals (3,1,2,2) and column totals (2,2,2,2). With 1 denoting shading, candidates have rows A (i): 1011/0101/0010/1100; B (ii): 1011/0100/0011/1100; C (iii): 1011/0110/0010/1100; D (iv): 1011/0100/0010/1101. Identify the correct candidate.

Approach

Check row constraints first, then verify all column constraints for the survivor.

Step-by-step solution

1. Candidate A has row totals 3,2,1,2, so its middle two rows violate the required 1 and 2. Candidate C has totals 3,2,1,2 and also fails.
2. Candidate D has totals 3,1,1,3, so its third and fourth rows are wrong. Candidate B has totals 3,1,2,2, matching all four requirements.
3. For B the first-column sum is 1+0+0+1=2; the second is 0+1+0+1=2; the third is 1+0+1+0=2; and the fourth is 1+0+1+0=2.
4. Thus B satisfies every constraint. The total shaded count is also 8 from both the row and column sums, a useful consistency check but insufficient on its own. Candidate matrices were read from the source image.

Original paper, page 8 · Answer key

2 marks · MCQ
Report issue

Prime sums of two die rolls

Counting, Probability & Sets

Question 10, GATE 2026: A fair six-sided die is rolled twice independently. Find the probability that the sum is prime. Options: A 3/36; B 13/36; C 15/36; D 19/36.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

A fair six-sided die is rolled twice independently. Find the probability that the sum is prime. Options: A 3/36; B 13/36; C 15/36; D 19/36.

Approach

Count ordered pairs, because the 36 roll pairs are equally likely but the sums are not.

Step-by-step solution

1. There are 6×6=36 ordered outcomes (first roll, second roll). Possible prime sums in the range 2 through 12 are 2,3,5,7,11.
2. Sum 2 has (1,1), giving 1 outcome. Sum 3 has (1,2),(2,1), giving 2. Sum 5 has (1,4),(2,3),(3,2),(4,1), giving 4.
3. Sum 7 has the six pairs (1,6),(2,5),(3,4),(4,3),(5,2),(6,1). Sum 11 has (5,6),(6,5), giving 2.
4. Therefore the favorable count is 1+2+4+6+2=15, and the probability is 15/36=5/12, option C. Simply dividing five prime sums by eleven possible sums would be invalid because those sums have unequal probabilities.

Original paper, page 9 · Answer key

1 mark · MCQ
Report issue

Quantifying an exceptional person

Propositional & Predicate Logic

Question 11, GATE 2026: M(x,y) means x knows y for distinct people. Express: one person knows nobody else but is known by everybody else. All choices use [(x≠y)→(M(x,y)∧¬M(y,x))], preceded by A ∃y∀x; B ∀y∃x; C ∃y∃x; D ∀y∀x.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

M(x,y) means x knows y for distinct people. Express: one person knows nobody else but is known by everybody else. All choices use [(x≠y)→(M(x,y)∧¬M(y,x))], preceded by A ∃y∀x; B ∀y∃x; C ∃y∃x; D ∀y∀x.

Approach

Choose the exceptional person before ranging over all other people.

Step-by-step solution

1. Let y name the person whose existence is claimed. The phrase there is requires ∃y. Once this y is fixed, every other person x must satisfy the two knowledge conditions, requiring ∀x.
2. For x≠y, everyone else knowing y is M(x,y). The same y knowing nobody else is ¬M(y,x). Both are needed, so join them with ∧.
3. Use an implication with antecedent x≠y to exclude self-knowledge from the requirement. When x=y the antecedent is false and imposes no restriction.
4. The complete expression is ∃y∀x[(x≠y)→(M(x,y)∧¬M(y,x))], A. B and C can choose x=y and satisfy the implication vacuously; they do not require all other people to know y. D incorrectly asserts the special property of every y, rather than at least one.

Original paper, page 10 · Answer key

1 mark · MCQ
Report issue

Recognizing binary-tree traversal order

Tree Properties & Traversals

Question 12, GATE 2026: Match I Inorder, II Preorder, III Postorder to L left-node-right, M node-left-right, N left-right-node. Options: A I-L,II-M,III-N; B I-M,II-L,III-N; C I-N,II-M,III-L; D I-L,II-N,III-M.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

Match I Inorder, II Preorder, III Postorder to L left-node-right, M node-left-right, N left-right-node. Options: A I-L,II-M,III-N; B I-M,II-L,III-N; C I-N,II-M,III-L; D I-L,II-N,III-M.

Approach

Locate the current node relative to its two recursively traversed subtrees.

Step-by-step solution

1. In an inorder traversal the current node is visited between its left and right subtrees: left, node, right. Therefore I matches L.
2. In preorder the current node is visited before either subtree: node, left, right. Hence II matches M. In postorder it is visited after both: left, right, node, so III matches N.
3. For a root r with left leaf l and right leaf t, these orders yield l,r,t; r,l,t; and l,t,r respectively. The same definition applies recursively at every internal node, not only at the root.
4. The combined matching is I-L, II-M, III-N, option A. In a BST, inorder also produces sorted keys, but the traversal definitions themselves apply to all binary trees.

Original paper, page 11 · Answer key

1 mark · MCQ
Report issue

Deciding versus recognizing a language

Turing Machines

Question 13, GATE 2026: For a Turing machine M and L⊆{0,1}*, which is equivalent to M deciding L? A M halts everywhere; B M accepts all members of L; C M rejects all nonmembers; D M accepts every member and rejects every nonmember.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Givens and goal

For a Turing machine M and L⊆{0,1}*, which is equivalent to M deciding L? A M halts everywhere; B M accepts all members of L; C M rejects all nonmembers; D M accepts every member and rejects every nonmember.

Approach

A decider must be both correct and terminating on every input.

Step-by-step solution

1. A decision procedure answers the membership question for every finite binary input. When the input belongs to L the answer must be acceptance, and otherwise it must be rejection.
2. Both accepting and rejecting are halting outcomes. Thus D guarantees termination on every input as well as the correct result, and exactly captures the definition.
3. A alone permits an always-accept machine even when L is a proper subset of {0,1}*. B permits accepting nonmembers too, or failing to halt on them. C permits wrongly rejecting members or looping on them.
4. Therefore D is necessary and sufficient. A recognizer need only accept precisely the members, and may loop on nonmembers; a decider has the additional total-halting requirement.

Original paper, page 12 · Answer key

1 mark · MCQ
Report issue

Identifying a Gaussian density

Probability & Statistics

Question 14, GATE 2026: For every real x, f(x)=[1/(3√(2π))]exp(−x²/18) is a probability density. Is X A exponential, B normal, C Poisson, or D uniform?
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Givens and goal

For every real x, f(x)=[1/(3√(2π))]exp(−x²/18) is a probability density. Is X A exponential, B normal, C Poisson, or D uniform?

Approach

Match both the exponent and the normalization factor to a standard density.

Step-by-step solution

1. The normal density with mean μ and standard deviation σ is [1/(σ√(2π))]exp(−(x−μ)²/(2σ²)). The given coefficient implies σ=3.
2. The exponent has x² rather than (x−μ)² with a nonzero shift, so μ=0. Its denominator is 18=2×9=2σ², independently confirming σ²=9.
3. Thus X is N(0,9), a normal random variable, option B. The scale parameter 3 is the standard deviation, not the variance.
4. A uniform density is constant on its support; an exponential density has a linear exponent on a one-sided support; a Poisson law assigns discrete masses to nonnegative integers. None matches this smooth two-sided Gaussian density.

Original paper, page 12 · Answer key

1 mark · MCQ
Report issue

Separating database schema levels

Database Models, Architecture & ER Diagrams

Question 15, GATE 2026: Match I logical schema, II physical schema, III external schema with L views, M file organization and indexes, N relations. Options: A I-L,II-M,III-N; B I-M,II-L,III-N; C I-N,II-M,III-L; D I-N,II-L,III-M.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

Match I logical schema, II physical schema, III external schema with L views, M file organization and indexes, N relations. Options: A I-L,II-M,III-N; B I-M,II-L,III-N; C I-N,II-M,III-L; D I-N,II-L,III-M.

Approach

Distinguish what is stored logically, how it is stored, and what a user sees.

Step-by-step solution

1. The logical schema describes database structure at the relation level: tables, attributes, and their logical relationships. It therefore matches N, relations.
2. The physical schema describes storage choices such as file layout and indexes. Those choices determine access paths without changing the logical relation definitions, so II matches M.
3. An external schema is a view of data exposed to a particular user or application. It may hide attributes or combine relations. Hence III matches L.
4. The resulting matching I-N,II-M,III-L is C. For example, a payroll view can remain unchanged while a new B+ tree index is added; this illustrates why external and physical descriptions are separate levels.

Original paper, page 13 · Answer key

1 mark · MCQ
Report issue

Finding a false Boolean identity

Boolean Algebra & Logic Gates

Question 16, GATE 2026: Here + is OR, · is AND, and prime is NOT. Which is not a Boolean identity? A a+b=b+a; B a·a′=1; C a+a′=1; D a·b=b·a.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Givens and goal

Here + is OR, · is AND, and prime is NOT. Which is not a Boolean identity? A a+b=b+a; B a·a′=1; C a+a′=1; D a·b=b·a.

Approach

Test complement laws on the two possible Boolean values.

Step-by-step solution

1. If a=0, then a′=1 and a·a′=0·1=0. If a=1, then a′=0 and a·a′=1·0=0. Thus a·a′ is always 0, never 1.
2. Consequently the equality in B is false. Its correct form is a·a′=0, the AND complement law.
3. For the same two cases, a+a′ is 0+1 or 1+0, both 1. C is therefore the valid OR complement law.
4. A and D are the commutative laws for OR and AND; swapping operands does not alter their truth tables. Answer B. Boolean + is logical OR here, not ordinary integer addition.

Original paper, page 14 · Answer key

1 mark · MCQ
Report issue

Locating dynamically allocated storage

Scope, Lifetime & Storage Classes

Question 17, GATE 2026: In the conventional C runtime model, which object is stored in the heap? A function-local static variable; B ordinary function-local integer array; C integer array allocated by malloc; D function return address.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

In the conventional C runtime model, which object is stored in the heap? A function-local static variable; B ordinary function-local integer array; C integer array allocated by malloc; D function return address.

Approach

Compare storage duration and allocation mechanism rather than source-code location.

Step-by-step solution

1. malloc requests dynamically allocated storage whose lifetime extends until it is released, typically by free. Conventional runtimes manage this storage in the heap. Thus C is the intended answer.
2. A local static variable exists for the program lifetime and conventionally occupies a static data region, despite its name having block scope. Scope does not determine storage duration.
3. An ordinary non-static local array has automatic storage duration and is conventionally placed in a stack frame. A return address is part of calling state, often on a stack or in an architecture-specific register.
4. A local pointer holding the malloc result can itself be in a stack frame while the array it points to is in the heap. The C standard specifies storage behavior, not physical regions literally named stack and heap; the answer uses the stated runtime convention.

Original paper, page 14 · Answer key

1 mark · MCQ
Report issue

Vectored interrupts and daisy-chain priority

Input/Output, DMA & Interrupts

Question 18, GATE 2026: S1 says non-vectored interrupts usually take longer than vectored interrupts to start the device ISR. S2 says daisy-chain interrupt handling has the CPU poll every input device separately. Options: A both true; B both false; C only S1 true; D only S2 true.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

S1 says non-vectored interrupts usually take longer than vectored interrupts to start the device ISR. S2 says daisy-chain interrupt handling has the CPU poll every input device separately. Options: A both true; B both false; C only S1 true; D only S2 true.

Approach

Distinguish ISR dispatch from hardware priority resolution.

Step-by-step solution

1. A vectored interrupt supplies a vector that identifies the appropriate service routine, often by indexing an interrupt-vector table. This enables direct dispatch to the required ISR.
2. A non-vectored mechanism typically enters a common location and needs extra identification or dispatch work before the device-specific ISR starts. Thus S1 is true in the usual organization; it is a typical comparison, not a universal timing theorem about all CPUs.
3. In a daisy chain, an interrupt-acknowledge signal propagates through devices in priority order. A requesting device captures the acknowledgement and identifies itself; devices earlier in the chain have priority.
4. The CPU need not poll each device individually in that mechanism. That description belongs to software polling, so S2 is false and C is correct.

Original paper, page 15 · Answer key

1 mark · MCQ
Report issue

Shadowing versus same-block redeclaration

Scope, Lifetime & Storage Classes

Question 19, GATE 2026: Each program includes stdio.h and has main returning 0. P1: file-scope int a=5; inside main, int a=7;. P2: inside one main block, int a=5; int a=7;. P3: inside one main block, int a=5; float a=7;. Which compiles without a required error? A only P1; B only P2; C only P3; D all.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

Each program includes stdio.h and has main returning 0. P1: file-scope int a=5; inside main, int a=7;. P2: inside one main block, int a=5; int a=7;. P3: inside one main block, int a=5; float a=7;. Which compiles without a required error? A only P1; B only P2; C only P3; D all.

Approach

Check whether declarations inhabit different scopes or attempt to define the same local identifier twice.

Step-by-step solution

1. P1 has an outer file-scope object and a distinct inner block-scope object. The inner a legally shadows the outer a inside main. The two definitions do not conflict because they are in different scopes.
2. P2 has two initialized definitions of the same ordinary automatic identifier in one block. It is not assignment to an existing object: the repeated type keyword introduces a second declaration/definition, which violates the constraints.
3. P3 also redeclares a in the same block, and additionally changes its type from int to float. This is not legal shadowing, because there is no nested inner block.
4. Only P1 is valid under the intended ANSI-C rules, so A. A compiler may issue a shadowing warning for P1, but an optional warning does not make the program invalid.

Original paper, page 16 · Answer key

1 mark · MCQ
Report issue

Recognizing conflicting transaction operations

Transactions & Concurrency Control

Question 20, GATE 2026: Two distinct concurrent transactions T1 and T2 both access object A. Which access pattern avoids a conflict on A? A both only read; B T1 reads,T2 writes; C T1 writes,T2 reads; D both write.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

Two distinct concurrent transactions T1 and T2 both access object A. Which access pattern avoids a conflict on A? A both only read; B T1 reads,T2 writes; C T1 writes,T2 reads; D both write.

Approach

Apply the same-object, different-transaction, at-least-one-write definition.

Step-by-step solution

1. Two operations conflict when they are from different transactions, access the same data item, and at least one is a write. The first two conditions are already given here.
2. Two reads do not change the object. Swapping their order does not change either observed value, so read-read is the nonconflicting pair.
3. In read-write or write-read, swapping order can change the value read. In write-write, it can change which written value remains. Hence B, C, and D all contain a conflict.
4. Therefore all accesses by both transactions to A must be reads, giving A. This local absence of conflict on A does not establish that the complete transactions have no conflicts on other objects.

Original paper, page 17 · Answer key

1 mark · MCQ
Report issue

File-transfer bottleneck and packetization

Physical Layer & Transmission

Question 21, GATE 2026: A 4-million-byte file crosses consecutive links of 2 Mbps, 500 kbps, and 1 Mbps. Propagation, processing, other traffic, and overhead are ignored; M=10⁶ and k=10³. Choose transfer time: A 731 s; B 64 s; C 8 s; D 16 s. Packet size and forwarding mode are not specified.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Givens and goal

A 4-million-byte file crosses consecutive links of 2 Mbps, 500 kbps, and 1 Mbps. Propagation, processing, other traffic, and overhead are ignored; M=10⁶ and k=10³. Choose transfer time: A 731 s; B 64 s; C 8 s; D 16 s. Packet size and forwarding mode are not specified.

Approach

Compute the intended bottleneck throughput, then separate it from exact store-and-forward completion time.

Step-by-step solution

1. Convert the file to bits: F=4×10⁶×8=32×10⁶ bits. The three rates are 2×10⁶, 0.5×10⁶, and 1×10⁶ bits per second.
2. In continuous pipelined transfer the slowest link determines sustained throughput: R=min(R1,R2,R3)=0.5×10⁶. Therefore F/R=64 seconds, the published answer B.
3. For a more explicit model, split the file into N equal store-and-forward packets of L bits, NL=F. The first packet needs L/R1+L/R2+L/R3 to traverse the path. Each later packet completes one bottleneck service time L/R2 after the preceding one.
4. The exact expression is L/R1+L/R2+L/R3+(N−1)L/R2=64+1.5×10⁻⁶L seconds. It approaches 64 as fill/drain effects become negligible. If the whole file is one stored unit, the time is 16+64+32=112 seconds.
5. Thus retain official B under the intended idealized throughput convention. Negligible propagation and processing do not themselves specify packet size or eliminate all serialization transients; 64 is not a forwarding-model-independent result.

Original paper, page 17 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Why DHCP uses broadcasts

IP Addressing, Fragmentation & Address Resolution

Question 22, GATE 2026: Which protocol may need to broadcast some application messages? A SMTP; B FTP; C DHCP; D HTTP.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

Which protocol may need to broadcast some application messages? A SMTP; B FTP; C DHCP; D HTTP.

Approach

Consider what a client knows before it has an IP configuration.

Step-by-step solution

1. A newly connected DHCP client may have neither a usable IP address nor the address of a DHCP server. It cannot begin by directing all messages to a known server address.
2. It can broadcast a DHCPDISCOVER message so reachable DHCP servers can respond. Depending on the state and flags, later DHCP messages may also be broadcast.
3. SMTP transfers mail, FTP transfers files, and HTTP exchanges web requests and responses conventionally using unicast communication with an identified endpoint. They do not have the same initial address-discovery requirement.
4. Therefore C is correct. The word may matters: DHCP can also use unicast in appropriate states; the claim is not that every DHCP message is broadcast. Link-layer discovery used beneath another protocol should not be confused with that protocol’s application messages.

Original paper, page 18 · Answer key

1 mark · MCQ
Report issue

Identifying non-preemptive scheduling

CPU Scheduling

Question 23, GATE 2026: Which CPU scheduling algorithm cannot be preemptive under its standard definition? A SRTF; B FCFS; C Round Robin; D Priority.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Givens and goal

Which CPU scheduling algorithm cannot be preemptive under its standard definition? A SRTF; B FCFS; C Round Robin; D Priority.

Approach

Distinguish the order of selecting ready jobs from taking the CPU away mid-burst.

Step-by-step solution

1. FCFS serves ready processes in order of arrival. Once selected, a process continues until it finishes its CPU burst or voluntarily blocks. Standard FCFS does not preempt that burst.
2. SRTF chooses the smallest remaining execution time. If a shorter job arrives, it may preempt the current job; this is the preemptive form of shortest-job scheduling.
3. Round Robin explicitly preempts when a time quantum expires and places an unfinished process back in the ready queue. Priority scheduling can be defined either with immediate higher-priority preemption or with selection only at release points.
4. Thus B is the intended answer. A hardware interrupt or a process blocking for I/O is not, by itself, evidence that the scheduler uses a preemptive FCFS policy.

Original paper, page 18 · Answer key

1 mark · MCQ
Report issue

Ordering four asymptotic functions

Asymptotic Analysis & Recurrences

Question 24, GATE 2026: With logarithms base 2, order n^(1/3), log n, log(n!), and 2^(log n) by increasing asymptotic growth. A log n,n^(1/3),2^(log n),log(n!); B n^(1/3),log n,log(n!),2^(log n); C log n,n^(1/3),log(n!),2^(log n); D 2^(log n),n^(1/3),log n,log(n!).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

With logarithms base 2, order n1/3, log n, log(n!), and 2log n by increasing asymptotic growth. A log n,n1/3,2log n,log(n!); B n1/3,log n,log(n!),2log n; C log n,n1/3,log(n!),2log n; D 2log n,n1/3,log n,log(n!).

Approach

Simplify the exponential and bound the factorial logarithm.

Step-by-step solution

1. Because the bases match, 2log₂n=n exactly. It must therefore be compared as a linear function, not as an arbitrary exponential.
2. Write log(n!)=Σ(k=1 to n)log k. Every summand is at most log n, giving an upper bound n log n. The last at least n/2 summands are at least log(n/2), giving a lower bound (n/2)log(n/2). Thus log(n!)=Θ(n log n).
3. Any fixed positive power of n eventually dominates log n, so log n=o(n1/3). Also n1/3/n=n−2/3→0, and n/(n log n)=1/log n→0.
4. The required increasing order is log n, n1/3, n, Θ(n log n), matching A. This is an eventual growth comparison, not a claim of strict ordering at every small input.

Original paper, page 19 · Answer key

1 mark · MSQ
Report issue

Solving four runtime recurrences

Asymptotic Analysis & Recurrences

Question 25, GATE 2026: All base cases are T(1)=1. Which recurrences give Θ(n)? A T(n)=T(n−1)+1; B T(n)=2T(n/2)+1; C T(n)=2T(n/2)+n; D T(n)=T(n−1)+n. For halving recurrences use powers of two or conventional rounding.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, B

Givens and goal

All base cases are T(1)=1. Which recurrences give Θ(n)? A T(n)=T(n−1)+1; B T(n)=2T(n/2)+1; C T(n)=2T(n/2)+n; D T(n)=T(n−1)+n. For halving recurrences use powers of two or conventional rounding.

Approach

Unroll decrement recurrences and sum levels in divide-and-conquer trees.

Step-by-step solution

1. A makes n−1 unit increments above its base: T(n)=1+(n−1)=n. It is Θ(n).
2. For B, n=2h gives a full binary recursion tree with n leaves. The leaves contribute n; its n−1 internal nodes each contribute 1. Thus T(n)=2n−1=Θ(n).
3. For C, level j has 2j subproblems of size n/2j, so its nonrecursive work is 2j(n/2j)=n. There are log₂n internal levels and n units at the leaves. Therefore T(n)=n log₂n+n=Θ(n log n).
4. D unrolls into 1+2+…+n=n(n+1)/2=Θ(n²). Unlike A, its added work grows with the current input size.
5. Only A and B are linear. Matching recursion shape alone is insufficient: B and C have the same branching but different work per node.

Original paper, page 20 · Answer key

1 mark · MSQ
Report issue

Square-product equivalence relation

Sets, Relations & Functions

Question 26, GATE 2026: On {1,…,10}, define xRy when xy is an integer square. Select all valid properties: A reflexive; B symmetric; C transitive; D antisymmetric.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, B, C

Givens and goal

On {1,…,10}, define xRy when xy is an integer square. Select all valid properties: A reflexive; B symmetric; C transitive; D antisymmetric.

Approach

Characterize each integer by the parity of its prime exponents.

Step-by-step solution

1. For every x, x·x=x² is a square; hence xRx and the relation is reflexive. If xy is a square, yx is the same product, proving symmetry.
2. For a prime p, let ep(x) be its exponent in x. The product xy is a square precisely when ep(x)+ep(y) is even for every p, equivalently when the two exponent parities agree for every p.
3. If xRy and yRz, the parity vector of x equals that of y and that of y equals that of z. Consequently x and z have equal parity vectors, so xz is square. This proves transitivity without assuming that a quotient of squares is automatically an integer square.
4. Antisymmetry would require x=y whenever both xRy and yRx. But 1 and 4 are distinct elements and 1×4=4 is square in both directions.
5. Thus A,B,C hold and D does not. The equivalence classes are {1,4,9}, {2,8}, {3}, {5}, {6}, {7}, {10}, providing a direct finite check.

Original paper, page 20 · Answer key

1 mark · MSQ
Report issue

An integral independent of its parameter

Calculus

Question 27, GATE 2026: For real a, I(a)=integral from −1 to 1 of (3x²−ax+1) dx. Select true statements: A independent of a; B can vary with a; C positive for some a; D negative for some a.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, C

Givens and goal

For real a, I(a)=integral from −1 to 1 of (3x²−ax+1) dx. Select true statements: A independent of a; B can vary with a; C positive for some a; D negative for some a.

Approach

Exploit symmetry and verify by an antiderivative.

Step-by-step solution

1. The only parameter-dependent term is −ax. It is odd in x, so its integral over the symmetric interval [−1,1] is zero for every fixed a.
2. The other contributions are ∫(−1 to 1)3x² dx=[x³] from −1 to 1=2, and ∫1 dx=2. Therefore I(a)=2+0+2=4.
3. Alternatively an antiderivative is x³−ax²/2+x. Its endpoint values are 2−a/2 and −2−a/2; their difference is again 4, making the parameter cancellation explicit.
4. A is true and B false because the result never changes with a. C is true, indeed for every a rather than merely some a. D is false because 4 cannot be negative. Select A,C. The integrand itself need not be positive everywhere for this conclusion.

Original paper, page 21 · Answer key

1 mark · MSQ
Report issue

Four-bit signed overflow

Number Systems & Computer Arithmetic

Question 28, GATE 2026: Use 4-bit two’s-complement integers N1=1011, N2=1101, N3=1010, N4=1001. Which operations overflow? A N1+N2; B N2+N3; C N3−N4; D N1+N4.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B, D

Step through it (4 options)

Givens and goal

Use 4-bit two’s-complement integers N1=1011, N2=1101, N3=1010, N4=1001. Which operations overflow? A N1+N2; B N2+N3; C N3−N4; D N1+N4.

Approach

Convert operands to signed values and compare exact results with the representable interval.

Step-by-step solution

1. Four-bit two’s complement represents −8 through 7. A bit pattern with leading 1 has signed value equal to its unsigned value minus 16. Thus N1=11−16=−5, N2=−3, N3=−6, N4=−7.
2. A gives −5+(−3)=−8, exactly the lower endpoint and therefore representable as 1000. Merely having a carry out does not establish signed overflow.
3. B gives −3+(−6)=−9, below −8. The retained four bits would be 0111, a positive 7, so signed overflow occurs. C gives −6−(−7)=1, represented by 0001, so it is safe.
4. D gives −5+(−7)=−12, also below the range. Its wrapped pattern is 0100, positive 4. Therefore B and D overflow.
5. For addition of same-sign operands, a changed result sign is a convenient equivalent test, but checking the exact mathematical result also handles the subtraction correctly.

Original paper, page 21 · Answer key

1 mark · MSQ
Report issue

Proving grammar ambiguity

Context-Free Grammars & Languages

Question 29, GATE 2026: Which grammars are ambiguous? A S→aSb|ε; B E→E+E|E*E|id; C S→aS|Sa|ε; D S→aS|ε.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B, C

Givens and goal

Which grammars are ambiguous? A S→aSb|ε; B E→E+E|E*E|id; C S→aS|Sa|ε; D S→aS|ε.

Approach

Exhibit two parse trees for ambiguous choices and explain uniqueness for the others.

Step-by-step solution

1. B generates id+id*id with root production E→E+E, whose right child expands by multiplication. It also generates the same string with root E→E*E, whose left child expands by addition. These are different tree structures, corresponding to id+(id*id) and (id+id)*id.
2. C already has two trees for the one-letter string a: use S→aS→aε, or S→Sa→εa. The root productions differ, so this is genuine ambiguity, not merely a different order of expanding independent nodes.
3. For A, every nonempty string is aⁿbⁿ. The first rule must be aSb and must be applied exactly n times, followed by ε. No alternative tree is possible for that n.
4. For D, a string aⁿ requires exactly n applications of aS followed by ε. Again the chain is unique.
5. Therefore B,C are ambiguous. The existence of an unambiguous grammar for the same language would not remove ambiguity from these particular grammars.

Original paper, page 22 · Answer key

1 mark · NAT
Report issue

Longest chain after hashing

Hashing

Question 30, GATE 2026: Insert keys 5,28,19,15,26,33,12,17,10 into a table with h(k)=k mod 9, resolving collisions by chaining. Find the longest chain length.
Tap to enlarge
Answer & solution

Official answer: 3

Step through it (11 steps)

Givens and goal

Insert keys 5,28,19,15,26,33,12,17,10 into a table with h(k)=k mod 9, resolving collisions by chaining. Find the longest chain length.

Approach

Group all keys by their remainder rather than by insertion adjacency.

Step-by-step solution

1. The nine remainders in order are 5,1,1,6,8,6,3,8,1. For example 28=3×9+1, 33=3×9+6, and 17=1×9+8.
2. Bucket 1 receives 28,19,10; bucket 3 receives 12; bucket 5 receives 5; bucket 6 receives 15,33; bucket 8 receives 26,17. Buckets 0,2,4,7 remain empty.
3. The nonempty chain lengths are therefore 3,1,1,2,2, summing to 9 as a consistency check with the number of inserted keys.
4. The maximum is 3. Whether chaining inserts at the head or tail changes order inside a bucket but not its length. Do not apply linear probing: the problem explicitly stores collisions in chains.

Original paper, page 22 · Answer key

1 mark · NAT
Report issue

Consistent dependent linear equations

Linear Algebra

Question 31, GATE 2026: The system ax+y=b and 16x+ay=24 has multiple solutions for chosen real a,b. Find ab.
Tap to enlarge
Answer & solution

Official answer: 24

Givens and goal

The system ax+y=b and 16x+ay=24 has multiple solutions for chosen real a,b. Find ab.

Approach

Require both singular coefficients and compatible right-hand sides.

Step-by-step solution

1. The coefficient matrix is [[a,1],[16,a]], with determinant a²−16. A nonzero determinant would give a unique solution; multiple solutions therefore require a²=16, or a=4 or a=−4.
2. Multiply the first equation by a: a²x+ay=ab. Under a²=16 its left side is identical to the second equation’s left side. Consistency then requires ab=24.
3. For a=4, choose b=6. The second equation is four times the first, leaving one free variable and infinitely many solutions. For a=−4, b=−6 likewise makes it −4 times the first.
4. Both admissible cases give ab=24. Setting only the determinant to zero is insufficient: for example a=4,b=5 would make the equations inconsistent, with no solutions rather than multiple solutions.

Original paper, page 22 · Answer key

1 mark · NAT
Report issue

Counting void merges

Searching, Sorting & Selection

Question 32, GATE 2026: Merge sort sorts [10,7,8,19,41,35,25,31] using its usual balanced contiguous halves and seven merges. A merge is void if its output is the sorted left half followed directly by the sorted right half. Count void merges.
Tap to enlarge
Answer & solution

Official answer: 3

Step through it (9 steps)

Givens and goal

Merge sort sorts [10,7,8,19,41,35,25,31] using its usual balanced contiguous halves and seven merges. A merge is void if its output is the sorted left half followed directly by the sorted right half. Count void merges.

Approach

List all seven merges and test max(left)≤min(right).

Step-by-step solution

1. At the lowest level the pairs are [10] with [7], [8] with [19], [41] with [35], and [25] with [31]. The second and fourth are already in concatenated sorted order; the first and third are not. This level contributes two void merges.
2. The next left merge combines [7,10] and [8,19]. Since 10>8, their elements interleave and it is not void. The next right merge combines [35,41] and [25,31]; since 41>25, it is not void either.
3. At the root the sorted halves are [7,8,10,19] and [25,31,35,41]. Because 19<25, concatenating them is already sorted. The final merge is void.
4. The count is 2+0+1=3 among the 4+2+1=7 merges. Void means the resulting ordering needs no interleaving, not that the recursive subarrays were originally sorted or that the implementation necessarily skips its merge routine.

Original paper, page 22 · Answer key

1 mark · NAT
Report issue

Usable addresses in a slash-20 subnet

IP Addressing, Fragmentation & Address Resolution

Question 33, GATE 2026: An IPv4 subnet has mask 255.255.240.0. Find the maximum number of conventional network-interface addresses assignable in that subnet.
Tap to enlarge
Answer & solution

Official answer: 4094

Step through it (3 steps)

Givens and goal

An IPv4 subnet has mask 255.255.240.0. Find the maximum number of conventional network-interface addresses assignable in that subnet.

Approach

Count host bits and remove the two reserved endpoint addresses.

Step-by-step solution

1. The mask in binary is 11111111.11111111.11110000.00000000. It contains 8+8+4=20 leading ones, so the prefix length is /20.
2. An IPv4 address has 32 bits. The host portion therefore has 32−20=12 bits and permits 2¹²=4096 different bit patterns.
3. The all-zero host field denotes the subnet itself, while the all-one host field is the subnet-directed broadcast address. Neither is assigned to a conventional interface in this subnet.
4. Thus the usable count is 4096−2=4094. The special treatment of /31 point-to-point links is irrelevant to a /20 subnet. Reserving addresses administratively would reduce a particular deployment’s capacity, but no such reservation is specified.

Original paper, page 23 · Answer key

1 mark · NAT
Report issue

Decoding an IEEE-754 bit pattern

Data Representation & Arithmetic

Question 34, GATE 2026: Decode hexadecimal 0xC2710000 as IEEE-754 binary32 and give its decimal value to two decimal places.
Tap to enlarge
Answer & solution

Official answer: -60.25 to -60.25

Our answer: -60.25

Step through it (6 steps)

Givens and goal

Decode hexadecimal 0xC2710000 as IEEE-754 binary32 and give its decimal value to two decimal places.

Approach

Extract sign, biased exponent, and fraction separately.

Step-by-step solution

1. The 32 bits are 11000010011100010000000000000000. Their binary32 split is sign 1 | exponent 10000100 | fraction 11100010000000000000000.
2. The sign contributes −1. The exponent field is 132, so the unbiased exponent is e=132−127=5. Since the exponent is neither all zero nor all one, use the normalized significand 1.f.
3. The fraction bits contribute 1/2+1/4+1/8+1/128=113/128. Thus the significand is 1+113/128=241/128.
4. The value is −(241/128)×2⁵=−241/4=−60.25. This value is exact, so rounding to two decimal places leaves −60.25. Do not interpret the entire 32-bit word as a two’s-complement integer; IEEE-754 uses separate fields.

Original paper, page 23 · Answer key

1 mark · NAT
Report issue

Maximal-munch lexical tokens

Lexical Analysis

Question 35, GATE 2026: Identifiers are letter(letter|digit)*; numbers are digit+; whitespace is ignored. Letters are A-Z or a-z. Tokenize x1 23mm 78 y 7z zz5 14A 8H AaYcD and count non-whitespace tokens.
Tap to enlarge
Answer & solution

Official answer: 13

Givens and goal

Identifiers are letter(letter|digit)*; numbers are digit+; whitespace is ignored. Letters are A-Z or a-z. Tokenize x1 23mm 78 y 7z zz5 14A 8H AaYcD and count non-whitespace tokens.

Approach

At each position take the longest prefix matching a token definition.

Step-by-step solution

1. A letter-starting run can include later digits, so x1, zz5, and AaYcD are each a single identifier. A digit-starting run cannot be an identifier because the initial-letter condition fails.
2. Consequently 23mm splits as number 23 then identifier mm; 7z splits as 7 and z; 14A splits as 14 and A; 8H splits as 8 and H. Whitespace is a separator but is not required at every token boundary.
3. The full sequence is x1 | 23 | mm | 78 | y | 7 | z | zz5 | 14 | A | 8 | H | AaYcD. Numbering these items gives 13 non-whitespace tokens.
4. Equivalently the nine whitespace-separated chunks contribute 1+2+1+1+2+1+2+2+1=13. The answer follows the specified lexer definitions, not any additional rules a particular programming language might impose on malformed numeric literals.

Original paper, page 23 · Answer key

2 marks · MCQ
Report issue

Edge-disjoint spanning trees and Jaccard similarity

Trees & Connectivity

Question 36, GATE 2026: For the complete graph K_n with n>4, represent spanning trees by their edge sets. Jaccard similarity is |T1∩T2|/|T1∪T2|. Find the minimum possible value: A 1/n; B 1/(2n−3); C 0; D 1/(n−1).
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

For the complete graph Kn with n>4, represent spanning trees by their edge sets. Jaccard similarity is |T1∩T2|/|T1∪T2|. Find the minimum possible value: A 1/n; B 1/(2n−3); C 0; D 1/(n−1).

Approach

Prove a lower bound and construct two trees attaining it.

Step-by-step solution

1. Cardinalities are nonnegative and the union of spanning trees is nonempty, so Jaccard similarity cannot be below 0. To attain 0 we need trees sharing no edge.
2. Label vertices 1,…,n. Choose T1 as the path 1−2−3−…−n, with edge set {(i,i+1):1≤i<n}. It is connected and has n−1 edges.
3. Choose T2 with edges {(1,j):3≤j≤n} together with (2,4). Vertices 1,3,…,n are connected through vertex 1, and vertex 2 joins through 4. There are (n−2)+1=n−1 edges; a connected graph on n vertices with n−1 edges is a tree.
4. No edge (1,j) for j≥3 is a consecutive-vertex edge of T1, and (2,4) is not consecutive either. Thus the two edge sets are disjoint, although they have the same vertex set.
5. The intersection has size 0 and the union size 2n−2, giving 0/(2n−2)=0. This attains the lower bound, so C. The completeness of Kn guarantees all constructed edges exist.

Original paper, page 24 · Answer key

2 marks · MCQ
Report issue

Linear-time shortest paths in a DAG

Graph Algorithms

Question 37, GATE 2026: A weighted directed acyclic graph has n vertices and m edges, with a specified source s. Find the fastest worst-case complexity to compute shortest-path distances from s to reachable vertices: A Θ(m+n); B Θ(m+n log n); C Θ(nm); D Θ(n³).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

A weighted directed acyclic graph has n vertices and m edges, with a specified source s. Find the fastest worst-case complexity to compute shortest-path distances from s to reachable vertices: A Θ(m+n); B Θ(m+n log n); C Θ(nm); D Θ(n³).

Approach

Use an order in which every predecessor is settled before its successors.

Step-by-step solution

1. A DAG has a topological ordering: each edge u→v goes forward in that order. Compute one using indegrees or DFS in O(m+n) time with adjacency lists.
2. Initialize d[s]=0 and d[v]=∞ for all other vertices. Process vertices in topological order; for each outgoing edge u→v of weight w, set d[v]=min(d[v],d[u]+w) when d[u] is finite.
3. When u is processed, every possible final edge of a path into u comes from an earlier vertex. By induction, all those predecessor distances are final, so d[u] is the shortest distance. Negative edge weights do not break this argument because there are no cycles or backward dependencies.
4. Each vertex is initialized/processed once and each edge relaxed once, totaling O(m+n). Worst-case instances require reading relevant edge weights and producing vertex distances, giving a matching linear lower bound in the standard input model.
5. Thus A is correct. Dijkstra’s priority queue and Bellman-Ford’s repeated passes are unnecessary when acyclicity supplies the processing order.

Original paper, page 25 · Answer key

2 marks · MCQ
Report issue

Checking increasing adjacent differences

Correctness, Invariants & Design

Question 38, GATE 2026: For integer A[1…n], determine whether for every i>j in {1,…,n−1}, A[i+1]−A[i] > A[j+1]−A[j]. Choose optimal worst-case time: A Θ(n); B Θ(log n); C Θ(n log n); D Θ(n²).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

For integer A[1…n], determine whether for every i>j in {1,…,n−1}, A[i+1]−A[i] > A[j+1]−A[j]. Choose optimal worst-case time: A Θ(n); B Θ(log n); C Θ(n log n); D Θ(n²).

Approach

Reduce all pairwise comparisons to adjacent comparisons using transitivity.

Step-by-step solution

1. Define d_i=A[i+1]−A[i]. The condition says each later difference is larger than every earlier one. This is equivalent to d_1<d_2<…<d_(n−1).
2. The forward implication includes all adjacent pairs. Conversely, if adjacent inequalities hold, chaining d_j<d_(j+1)<…<d_i proves the required inequality for every i>j.
3. Algorithm: if n≤2 return true; set previous=A[2]−A[1]; for i=2,…,n−1 set current=A[i+1]−A[i]; if current≤previous return false; otherwise set previous=current. If the loop ends return true. Only O(1) extra storage is needed.
4. The loop uses O(n) time. For a lower bound, consider a valid array such as A[i]=i², whose differences are strictly increasing. If any position is unread, an adversary can change that entry sufficiently to violate a neighboring comparison while leaving all inspected values unchanged. Thus worst-case inspection requires Ω(n) entries for n≥3.
5. The optimal bound is Θ(n), A. Use sufficiently wide arithmetic so subtraction does not overflow; the proof is in the mathematical-integer model.

Original paper, page 25 · Answer key

2 marks · MCQ
Report issue

Two valid dynamic-programming orders

Dynamic Programming

Question 39, GATE 2026: T[0][k]=T[k][0]=1 for 0≤k≤n; for 1≤i,j≤n use T[i][j]=2T[i−1][j]+3T[i][j−1]. All cells initially equal 1. B1 loops i=1…n then j=1…n and updates each interior cell. B2 loops s=2…2n, then all i,j=1…n, updating only when i+j=s. Which is correct? A both; B only B1; C only B2; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

T[0][k]=T[k][0]=1 for 0≤k≤n; for 1≤i,j≤n use T[i][j]=2T[i−1][j]+3T[i][j−1]. All cells initially equal 1. B1 loops i=1…n then j=1…n and updates each interior cell. B2 loops s=2…2n, then all i,j=1…n, updating only when i+j=s. Which is correct? A both; B only B1; C only B2; D neither.

Approach

Check whether the dependencies are ready before each update.

Step-by-step solution

1. Each interior cell depends only on its upper neighbor (i−1,j) and left neighbor (i,j−1). The coefficients 2 and 3 do not affect the ordering requirement.
2. In B1, row i−1 has already been completed when row i begins. Within row i, j increases, so the left neighbor has already been computed. Boundary neighbors retain their initialized correct values.
3. In B2, both dependencies have coordinate sum i+j−1=s−1. They were processed in the previous diagonal layer, unless they lie on a preinitialized boundary. Every interior cell has a unique sum between 2 and 2n and is updated exactly once.
4. For a small check, T[1][1]=2+3=5; T[1][2]=2×1+3×5=17; T[2][1]=2×5+3×1=13; T[2][2]=2×17+3×13=73. Either order produces these values.
5. Both are correct, A. B1 performs Θ(n²) work, whereas the stated B2 scans n² pairs for Θ(n) values of s and takes Θ(n³). Correctness does not require equal efficiency.

Original paper, page 26 · Answer key

2 marks · MCQ
Report issue

Simplifying an eight-minterm Boolean function

Logic Minimization & Karnaugh Maps

Question 40, GATE 2026: With A the most significant bit and D the least significant, F(A,B,C,D)=Σm(0,1,2,3,8,9,10,11). Choose minimal SOP: A A′+B′+C′+D′; B B′; C A′B′+AB; D A′.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (9 steps)

Givens and goal

With A the most significant bit and D the least significant, F(A,B,C,D)=Σm(0,1,2,3,8,9,10,11). Choose minimal SOP: A A′+B′+C′+D′; B B′; C A′B′+AB; D A′.

Approach

Find which input bit is fixed across exactly the listed minterms.

Step-by-step solution

1. Minterms 0,1,2,3 are binary 0000,0001,0010,0011. They have A=0,B=0 while C,D take all four combinations, so together they give A′B′.
2. Minterms 8,9,10,11 are 1000,1001,1010,1011. They have A=1,B=0 while C,D again vary freely, giving AB′.
3. Combine the groups: F=A′B′+AB′=(A′+A)B′=B′. Thus F is 1 precisely when B=0, independently of the other inputs.
4. The function is not constant, so at least one literal is required. B′ uses one literal and is therefore minimal, selecting B. For example minterm 8 rules out A′, while minterm 4 has B=1 and must evaluate to zero, ruling out an OR of all four complements.

Original paper, page 27 · Answer key

2 marks · MCQ
Report issue

Counting LR(0) shift-reduce conflicts

Parsing & Syntax Analysis

Question 41, GATE 2026: Use canonical LR(0) parsing for S→ACB, A→aA|ε, C→cC|ε, B→bB|b, with start S. Count shift-reduce conflicts in the ACTION table: A 2; B 3; C 4; D 5.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Step through it (21 steps)

Givens and goal

Use canonical LR(0) parsing for S→ACB, A→aA|ε, C→cC|ε, B→bB|b, with start S. Count shift-reduce conflicts in the ACTION table: A 2; B 3; C 4; D 5.

Approach

Construct the relevant item closures and identify states containing both a shift and a completed item.

Step-by-step solution

1. Augment with S′→S. A completed LR(0) item X→α· requests a reduction on every terminal, without restricting it to FOLLOW(X). It conflicts with any terminal shift present in the same state.
2. The initial state contains S′→·S, S→·ACB, A→·aA, A→·. It shifts a and reduces A→ε, giving one conflicting ACTION cell on a. After shifting a, the state contains A→a·A and the same two A closure items, giving a second conflict on a.
3. After recognizing A, the state contains S→A·CB, C→·cC, C→·. It shifts c and reduces C→ε, giving one conflict on c. After shifting c, the state contains C→c·C with the same C closure items, giving another conflict on c.
4. After recognizing AC, the B closure has B→·bB and B→·b. Shifting b reaches {B→b·B, B→b·, B→·bB, B→·b}. This state shifts b and reduces B→b, giving the fifth conflict.
5. The remaining completed states contain only S′→S·, A→aA·, C→cC·, S→ACB·, or B→bB·; they have no terminal shift. The state before reading B also has no completed item. These account for all 11 canonical states.
6. Therefore there are exactly five conflicting cells, D. Using SLR FOLLOW restrictions instead would be a different parsing method and could change which conflicts remain.

Original paper, page 28 · Answer key

2 marks · MCQ
Report issue

Deriving the union rule for functional dependencies

Functional Dependencies & Keys

Question 42, GATE 2026: Armstrong rules are reflexivity (Y⊆X implies X→Y), augmentation (X→Y implies XZ→YZ), and transitivity. To derive union, X→Y and X→Z imply X→YZ, which listed rule set is necessary and sufficient? A all three; B reflexivity+augmentation; C transitivity; D augmentation+transitivity.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Givens and goal

Armstrong rules are reflexivity (Y⊆X implies X→Y), augmentation (X→Y implies XZ→YZ), and transitivity. To derive union, X→Y and X→Z imply X→YZ, which listed rule set is necessary and sufficient? A all three; B reflexivity+augmentation; C transitivity; D augmentation+transitivity.

Approach

Construct a proof that does not use reflexivity, then rule out the smaller listed alternatives.

Step-by-step solution

1. Augment the premise X→Y with X. Because attribute-set union is idempotent, XX=X; this gives X→XY.
2. Augment the premise X→Z with Y. This gives XY→ZY, which is XY→YZ because attribute-set union is commutative.
3. Apply transitivity to X→XY and XY→YZ to obtain X→YZ. Thus augmentation and transitivity suffice, with no application of reflexivity.
4. Transitivity alone cannot generally introduce a new combined right-hand-side set. For singleton distinct attributes X={x},Y={y},Z={z}, the two premises x→y and x→z provide no chain yielding x→yz.
5. Reflexivity and augmentation without transitivity also do not generally combine two premises. Starting from x→y, augmentation by z yields xz→yz, not x→yz; starting from x→z and adding y yields xy→yz. Removing the added left-side attribute requires a further inference not available in those two rules.
6. The minimal listed combination for the general derivation is D. This necessity concerns the rule schema for arbitrary attribute sets, not special cases where Y or Z is already contained in another set.

Original paper, page 29 · Answer key

2 marks · MCQ
Report issue

Computing a CRC remainder

Data Link, Framing, Error Control & ARQ

Question 43, GATE 2026: Data bits 110001011 use CRC generator 1001. Which 3-bit remainder is appended? A 011; B 101; C 000; D 100.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Step through it (9 steps)

Givens and goal

Data bits 110001011 use CRC generator 1001. Which 3-bit remainder is appended? A 011; B 101; C 000; D 100.

Approach

Divide the zero-extended message by the generator over GF(2).

Step-by-step solution

1. The generator has degree 3, so append three zeros: 110001011000. In polynomial form the message is M=x⁸+x⁷+x³+x+1 and the divisor is G=x³+1.
2. Long division starts with x¹¹+x¹⁰+x⁶+x⁴+x³. XOR x⁸G to cancel x¹¹, leaving x¹⁰+x⁸+x⁶+x⁴+x³. XOR x⁷G to leave x⁸+x⁷+x⁶+x⁴+x³.
3. Continue XOR division: subtract x⁵G to obtain x⁷+x⁶+x⁵+x⁴+x³; subtract x⁴G to obtain x⁶+x⁵+x³; subtract x³G to obtain x⁵; finally subtract x²G to obtain x². Each subtraction is XOR, so duplicate monomials cancel.
4. Thus the remainder is x², represented by 100, option D. A shorter independent check uses x³≡1 modulo G: x⁸+x⁷+x³+x+1 reduces to x²+x+1+x+1=x², and the appended factor x³ does not change it.
5. The transmitted bits are 110001011100. XORing this remainder into the zero-extended message makes it divisible by 1001. CRC division uses XOR, never carries or ordinary integer subtraction.

Original paper, page 30 · Answer key

2 marks · MCQ
Report issue

Allocating variable-length opcodes

Instructions & Addressing Modes

Question 44, GATE 2026: Instructions are 16 bits and there are 16 registers. An M instruction has two register operands plus a 6-bit immediate; R has three register operands; C has one register plus a 6-bit offset. Given 2 M opcodes and 7 R opcodes, maximize C opcodes. Options: A 8; B 4; C 64; D 16.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Givens and goal

Instructions are 16 bits and there are 16 registers. An M instruction has two register operands plus a 6-bit immediate; R has three register operands; C has one register plus a 6-bit offset. Given 2 M opcodes and 7 R opcodes, maximize C opcodes. Options: A 8; B 4; C 64; D 16.

Approach

Count occupied instruction encodings, then show the remaining space can be decoded unambiguously.

Step-by-step solution

1. Each register field needs log₂16=4 bits. M operands use 4+4+6=14 bits, leaving a 2-bit opcode. Each M opcode covers 2¹⁴ instruction words; two cover 2¹⁵, half of all 2¹⁶ words.
2. R operands use 12 bits, leaving a 4-bit opcode. Seven R opcodes cover 7×2¹²=28672 words, or 7/16 of the full space. M and R together occupy 1/2+7/16=15/16.
3. C operands use 4+6=10 bits, leaving a 6-bit opcode. Each C opcode covers 2¹⁰ words. The remaining capacity is (1/16)×2¹⁶=4096 words, so at most 4096/1024=4 C opcodes fit.
4. This upper bound is achievable with prefixes: use 00 and 01 for M. Of the eight remaining length-four prefixes 1000 through 1111, reserve seven for R. Extend the last prefix 1111 by 00,01,10,11 for four six-bit C opcodes.
5. No instruction format’s opcode is a prefix of another assigned opcode in this construction. Therefore four is both feasible and maximal, giving B. Simply observing that six bits permit 64 values ignores the already occupied encoding space.

Original paper, page 30 · Answer key

2 marks · MCQ
Report issue

Live variables across a control-flow loop

Code Optimization & Data-Flow Analysis

Question 45, GATE 2026: Blocks execute B1: a=b+c; B2: d=a+e; B3: e=a+f; B4: g=d+e. Edges are entry→B1, B1→B2, B1→B3, B2→B4, B3→B1, B4→exit. No variable is live after exit. Candidate exit sets (B1,B2,B3,B4) are A ({a,b,c,e,f},{d,e},{b,c,e,f},∅); B (∅,{d,e},{a,c,f},∅); C ({a,b,c,e,f},{d,e},{c,e,f},∅); D (∅,{d,e,f},{a,b,c,e,f},∅).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

Blocks execute B1: a=b+c; B2: d=a+e; B3: e=a+f; B4: g=d+e. Edges are entry→B1, B1→B2, B1→B3, B2→B4, B3→B1, B4→exit. No variable is live after exit. Candidate exit sets (B1,B2,B3,B4) are A ({a,b,c,e,f},{d,e},{b,c,e,f},∅); B (∅,{d,e},{a,c,f},∅); C ({a,b,c,e,f},{d,e},{c,e,f},∅); D (∅,{d,e,f},{a,b,c,e,f},∅).

Approach

Solve backward liveness equations to a fixed point, including the loop edge.

Step-by-step solution

1. For each block, OUT is the union of successor IN sets; IN=USE∪(OUT−DEF). Here USE/DEF are B1:{b,c}/{a}, B2:{a,e}/{d}, B3:{a,f}/{e}, and B4:{d,e}/{g}.
2. OUT4=∅, so IN4={d,e}. Hence OUT2={d,e} and IN2={a,e}∪({d,e}−{d})={a,e}.
3. The loop equations are OUT3=IN1, IN3={a,f}∪(IN1−{e}), OUT1=IN2∪IN3, and IN1={b,c}∪(OUT1−{a}). Starting empty and propagating produces the least fixed point IN1={b,c,e,f} and IN3={a,b,c,f}.
4. Substitute back to check: OUT1={a,e}∪{a,b,c,f}={a,b,c,e,f}; removing a and adding b,c indeed gives IN1={b,c,e,f}. OUT3=IN1={b,c,e,f}; removing e and adding a,f indeed gives IN3={a,b,c,f}.
5. The requested exit sets are therefore OUT1={a,b,c,e,f}, OUT2={d,e}, OUT3={b,c,e,f}, OUT4=∅, matching A. In particular b stays live through B3 because the loop can return to B1 and read b before any redefinition.
6. The source assignments and all arrows were inspected visually. Ignoring the back edge would incorrectly remove values needed on a later loop iteration.

Original paper, page 31 · Answer key

2 marks · MCQ
Report issue

Dense hash indexes and sparse tree indexes

Indexing, Storage & Query Processing

Question 46, GATE 2026: An index is dense if it has an entry for every search-key value in its indexed file; otherwise it is sparse. S1: a hash index must be dense. S2: a B+ tree index can be sparse. Options: A both true; B both false; C only S1; D only S2.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

An index is dense if it has an entry for every search-key value in its indexed file; otherwise it is sparse. S1: a hash index must be dense. S2: a B+ tree index can be sparse. Options: A both true; B both false; C only S1; D only S2.

Approach

Ask whether omitted keys can be found from an ordered boundary entry.

Step-by-step solution

1. In the standard hash-index model, searching key k uses h(k) to locate its bucket and then the relevant search-key entry. Hash values do not arrange keys in sorted order, so an entry for a nearby smaller key does not identify where an omitted key belongs.
2. Consequently the search-key index must represent every indexed value: S1 is true under the problem’s dense/sparse definition. A bucket directory is a different structure from the entries for the indexed search-key values.
3. For an ordered data file, a B+ tree can hold just one boundary key per data block. Searching for k finds the appropriate boundary and follows its pointer, then scans that block for k. Most individual keys need not appear in the index.
4. This is a valid sparse B+ tree index, establishing S2. A B+ tree can also be dense, but the statement only says can be sparse.
5. Thus A is correct. Sparseness relies on the supporting ordered-file organization; a sparse boundary index over arbitrary unordered records would not provide this search guarantee.

Original paper, page 32 · Answer key

2 marks · MSQ
Report issue

Languages of two three-step automata

Finite Automata

Question 47, GATE 2026: Transcribe the source automata as follows; s is the only start/accept state and omitted transitions reject. D1: s−0→u, s−1→v, u−0→w, u−1→z, w−0→s, w−1→s, z−0→s, v−0→t, t−1→s. D2: s−0→u, s−1→v, u−1→w, v−0→t, v−1→t and v−1→w, w−1→s, t−0→s. Select: A equal languages; B L(D1) proper subset of L(D2); C intersection {ε}; D (L(D1)∪L(D2))* is all binary strings of length divisible by 3.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: C, D

Givens and goal

Transcribe the source automata as follows; s is the only start/accept state and omitted transitions reject. D1: s−0→u, s−1→v, u−0→w, u−1→z, w−0→s, w−1→s, z−0→s, v−0→t, t−1→s. D2: s−0→u, s−1→v, u−1→w, v−0→t, v−1→t and v−1→w, w−1→s, t−0→s. Select: A equal languages; B L(D1) proper subset of L(D2); C intersection {ε}; D (L(D1)∪L(D2))* is all binary strings of length divisible by 3.

Approach

Enumerate the three-edge returns to the accepting state and exploit unique block boundaries.

Step-by-step solution

1. In D1 the upper paths give 000 and 001 through u,w, and 010 through u,z. The lower path through v,t gives 101. Thus L(D1)={000,001,010,101}*, since every accepting return to s has exactly three symbols.
2. In D2 the path through u,w gives 011. Paths through v,t give 100 and 110, and the path through v,w gives 111. Hence L(D2)={011,100,110,111}*. The two transitions from v on 1 are nondeterministic alternatives, both included.
3. These two block sets are disjoint. A nonempty string of length divisible by three has a unique partition into successive three-bit blocks starting at position 1. Its first block cannot simultaneously belong to both sets, so the languages have no common nonempty word.
4. Both automata accept ε because their start state is accepting. Thus the intersection is exactly {ε}, proving C. The word 000 is accepted only by D1, refuting both equality and the claimed subset in A and B.
5. Together the two block sets contain all eight three-bit words. Kleene star of the union permits concatenations mixing blocks from either automaton, yielding every binary word of length 3k, including k=0. Conversely each concatenated component has length divisible by 3. This proves D.
6. Select C,D. The outer star in D is essential: the plain union need not accept a word whose successive blocks alternate between the two sets. Transitions were verified on the source image.

Original paper, page 33 · Answer key

2 marks · MSQ
Report issue

Context-free constraints on four blocks

Context-Free Grammars & Languages

Question 48, GATE 2026: Consider strings a^i b^j c^k d^ℓ with i,j,k,ℓ≥0. Which restrictions yield context-free languages? A i+k=j+ℓ; B i=k and j=ℓ; C i=ℓ and j=k; D i+j=k+ℓ.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, C, D

Givens and goal

Consider strings ai bj ck d^ℓ with i,j,k,ℓ≥0. Which restrictions yield context-free languages? A i+k=j+ℓ; B i=k and j=ℓ; C i=ℓ and j=k; D i+j=k+ℓ.

Approach

Give stack constructions for the positive choices and a pumping-lemma contradiction for the crossing equalities.

Step-by-step solution

1. For A, scan the string while tracking block order a*b*c*d* in finite control. Maintain the signed difference (#a+#c)−(#b+#d). Store its sign in the finite state and its absolute value as repeated stack symbols. On a or c, add 1; on b or d, subtract 1, popping if this cancels the current sign and pushing otherwise. Accept exactly when the final difference is zero. This is a pushdown automaton, so A is context-free.
2. For D, check block order, push one marker for every a or b, and pop one for every c or d. Reject an attempt to pop an empty counter and accept exactly with zero balance at the end. This enforces i+j=k+ℓ.
3. For C the equalities are nested. The grammar S→aSd|T, T→bTc|ε generates precisely ai bj cj di: outer recursion matches a with d, inner recursion matches b with c. Hence C is context-free.
4. For B suppose a context-free pumping length p exists, and take w=ap bp cp dp. Every decomposition w=uvxyz with |vxy|≤p and |vy|>0 has its pumping window in one block or at most two adjacent blocks. It cannot reach both members of either matching pair a/c or b/d.
5. Pump v and y away, using exponent 0. At least one block count decreases, and its matching nonadjacent block is untouched. The equality i=k or j=ℓ therefore fails. This contradicts the pumping lemma for every allowed decomposition, so B is not context-free.
6. The correct selections are A,C,D. Two independent crossing counters cannot in general be handled by the single last-in-first-out store used for nested matching.

Original paper, page 34 · Answer key

2 marks · MSQ
Report issue

Inserting keys after BST leaves

Binary Search & Balanced Trees

Question 49, GATE 2026: A BST has distinct real keys and n>0 leaves. For each leaf L with an inorder successor, choose one new key k strictly between key(L) and key(successor(L)); collect these in K and insert them. Select: A K has no duplicates; B K is nonempty; C height increases by at most one; D the node count doubles.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, C

Givens and goal

A BST has distinct real keys and n>0 leaves. For each leaf L with an inorder successor, choose one new key k strictly between key(L) and key(successor(L)); collect these in K and insert them. Select: A K has no duplicates; B K is nonempty; C height increases by at most one; D the node count doubles.

Approach

Use the disjoint sorted gaps associated with leaves and identify each insertion point.

Step-by-step solution

1. The inorder successor is the smallest existing key greater than a given key. Hence each chosen key lies in an open gap between consecutive existing sorted keys. Distinct leaves have distinct, disjoint gaps, so two selected values cannot be equal. This proves A.
2. For a leaf L with a successor, the search for a value in this gap follows the same ancestor comparisons as the search for L. Every ancestor bound is respected because no existing key lies between L and its successor. At L, the new value is larger, and L has no right child, so it is inserted as L’s right child.
3. Gaps belonging to different leaves are disjoint branches of this search structure. Inserting one selected key does not place it on another original leaf’s search path. Consequently each new node becomes a child of its own original leaf, irrespective of insertion order.
4. Every new depth is one more than an old leaf’s depth, so the final height is at most the original height plus one. It may increase by zero when deepest leaves have no insertion, proving C rather than an exact-one claim.
5. A singleton tree has one leaf, its maximum, with no successor. Then K is empty, refuting B and D. A right-only chain gives the same type of counterexample. More generally one inserted key per qualifying leaf does not imply one per original node.
6. Therefore A,C are true. Real-valued keys ensure a value can be chosen in every nonempty open gap.

Original paper, page 35 · Answer key

2 marks · MSQ
Report issue

Reconstructing stack and queue assignments

Stacks & Queues

Question 50, GATE 2026: Items 1,2,3,4,5 arrive in order and are each placed in an initially empty stack S or queue Q (capacity 10 each). After all arrivals, empty S then Q to output 4,3,1,2,5. Possible assignments are A S={1,3,4}; B S={3,4}; C S={4,5}; D S={1,2,3}, with every other item in Q. Select all valid assignments.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, B

Step through it (4 options)

Givens and goal

Items 1,2,3,4,5 arrive in order and are each placed in an initially empty stack S or queue Q (capacity 10 each). After all arrivals, empty S then Q to output 4,3,1,2,5. Possible assignments are A S={1,3,4}; B S={3,4}; C S={4,5}; D S={1,2,3}, with every other item in Q. Select all valid assignments.

Approach

The stack part reverses its arrival subsequence; the queue part preserves its arrival subsequence.

Step-by-step solution

1. For A, the stack receives 1,3,4 and pops 4,3,1. The queue receives 2,5 and dequeues 2,5. Concatenating the two outputs gives 4,3,1,2,5, so A works.
2. For B, the stack receives 3,4 and pops 4,3. The queue receives 1,2,5 and outputs 1,2,5. The same target output results, so B also works.
3. For C, the stack pops 5,4 and the queue outputs 1,2,3, producing 5,4,1,2,3. For D, the stack pops 3,2,1 and the queue outputs 4,5, producing 3,2,1,4,5. Both differ from the target.
4. Thus select A,B. The stack prefix must be decreasing and the queue suffix increasing, but the split point is not uniquely determined: here it can be after 4,3 or after 4,3,1. No interleaved dequeue or pop is permitted before all arrivals.

Original paper, page 36 · Answer key

2 marks · MSQ
Report issue

Semaphore constraints on print order

Synchronization & Concurrency

Question 51, GATE 2026: Three processes each execute: wait(A); print(*); X=X+1; if X==2 then {print($); signal(B);}; signal(A); wait(B); print(#); signal(B). Binary semaphores start A=1,B=0 and shared X=0. Each line is atomic. Which outputs are possible? A **$*###; B **$#*##; C **$##*#; D ***$###.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, B, C

Givens and goal

Three processes each execute: wait(A); print(*); X=X+1; if X==2 then {print($); signal(B);}; signal(A); wait(B); print(#); signal(B). Binary semaphores start A=1,B=0 and shared X=0. Each line is atomic. Which outputs are possible? A $*###; B **$#*##; C **$##*#; D *$###.

Approach

Find invariant ordering constraints, then exhibit schedules achieving each candidate.

Step-by-step solution

1. A protects the star and increment section. The first entrant prints a star and changes X from 0 to 1. The second prints another star and changes X to 2, then prints $ before releasing A.
2. The third entrant cannot print its star until that release. Therefore the dollar must occur immediately after the second star among these star/dollar events, and ***$### is impossible. Preempting the second process before $ does not help: it still holds A.
3. B initially blocks all hash printing. It is first signaled only after the dollar; each process that prints a hash then signals B for another. Thus no hash can precede $, while each process’s own star must precede its hash.
4. For A, let the first two processes complete their A sections, then let the third complete its A section before allowing any hash sections. For B, after the first two A sections allow one of those processes to print a hash, then allow the third star, then the remaining hashes.
5. For C, let both first and second processes print their hashes after $, delaying the third A section until afterward. The third then prints its star followed by its hash. These realize all A,B,C exactly.
6. Therefore select A,B,C. The invariant and the explicit schedules together establish both impossibility and feasibility; a single simulated scheduling order would not suffice.

Original paper, page 37 · Answer key

2 marks · MSQ
Report issue

Direct-mapped cache conflicts

Cache Memory

Question 52, GATE 2026: A byte-addressed machine has 16 MB physical memory and an initially empty 4 KB direct-mapped cache with 16-byte blocks. Repeat P,Q,R,S ten times, where P=0x845B32, Q=0x845B26, R=0x845B36, S=0x846B32. Select: A every P misses; B every R hits; C every Q misses; D all S after the first hit. K=2¹⁰,M=2²⁰.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, B

Givens and goal

A byte-addressed machine has 16 MB physical memory and an initially empty 4 KB direct-mapped cache with 16-byte blocks. Repeat P,Q,R,S ten times, where P=0x845B32, Q=0x845B26, R=0x845B36, S=0x846B32. Select: A every P misses; B every R hits; C every Q misses; D all S after the first hit. K=2¹⁰,M=2²⁰.

Approach

Split addresses into tag, line index, and byte offset before tracing the repeating pattern.

Step-by-step solution

1. There are 4096/16=256 cache lines, requiring 8 index bits, and a 16-byte block requires 4 offset bits. In a 24-bit physical address, the remaining 12 bits form the tag.
2. The decompositions (tag,index,offset) are P=(845,B3,2), Q=(845,B2,6), R=(845,B3,6), S=(846,B3,2), all hexadecimal. P and R share one memory block; S has the same index but a different tag; Q has a separate index.
3. In the first cycle, P misses and loads tag 845 into line B3. Q misses and loads its separate line B2. R hits the block loaded by P. S misses and replaces B3 with tag 846.
4. At the start of every later cycle B3 contains S’s tag. P therefore misses and replaces S; R subsequently hits P’s block; S then misses and replaces P again. Q remains resident and hits in all nine later cycles.
5. A and B are true; C and D are false. As a check, misses total 10 for P, 1 for Q, 0 for R, and 10 for S: 21 misses and 19 hits over 40 accesses. Spatial locality explains R’s hits, whereas index conflict explains repeated P/S misses.

Original paper, page 38 · Answer key

2 marks · NAT
Report issue

Storage for free-block number lists

File Systems

Question 53, GATE 2026: A 16 GB disk uses 2 KB blocks. A linked-list bookkeeping scheme stores 32-bit free-block numbers in list blocks, each also reserving one 4-byte next pointer. With K=2¹⁰,G=2³⁰, compute the number of list blocks under the intended capacity-to-record-all-disk-blocks convention; the current free count is not specified.
Tap to enlarge
Answer & solution

Official answer: 16417

Givens and goal

A 16 GB disk uses 2 KB blocks. A linked-list bookkeeping scheme stores 32-bit free-block numbers in list blocks, each also reserving one 4-byte next pointer. With K=2¹⁰,G=2³⁰, compute the number of list blocks under the intended capacity-to-record-all-disk-blocks convention; the current free count is not specified.

Approach

Compute entries per list block and round the required quotient upward.

Step-by-step solution

1. The disk has (16×2³⁰)/(2×2¹⁰)=2²³=8,388,608 blocks. A block number occupies 32/8=4 bytes.
2. Each list block holds 2048 bytes, but 4 are reserved for its successor pointer. The remaining 2044 bytes hold 2044/4=511 block numbers. Counting 512 would forget the link pointer.
3. The capacity calculation is ceil(8,388,608/511). Since 511×16,416=8,388,576, those blocks fall short by 32 entries; one additional block is required. Thus the answer is 16,417.
4. This preserves the official result under the full-disk bookkeeping-capacity convention. If the actual free count is F, the needed entry capacity is ceil(F/511), so an arbitrary partially occupied disk is not determined by the stated disk size alone.
5. If list-storage blocks themselves are excluded from the free-block population on the same disk, a different self-consistent accounting model applies. The official value should therefore not be presented as a universal current free-space measurement. The unspecified free count and accounting convention remain explicit qualifications.

Original paper, page 38 · Answer key

2 marks · NAT
Report issue

Computing TLB storage from reach

Virtual Memory & Paging

Question 54, GATE 2026: A TLB reaches 1 MB with 4 KB pages. Virtual space is 64 GB and physical space 1 GB. Each entry stores a 4-bit process ID, virtual page number, physical frame number, and 2 control bits. Find the TLB size in bytes, with binary K,M,G.
Tap to enlarge
Answer & solution

Official answer: 1536

Step through it (6 steps)

Givens and goal

A TLB reaches 1 MB with 4 KB pages. Virtual space is 64 GB and physical space 1 GB. Each entry stores a 4-bit process ID, virtual page number, physical frame number, and 2 control bits. Find the TLB size in bytes, with binary K,M,G.

Approach

Find entry count and entry width independently, then multiply.

Step-by-step solution

1. TLB reach is number of entries times page size. Therefore the number of entries is 2²⁰/2¹²=2⁸=256.
2. Virtual space 64 GB equals 2³⁶ bytes, requiring a 36-bit address. A 4 KB page has a 12-bit byte offset. The virtual page number therefore has 36−12=24 bits.
3. Physical space 1 GB equals 2³⁰ bytes, requiring a 30-bit address. Removing the same 12-bit offset leaves an 18-bit physical frame number.
4. One entry contains 4+24+18+2=48 bits, or 6 bytes. Total storage is 256×6=1536 bytes.
5. The page offset is not stored as part of a translation entry because it passes through unchanged. This answer includes exactly the specified fields and assumes no unmentioned padding, replacement information, or other implementation metadata.

Original paper, page 39 · Answer key

2 marks · NAT
Report issue

Best-fit allocations and remaining holes

Memory Allocation & Segmentation

Question 55, GATE 2026: Nonadjacent free holes have sizes 20,4,25,18,7,9,15,12 KB. Allocate a 16 KB process and then a 9 KB process by best fit. How many remaining holes are smaller than 8 KB?
Tap to enlarge
Answer & solution

Official answer: 3

Givens and goal

Nonadjacent free holes have sizes 20,4,25,18,7,9,15,12 KB. Allocate a 16 KB process and then a 9 KB process by best fit. How many remaining holes are smaller than 8 KB?

Approach

At each arrival choose the smallest currently adequate hole, then update the list.

Step-by-step solution

1. For the 16 KB request the adequate holes are 18,20,25 KB. Best fit chooses 18 KB, leaving an 18−16=2 KB fragment. The 15 KB and smaller holes cannot accommodate it.
2. Afterward the hole sizes are 20,4,25,2,7,9,15,12 KB. For the 9 KB request, the 9 KB hole is an exact fit and is removed entirely; it does not remain as a zero-size hole.
3. The final positive hole sizes are 20,4,25,2,7,15,12 KB. Those strictly less than 8 KB are 4,2,7 KB, giving three holes.
4. No coalescing is performed because the original holes are nonadjacent and these operations only split or consume them. The answer is 3. Always recompute the available holes after the first allocation rather than assigning both requests independently to the original list.

Original paper, page 39 · Answer key

2 marks · NAT
Report issue

Maximum direct-mapped cache size from an address

Cache Memory

Question 56, GATE 2026: A byte-addressed machine has 1 MB physical memory. Address 0xA2C28 maps to cache block number 176 (decimal), numbered from zero. Find the largest cache size in KB under the conventional power-of-two direct-mapped bit-field organization. K=2¹⁰,M=2²⁰.
Tap to enlarge
Answer & solution

Official answer: 128

Givens and goal

A byte-addressed machine has 1 MB physical memory. Address 0xA2C28 maps to cache block number 176 (decimal), numbered from zero. Find the largest cache size in KB under the conventional power-of-two direct-mapped bit-field organization. K=2¹⁰,M=2²⁰.

Approach

Locate the required binary index within the physical address and maximize its allowed leading zeros.

Step-by-step solution

1. A 1 MB byte-addressed space has 20-bit addresses. The given address is 1010 0010 1100 0010 1000 in binary. Let b be block-offset bits and s be index bits. The cache index is (address >> b) mod 2s and cache capacity is 2b+s bytes.
2. The required index 176 is binary 10110000, so s≥8. In the address, the eight-bit slice equal to 10110000 occurs with its low end at bit 6: shifting right by b=6 gives 0x28B0, whose low eight bits are 0xB0=176. Examining possible offsets 0 through 12 yields no other matching eight-bit slice.
3. For b=6, the low 9,10, and 11 bits of 0x28B0 also equal 176 because the added bits are zero. The low 12 bits are 0x8B0=2224, so s=12 fails; all larger widths retain that unwanted set bit and fail too.
4. The maximum feasible choice is b=6,s=11: block size 2⁶=64 bytes, line count 2¹¹=2048, and capacity 2¹⁷=131072 bytes=128 KB. As a direct check, floor(0xA2C28/64)=10416, and 10416 mod 2048=176.
5. The feasible smaller capacities with the same block size are 16,32,64 KB. This maximization relies on conventional power-of-two cache/block sizes and consecutive index bits. Arbitrary modular mappings or nonstandard capacities are not implied by the source wording; retain that model qualification with official answer 128.

Original paper, page 39 · Answer key

2 marks · NAT
Report issue

Pipeline speedup with stalls and a slower clock

Pipelining & Hazards

Question 57, GATE 2026: A nonpipelined processor averages 5 cycles/instruction at 1.6 GHz. Its pipeline has ideal CPI 1 but runs at 1.2 GHz; 30% of instructions incur an additional 2-cycle stall. Compute long-program speedup to two decimals. The published accepted range is 2.30–2.40.
Tap to enlarge
Answer & solution

Official answer: 2.30 to 2.40

Our answer: 2.34375 (2.34 rounded)

Givens and goal

A nonpipelined processor averages 5 cycles/instruction at 1.6 GHz. Its pipeline has ideal CPI 1 but runs at 1.2 GHz; 30% of instructions incur an additional 2-cycle stall. Compute long-program speedup to two decimals. The published accepted range is 2.30–2.40.

Approach

Compare actual seconds per instruction, not CPI alone.

Step-by-step solution

1. The nonpipelined average instruction time is CPI/frequency=5/(1.6×10⁹) seconds=3.125 ns.
2. Each pipelined instruction contributes one base cycle on average. The expected added stall cost is 0.30×2=0.60 cycles per instruction, so effective CPI is 1.60.
3. The pipelined instruction time is 1.60/(1.2×10⁹) seconds=4/3 ns≈1.33333 ns. Its clock is slower, so a CPI reduction by itself would overstate the improvement.
4. Speedup is old time/new time=3.125/(4/3)=2.34375, which rounds to 2.34. Equivalently use (5/1.6)/(1.6/1.2).
5. The full official accepted interval 2.30–2.40 is preserved, rather than replaced with a single exact scoring value. The calculation assumes long-program throughput, negligible pipeline fill/drain cost, and additive two-cycle stalls as stated; a short program or overlapping penalties would need more details.

Original paper, page 39 · Answer key

2 marks · NAT
Report issue

Slow-start rounds and the initial-window convention

Transport, Congestion Control & Traffic Shaping

Question 58, GATE 2026: A new TCP connection has constant receive window 48 KB, MSS 2 KB, and slow-start threshold 16 KB, with no timeouts or duplicate ACKs. How many transmission rounds are needed to reach congestion avoidance? The initial congestion window and round-count convention are not explicitly stated.
Tap to enlarge
Answer & solution

Official answer: 4

Givens and goal

A new TCP connection has constant receive window 48 KB, MSS 2 KB, and slow-start threshold 16 KB, with no timeouts or duplicate ACKs. How many transmission rounds are needed to reach congestion avoidance? The initial congestion window and round-count convention are not explicitly stated.

Approach

Use the textbook one-MSS start for the published answer and explain the dependency on that assumption.

Step-by-step solution

1. Under the conventional exercise assumption, the initial congestion window is one MSS=2 KB. In idealized slow start, one successful round doubles the window because acknowledgements increase the congestion window for the next round.
2. The sending-window sequence is round 1:2 KB, round 2:4 KB, round 3:8 KB, round 4:16 KB. The threshold 16 KB is first reached in the fourth sending round.
3. The receive window is 48 KB, larger than every window in this sequence, so it never limits the growth before the threshold. Using the threshold-round index gives the official answer 4.
4. However, only three completed doubling rounds separate the initial 2 KB window from 16 KB. Counting completed slow-start rounds instead of labeling the first threshold sending round changes the wording of the answer by one.
5. Moreover the initial congestion window is not specified; starting at 4 KB would give sending windows 4,8,16 and an index of 3. Modern TCP implementation defaults need not be one MSS. Therefore retain 4 as the published scoring answer with these implicit assumptions, rather than asserting an implementation-independent fact.

Original paper, page 40 · Answer key

2 marks · NAT
Report issue

Counting high outputs of a decoder and multiplexer

Combinational Circuits

Question 59, GATE 2026: A,B feed an active-high 2-to-4 decoder with outputs D0…D3. A 4-to-1 multiplexer, selected by S1S0, has input 0=D0, input 1=constant 0, input 2=constant 1, input 3=D3. Of all 16 assignments to A,B,S1,S0, how many give Y=1?
Tap to enlarge
Answer & solution

Official answer: 6

Givens and goal

A,B feed an active-high 2-to-4 decoder with outputs D0…D3. A 4-to-1 multiplexer, selected by S1S0, has input 0=D0, input 1=constant 0, input 2=constant 1, input 3=D3. Of all 16 assignments to A,B,S1,S0, how many give Y=1?

Approach

Partition by the two selector bits and count high outputs in each group.

Step-by-step solution

1. For every decoder input AB exactly one decoder output is high. In particular D0 is high for one of the four AB combinations, and D3 is high for one of the four. They correspond to 00 and 11 in the conventional ordering.
2. When S1S0=00, the multiplexer outputs D0, so exactly one AB assignment gives Y=1. When S1S0=01, it outputs the tied-low input and gives no high outputs.
3. When S1S0=10, it outputs the tied-high input, so all four AB assignments give Y=1. When S1S0=11, it outputs D3, contributing one more assignment.
4. The selector cases are disjoint and cover all 16 inputs. Add their favorable counts: 1+0+4+1=6. There is no need to multiply decoder and multiplexer probabilities or assume random inputs; this is a truth-table count.
5. The unused D1,D2 lines do not replace the constants tied directly to multiplexer inputs 1 and 2.

Original paper, page 40 · Answer key

2 marks · NAT
Report issue

Tracing pointer reassignment in C

Pointers & Memory

Question 60, GATE 2026: Find the printed c for this statement sequence in main: int *ptr,a,b,c; a=5; b=11; c=20; ptr=&a; *ptr=c; ptr=&c; a=*(&b); c=*ptr-a; printf("%d",c);. Assume successful compilation and execution.
Tap to enlarge
Answer & solution

Official answer: 9

Step through it (14 steps)

Givens and goal

Find the printed c for this statement sequence in main: int *ptr,a,b,c; a=5; b=11; c=20; ptr=&a; *ptr=c; ptr=&c; a=*(&b); c=*ptr-a; printf("%d",c);. Assume successful compilation and execution.

Approach

Track both the pointer target and the object values after every assignment.

Step-by-step solution

1. Initially a=5,b=11,c=20. The assignment ptr=&a stores a’s address in ptr; it does not change any integer value.
2. Then *ptr=c writes the current value of c into the object pointed to by ptr, which is a. The state becomes a=20,b=11,c=20, with ptr still pointing to a.
3. Next ptr=&c redirects the pointer to c without copying any old pointed-to value. The expression *(&b) is simply b, so a=*(&b) sets a=11. Now a=11,b=11,c=20 and ptr points to c.
4. In c=*ptr-a, the right-hand side reads the old value c=20 through ptr and subtracts a=11. The assignment therefore stores c=9, and printf prints 9.
5. This assignment is well-defined: the old c is read to calculate its new value. The crucial distinction is between changing ptr itself and assigning through *ptr to the current target.

Original paper, page 40 · Answer key

2 marks · NAT
Report issue

Bounding a recursive return value by residues

Recursion

Question 61, GATE 2026: The function computes length=end+1−start. It returns 0 if length<1 or start<0 or end<0. Otherwise if length%3==0 it returns func(start+1,end); if length%3==1 it returns 1+func(start,end−1); else it returns func(start+2,end). Find the maximum possible returned value for defined, non-overflowing C executions.
Tap to enlarge
Answer & solution

Official answer: 1

Givens and goal

The function computes length=end+1−start. It returns 0 if length<1 or start<0 or end<0. Otherwise if length%3==0 it returns func(start+1,end); if length%3==1 it returns 1+func(start,end−1); else it returns func(start+2,end). Find the maximum possible returned value for defined, non-overflowing C executions.

Approach

Follow how the interval length moves between residue classes modulo three.

Step-by-step solution

1. For valid endpoints let L=end+1−start>0. The first branch changes L to L−1, the second to L−1 while adding 1, and the third to L−2. Every valid recursive step strictly decreases L, so it eventually reaches a base case.
2. If L≡0 mod 3, the next length is L−1≡2. The following step subtracts 2, reaching L−3≡0. This 0→2→0 cycle never enters residue 1 and therefore contributes no increment.
3. If L≡2 mod 3, its first step goes directly to L−2≡0, followed by the same zero-contribution cycle. If L≡1 mod 3, it adds 1 once and moves to L−1≡0, after which no further increments occur.
4. Invalid endpoints return zero immediately. The value 1 is attainable with start=end=0: length=1, so the function returns 1+func(0,−1)=1+0.
5. Therefore the maximum is 1. This analysis assumes representable arithmetic; evaluating end+1 or changing endpoints beyond signed-int limits can cause undefined behavior and is not a valid counterexample returning a larger defined integer.

Original paper, page 41 · Answer key

2 marks · NAT
Report issue

Scaling the determinant of a matrix

Linear Algebra

Question 62, GATE 2026: A is a 4×4 matrix with det(A)=3. Compute det(2A).
Tap to enlarge
Answer & solution

Official answer: 48

Givens and goal

A is a 4×4 matrix with det(A)=3. Compute det(2A).

Approach

Apply determinant multilinearity once for each row.

Step-by-step solution

1. Multiplying a single row by a scalar c multiplies the determinant by c. This is one of the multilinearity properties of the determinant.
2. The matrix 2A multiplies every entry by 2, which is equivalent to multiplying each of its four rows by 2. Factoring a 2 out of each row therefore gives det(2A)=2×2×2×2×det(A).
3. Substitute det(A)=3: det(2A)=2⁴×3=16×3=48.
4. The tempting value 2×3=6 would be appropriate for scaling only one row, not the whole matrix. One can also verify using 2A=(2I₄)A and det(2I₄)=16, followed by determinant multiplicativity.

Original paper, page 41 · Answer key

2 marks · NAT
Report issue

Conditional heads with one shared toss

Probability & Statistics

Question 63, GATE 2026: Six independent fair coin tosses define E1: at least two heads among tosses 2,4,6; E2: exactly two heads among tosses 1,2,3,5. Find P(E1|E2) to one decimal place.
Tap to enlarge
Answer & solution

Official answer: 0.5

Givens and goal

Six independent fair coin tosses define E1: at least two heads among tosses 2,4,6; E2: exactly two heads among tosses 1,2,3,5. Find P(E1|E2) to one decimal place.

Approach

Condition on the shared toss 2, leaving tosses 4 and 6 independent.

Step-by-step solution

1. E2 concerns four positions and permits C(4,2)=6 equally likely arrangements of their two heads. Of these, C(3,1)=3 have toss 2 as a head and C(3,2)=3 have it as a tail. Therefore P(H2|E2)=P(T2|E2)=1/2.
2. Tosses 4 and 6 are not constrained by E2, so conditional on E2 they remain independent fair tosses and independent of the constrained four positions.
3. If toss 2 is a head, E1 requires at least one head among 4 and 6. Its probability is 1−P(T4T6)=1−1/4=3/4. If toss 2 is a tail, E1 requires both remaining tosses to be heads, probability 1/4.
4. By total probability, P(E1|E2)=(1/2)(3/4)+(1/2)(1/4)=1/2=0.5.
5. A direct counting check gives 6×4=24 full six-toss outcomes satisfying E2. Favorable outcomes number 3×3+3×1=12, again 12/24=0.5. The events share toss 2, so conditional reasoning should not be replaced by an unsupported assertion of independence.

Original paper, page 41 · Answer key

2 marks · NAT
Report issue

Counting jumps in a decimal-digit function

Calculus

Question 64, GATE 2026: For r in (0,1), f(r)=1 if the second decimal digit is 2,3,6,or 7, and 0 otherwise. Count discontinuities, using the customary decimal representation not ending in recurring nines.
Tap to enlarge
Answer & solution

Official answer: 40

Givens and goal

For r in (0,1), f(r)=1 if the second decimal digit is 2,3,6,or 7, and 0 otherwise. Count discontinuities, using the customary decimal representation not ending in recurring nines.

Approach

Group neighboring hundredth intervals with the same output and count only actual changes.

Step-by-step solution

1. Fix a tenth interval with index k∈{0,…,9}. Write r=k/10+u with 0≤u<0.1, restricted to the open domain at the endpoints. Within this interval the second digit is j on u∈[j/100,(j+1)/100).
2. The output is 1 on u∈[0.02,0.04) and u∈[0.06,0.08), and 0 on the remaining parts. Adjacent digit bands 2 and 3 merge into one constant segment; bands 6 and 7 likewise merge.
3. The one-sided limits differ at exactly u=0.02,0.04,0.06,0.08. Each tenth interval therefore contributes four jumps at r=k/10+d/100, d∈{2,4,6,8}.
4. At the boundary between successive tenths, the output is 0 immediately to both sides: digit 9 on the left and digit 0 on the right. Hence those boundaries add no discontinuities. The domain excludes 0 and 1.
5. There are 10×4=40 distinct jump points. At every other point a small enough neighborhood stays in a constant-output region, establishing continuity there.
6. Terminating decimals also have recurring-nine representations. Without a convention the digit-based definition is ambiguous at some points. The standard non-recurring-nine convention makes f single-valued; at the jump points the alternative representation can change the assigned value but cannot equalize the unequal one-sided limits.

Original paper, page 41 · Answer key

2 marks · NAT
Report issue

Sequence-number space for a full-rate link

Transport, Congestion Control & Traffic Shaping

Question 65, GATE 2026: Two hosts use a lossless 3000 km link of bandwidth 10⁸ bits/s and propagation delay 5 ns/m. Every data byte gets a sequence number. Find the minimum sequence-field width N so numbers do not wrap before 60 s and full utilization is possible.
Tap to enlarge
Answer & solution

Official answer: 30

Givens and goal

Two hosts use a lossless 3000 km link of bandwidth 10⁸ bits/s and propagation delay 5 ns/m. Every data byte gets a sequence number. Find the minimum sequence-field width N so numbers do not wrap before 60 s and full utilization is possible.

Approach

Compare the long-term no-wrap requirement with the in-flight window requirement.

Step-by-step solution

1. At full rate the byte rate is 10⁸/8=12.5×10⁶ bytes/s. In 60 seconds the sender transmits 60×12.5×10⁶=750,000,000 bytes, requiring at least that many distinct sequence numbers before reuse.
2. An N-bit field has 2N possible values. Since 2²⁹=536,870,912<750,000,000 and 2³⁰=1,073,741,824≥750,000,000, the no-wrap condition requires N≥30.
3. Convert the link length to 3,000,000 m. One-way propagation is 3,000,000×5 ns=15 ms, so propagation round trip is 30 ms when other delays are ignored.
4. The bandwidth-delay product for that round trip is 12.5×10⁶×0.030=375,000 bytes. A window supporting that many outstanding bytes can keep the link busy. Even a selective-repeat-style sequence-space requirement of twice that window is only 750,000 values, far below 2³⁰.
5. Thus the 60-second nonwrapping condition dominates and N=30. This uses the question’s idealized data rate and ignores unspecified header, acknowledgement-transmission, and processing overhead; those details are not needed to overturn the much larger no-wrap bound.

Original paper, page 42 · Answer key