GATE / CS ARCHIVE

PAPER / ORIGINAL ORDER

GATE 2015 · Set 3

65 questions

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

03:00:00
1 mark · MCQ
Report issue

Vocabulary & Verbal Analogies

Question 1, GATE 2015: Complete the sentence: Extreme focus on syllabus and studying for tests has become such a dominant concern of Indian students that they close their minds to anything ____ to the requirements of the exam. Options: (A) related; (B) extraneous; (C) outside; (D) useful.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. The contrast is between exam requirements and everything beyond them. The required construction is “extraneous to”; “related to” and “useful to” are grammatical but contradict that contrast.

2. Extraneous to means unrelated to or outside the scope of. It fits the concern that students ignore material beyond exam requirements. Outside to is unidiomatic; related/useful reverse the intended meaning. Thus B.

Original paper, page 53 · Answer key

1 mark · MCQ
Report issue

Vocabulary & Verbal Analogies

Question 2, GATE 2015: Select the pair with the same relationship as Children : Pediatrician. Options: (A) Adult : Orthopaedist; (B) Females : Gynaecologist; (C) Kidney : Nephrologist; (D) Skin : Dermatologist.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. The relationship sought is patient category to the doctor specializing in that category. An orthopaedist treats the musculoskeletal system rather than adults as a class, so option A does not match either.

2. A pediatrician specializes in a patient group, children. A gynaecologist similarly specializes in female patients. Kidney/nephrologist and skin/dermatologist pair an organ with a specialist, not a patient group. Thus B.

Original paper, page 53 · Answer key

1 mark · MCQ
Report issue

English Grammar & Usage

Question 3, GATE 2015: Choose the four expressions that complete the blanks, in order: The Tamil version of ____ John Abraham-starrer Madras Cafe ____ cleared by the Censor Board with no cuts last week, but the film's distributors ____ no takers among the exhibitors for a release in Tamil Nadu ____ this Friday. Options: (A) Mr., was, found, on; (B) a, was, found, at; (C) the, was, found, on; (D) a, being, find at. The last option is reproduced as the printed sequence, which lacks a separating comma before “at”.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Read each slot in its clause: “the ... film” identifies a particular film; “was cleared” requires a finite passive auxiliary; “distributors found” requires a finite past verb. Among the offered sequences only C fits all slots.

2. The definite article modifies the identified John Abraham-starrer; was cleared is the passive construction; found supplies the past-tense verb; on is the listed preposition for Friday. Thus C.

Original paper, page 53 · Answer key

1 mark · MCQ
Report issue

Data Interpretation & Logical Reasoning

Question 4, GATE 2015: Under a letter-coding rule, ROAD is written as URDG. How is SWAN written under the same rule? Options: (A) VXDQ; (B) VZDQ; (C) VZDP; (D) UXDQ.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. The individual output letters are S→V, W→Z, A→D and N→Q; compare the entire four-letter result, not just its first letter.

2. Every letter advances three places: R→U, O→R, A→D, D→G. Applying the same shift to SWAN gives VZDQ, B.

Original paper, page 54 · Answer key

1 mark · MCQ
Report issue

Algebra, Equations & Number Patterns

Question 5, GATE 2015: A linear function f has f(−2)=29 and f(3)=39. Find f(5). Options: (A) 59; (B) 45; (C) 43; (D) 35.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Equivalently write f(x)=mx+b. The two observations give 5m=10, hence m=2; using f(3)=39 gives b=33. Therefore f(5)=2·5+33.

2. The slope is(39−29)/(3−(−2))=2. Advancing x from 3 to 5 adds 4 to 39, so f(5)=43, C.

Original paper, page 54 · Answer key

2 marks · MCQ
Report issue

Reading Comprehension & Verbal Reasoning

Question 6, GATE 2015: Given: “Alexander turned his attention towards India, since he had conquered Persia.” Which statement is logically valid and can be inferred? (A) Alexander would not have turned his attention towards India had he not conquered Persia. (B) Alexander was not ready to rest on his laurels, and wanted to march to India. (C) Alexander was completely in control of his army and could command it to move towards India. (D) Since Alexander's kingdom extended to Indian borders after the conquest of Persia, he was keen to move further. Preserve the distinction between the intended causal reading and strict logical entailment.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Our answer: A as intended causal inference, not strict entailment

1. The source names the conquest of Persia as a reason for turning toward India; A is the intended counterfactual reading.

2. However an actual cause does not logically establish necessity: Alexander could have turned toward India for another reason even without that conquest. None of the listed claims is strictly entailed without extra causal/background assumptions. Preserve official A with this qualification.

Original paper, page 54 · Answer key

2 marks · MCQ
Report issue

Reading Comprehension & Verbal Reasoning

Question 7, GATE 2015: Experts believe a batsman has all the technical skills needed for the highest level, but lacks the required temperament. He has repeatedly thrown away his wicket after working hard to establish a strong foundation. Critics say top-level success will elude him until he addresses this problem. Which inferences follow? (i) He is already successful at the highest level. (ii) He must improve his temperament to become a great batsman. (iii) He failed to make many good starts count. (iv) Improving his technical skills guarantees success. Options: (A) (iii),(iv); (B) (ii),(iii); (C) (i),(ii),(iii); (D) (ii) only.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. The passage explicitly says temperament blocks higher-level success and that he repeatedly lost his wicket after promising starts.

2. These support II and III. It does not claim existing highest-level success or guarantee success from better technique. Thus B.

Original paper, page 55 · Answer key

2 marks · NAT
Report issue

Data Interpretation & Logical Reasoning

Question 8, GATE 2015: The bar chart gives exports and imports, in crores of rupees, for 2000–2007. Its complete data, as (year: exports, imports), are 2000: 50,40; 2001: 60,50; 2002: 70,60; 2003: 60,70; 2004: 70,80; 2005: 70,90; 2006: 100,120; 2007: 110,120. In which year is the year-on-year percentage increase in the combined exports-plus-imports total highest? Enter the year.
Tap to enlarge
Answer & solution

Official answer: 2006

1. First add exports and imports within each year. Then compare percentage change against the immediately preceding year, using (new total−old total)/old total ×100, not just the absolute increase. For 2006 this is (220−160)/160 ×100=37.5%.

2. Combined export/import totals for 2000..2007 are 90, 110, 130, 130, 150, 160, 220, 230. Year-on-year increases are 22.22%, 18.18%, 0%, 15.38%, 6.67%, 37.5%, 4.55%. The maximum occurs in 2006.

Original paper, page 55 · Answer key

2 marks · MCQ
Report issue

Algebra, Equations & Number Patterns

Question 9, GATE 2015: Identify the equation represented by the thick graph. The graph consists of the nonnegative y-axis, starting at (0,0) and extending upward, together with a ray from (0,0) through (2,−1) into the fourth quadrant. Thin guide lines mark x=2 and y=−1. Options: (A) x=y−|y|; (B) x=−(y−|y|); (C) x=y+|y|; (D) x=−(y+|y|).
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. For nonnegative y, |y|=y, and option B gives x=0. For negative y, |y|=−y, and the same equation gives x=−2y, which is positive and passes through (2,−1). Thus both rays, including their directions, agree with B.

2. For y≥0 the thick line is x=0. For y<0 it passes through(2,−1), so x=−2y. Both pieces are x=−(y−|y|), B.

Original paper, page 56 · Answer key

2 marks · MCQ
Report issue

Data Interpretation & Logical Reasoning

Question 10, GATE 2015: Five of P,Q,R,S,T,U must receive, one each, Home, Power, Defense, Telecom and Finance. U refuses a portfolio if S gets one. R accepts only Home or Finance (or no portfolio). If S gets either Power or Telecom, Q must get the other. T insists on a portfolio if P gets one. Which allocation is valid? Listed in Home, Power, Defense, Telecom, Finance order: (A) P,Q,R,S,T; (B) R,S,P,Q,T; (C) P,Q,T,S,U; (D) Q,U,T,R,P.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. B assigns R Home, S Power, P Defense, Q Telecom, T Finance, and excludes U.

2. It satisfies all constraints. A and D give R a disallowed portfolio; C appoints both S and U. Thus B.

Original paper, page 56 · Answer key

1 mark · MCQ
Report issue

Arrays & Strings

Question 11, GATE 2015: What does this C program print?
#include <stdio.h>
int main() { char s1[7]="1234", *p; p=s1+2; *p='0'; printf("%s",s1); }
The assigned character is digit '0', not the null character '\0'. Options: (A) 12; (B) 120400; (C) 1204; (D) 1034.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (8 steps)

1. Initially the character array begins with 1,2,3,4 followed by a null terminator. Pointer arithmetic advances by characters, so s1+2 selects the third stored character. The assignment changes that position only; printf with %s stops at the unchanged original terminator.

2. p points to s1[2]. Assigning character'0' replaces digit 3, not the terminating null byte. The string becomes 1204 followed by its original terminator, so C.

Original paper, page 57 · Answer key

1 mark · MCQ
Report issue

Sets, Relations & Functions

Question 12, GATE 2015: Let S={1,2,3,4,5,6}, U be its power set, |T| denote cardinality, T′ denote complement relative to S, and T\R denote set difference. Which statement is true? (A) For every X∈U, |X|=|X′|. (B) There exist X,Y∈U with |X|=|Y|=5 and X∩Y=∅. (C) For every X,Y∈U, |X|=2, |Y|=3 and X\Y=∅. (D) For every X,Y∈U, X\Y=Y′\X′.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. For A, take X=∅: its size is 0 while its complement has size 6. For B, inclusion-exclusion gives |X∩Y|≥5+5−6=4, so disjointness is impossible. For C, its universal cardinality claims already fail at X=∅; even restricting to sizes 2 and 3 does not force containment, e.g. X={1,2}, Y={3,4,5}.

2. For any element t, t∈X\Y iff t∈X and t∉Y iff t∈Y′ and t∉X′, hence X\Y=Y′\X′. Thus D. Equal complement sizes need not hold, two 5-subsets of a 6-set cannot be disjoint, and arbitrary 2/3-subsets need not satisfy the proposed containment.

Original paper, page 57 · Answer key

1 mark · MCQ
Report issue

Functional Dependencies & Keys

Question 13, GATE 2015: Relation X(P,Q,R,S,T,U) has functional dependencies F={ {P,R}→{S,T}, {P,S,U}→{Q,R} }. F⁺ is the closure of F. Which listed dependency is trivial? (A) {P,R}→{S,T}; (B) {P,R}→{R,T}; (C) {P,S}→{S}; (D) {P,S,U}→{Q}.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. The closure notation does not make a nontrivial dependency trivial. In A the right side introduces S,T; in B it introduces T; in D it introduces Q. Only C has no right-side attribute outside the left side.

2. A functional dependency X→Y is trivial precisely when Y⊆X. Here{P, S}→{S} meets this condition, C, independently of the other dependencies.

Original paper, page 57 · Answer key

1 mark · MCQ
Report issue

Processes, Threads & System Calls

Question 14, GATE 2015: For a computer system with n CPUs, what is the maximum number of processes that can be in the Ready state? Options: (A) n; (B) n²; (C) 2ⁿ; (D) independent of n.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. At most n processes can execute simultaneously on n single-threaded CPUs, but that bound applies to Running, not Ready. A ready queue may contain many more processes while the CPUs execute others.

2. Ready processes are waiting to be scheduled, not currently executing. Their possible count is not bounded by the CPU count n; it depends on system/process resources. Thus independent of n, D.

Original paper, page 58 · Answer key

1 mark · MCQ
Report issue

Parsing & Syntax Analysis

Question 15, GATE 2015: Among simple LR (SLR), canonical LR and look-ahead LR (LALR), identify, in order, the easiest method to implement and the most powerful method. Options: (A) SLR, LALR; (B) canonical LR, LALR; (C) SLR, canonical LR; (D) LALR, canonical LR.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. SLR uses one FOLLOW set for all reductions of a nonterminal, whereas canonical LR keeps the lookahead specific to each item/context. LALR merges compatible LR states for smaller tables but may introduce conflicts that canonical LR avoids.

2. SLR uses LR(0) states plus FOLLOW sets and is the simplest of the three. Canonical LR(1) retains item-specific lookaheads and recognizes the broadest grammar class. Thus SLR, canonical LR, C.

Original paper, page 58 · Answer key

1 mark · MCQ
Report issue

Boolean Algebra & Logic Gates

Question 16, GATE 2015: For Boolean variables define X#Y=X′+Y′, where prime means NOT and + means OR. Consider S1: (P#Q)#R=P#(Q#R); S2: Q#R=R#Q. Which holds for all Boolean P,Q,R? (A) only S1; (B) only S2; (C) both; (D) neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. By De Morgan, X′+Y′=NOT(XY). For the counterexample, 0#1=1 and 1#1=0, so the left grouping is 1#1=0 while the right grouping is 0#0=1.

2. X#Y=¬X+¬Y is NAND and is commutative. It is not associative: P=0, Q=1, R=1 gives(P#Q)#R=0 while P#(Q#R)=1. Thus only S2, B.

Original paper, page 58 · Answer key

1 mark · NAT
Not in GATE 2027 syllabusReport issue

Software Engineering

Question 17, GATE 2015: Calculate the function point metric for a software project with external inputs I=30, external outputs O=60, external inquiries E=23, files F=8, and external interfaces N=2. Their respective complexity weights are 4,5,4,10,7. Of fourteen value-adjustment factors, four are not applicable (value 0), four have value 3, and the remaining six have value 4. Use the standard adjusted function-point formula.
Tap to enlarge
Answer & solution

Official answer: 612 to 613

Our answer: 612.06

1. The method first multiplies each information-domain count by its complexity weight and sums to obtain unadjusted function points. It then multiplies that total by 0.65+0.01 times the sum of the fourteen adjustment ratings. Four plus four factors account for eight ratings, leaving six ratings of value 4.

2. Unadjusted points=30·4+60·5+23·4+8·10+2·7=606. Adjustment sum=4·0+4·3+6·4=36. The factor is 0.65+0.01·36=1.01, giving 606·1.01=612.06, within the official 612 to 613 range.

Original paper, page 59 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Web Technologies

Question 18, GATE 2015: A server stores ten pages at http://www.yourname.com/var.html, with var=1,...,10. Page W1 (var=1) is saved locally for editing/testing, while the other pages stay on the server. W1 contains relative links of the form “var.html”. Which addition makes all relative links resolve to the server pages? Printed options (including their malformed attribute punctuation): (A) <a href: “http://www.yourname.com/”, href: “...var.html”>; (B) <base href: “http://www.yourname.com/”>; (C) <a href: “http://www.yourname.com/”>; (D) <base href: “http://www.yourname.com/”, range: “...var.html”>. Distinguish the intended element from valid HTML syntax.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Our answer: B conceptually, after fixing HTML attribute syntax

1. A base element sets the base URL used to resolve relative links, so the intended B is <base href="http://www.yourname.com/">.

2. Anchor elements only make individual links. The printed options use href: rather than href=; literal B therefore is not the required valid HTML attribute assignment. Retain the official conceptual answer with the syntax correction explicit.

Original paper, page 59 · Answer key

1 mark · MCQ
Report issue

Transport, Congestion Control & Traffic Shaping

Question 19, GATE 2015: Consider: I. TCP connections are full duplex. II. TCP has no option for selective acknowledgment. III. TCP connections are message streams. Which are correct? (A) I only; (B) I and III; (C) II and III; (D) all three.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Full duplex means each endpoint can send while also receiving on the same connection. The TCP selective-acknowledgment option reports received data blocks beyond a gap, so statement II is false. Applications see an ordered byte stream: one send need not correspond to one receive, so statement III is false.

2. TCP is full-duplex, has a selective-acknowledgment option, and exposes a byte stream rather than preserving application-message boundaries. Therefore only I is correct, A.

Original paper, page 59 · Answer key

1 mark · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 20, GATE 2015: Let X=Σ(i³), i=0,...,n. Which asymptotic descriptions of X are valid? I: Θ(n⁴); II: Θ(n⁵); III: O(n⁵); IV: Ω(n³). Options: (A) only I; (B) only II; (C) I or III or IV, but not II; (D) II or III or IV, but not I.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. The exact polynomial is n⁴/4+n³/2+n²/4. Its leading term supplies a two-sided Θ(n⁴) bound; a looser upper bound n⁵ and looser lower bound n³ remain valid, whereas a two-sided n⁵ bound does not.

2. Sum(i³, i=0..n)=[n(n+1)/2]²=Θ(n⁴). It is consequently O(n⁵) and Ω(n³), but not Θ(n⁵). Thus I, III, IV, C; equality to an asymptotic class is conventional membership notation.

Original paper, page 60 · Answer key

1 mark · NAT
Report issue

Tree Properties & Traversals

Question 21, GATE 2015: A binary tree T has 200 leaf nodes. How many nodes in T have exactly two children? Nodes with exactly one child are allowed.
Tap to enlarge
Answer & solution

Official answer: 199

1. Let n0,n1,n2 count nodes with zero, one and two children. Every non-root node contributes one incoming edge, so E=n0+n1+n2−1. Counting edges from parents instead gives E=n1+2n2; subtracting cancels n1 and yields the result without assuming a full binary tree.

2. Counting tree edges gives n1+2n2=n0+n1+n2−1. Hence the number with two children is n2=n0−1=200−1=199.

Original paper, page 60 · Answer key

1 mark · NAT
Report issue

Hashing

Question 22, GATE 2015: A hash table T has 25 slots and stores 2000 elements. Find its load factor α.
Tap to enlarge
Answer & solution

Official answer: 80

1. Load factor measures the average number of elements per table slot, rather than the fraction of slots that are nonempty. With separate chaining, several elements may share a slot, so a load factor greater than one is meaningful.

2. Load factor is number of stored elements divided by number of slots: 2000/25=80. This is possible with chaining rather than a one-element-per-slot open-addressed table.

Original paper, page 60 · Answer key

1 mark · MCQ
Report issue

Linear Algebra

Question 23, GATE 2015: The matrix A has rows (1,−1,2), (0,1,0), (1,2,1). One eigenvalue is 1. Which set gives all eigenvectors for that eigenvalue? Each option uses nonzero real α: (A) {α(4,2,1)}; (B) {α(−4,2,1)}; (C) {α(√2,0,1)}; (D) {α(−√2,0,1)}.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Explicitly, A−I has rows (0,−1,2), (0,0,0), (1,2,0). Its middle equation imposes no extra constraint. Taking the free coordinate z=t gives v=t(−4,2,1); exclude t=0 because an eigenvector must be nonzero.

2. Solving(A−I)v=0 gives−y+2z=0 and x+2y=0. Therefore y=2z, x=−4z, so the nonzero eigenvectors are scalar multiples of(−4, 2, 1), B.

Original paper, page 61 · Answer key

1 mark · MCQ
Report issue

Calculus

Question 24, GATE 2015: Evaluate lim as x→∞ of (1+x²) raised to the power e^(−x). Options: (A) 0; (B) 1/2; (C) 1; (D) ∞.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. This is a ∞⁰ form, so neither the base nor the exponent alone determines the answer. Exponential growth dominates logarithmic growth: ln(1+x²)/ex tends to 0. Continuity of exp then gives exp(0)=1.

2. Take logarithms: ln[(1+x²)^(e−x)]=ln(1+x²)/ex→0. Exponentiating gives limit 1, C.

Original paper, page 61 · Answer key

1 mark · NAT
Report issue

Combinatorics & Counting

Question 25, GATE 2015: How many four-digit numbers can be made using only digits {1,2,3}, with digits in nondecreasing order from left to right? Repetition is permitted.
Tap to enlarge
Answer & solution

Official answer: 15

1. For example, counts (2,1,1) give exactly 1123, not its other permutations, because sorting is required. Distributing four identical positions among three digit counts is the weak-composition count (4+3−1 choose 3−1).

2. A nondecreasing four-digit sequence is determined by counts c1, c2, c3≥0 summing to 4. Stars and bars gives C(6, 2)=15, with one sorted sequence for every count triple.

Original paper, page 61 · Answer key

1 mark · MCQ
Report issue

Propositional & Predicate Logic

Question 26, GATE 2015: A room contains only Type 1 people, who always tell the truth, and Type 2 people, who always lie. You give a fair coin to someone of unknown type, ask them to toss it and hide the result, then ask the result. They reply: “The result of the toss is head if and only if I am telling the truth.” Which option is correct? (A) The result is head. (B) The result is tail. (C) If the person is Type 2, the result is tail. (D) If the person is Type 1, the result is tail.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Let T indicate that the speaker tells the truth and H that the coin is heads.

2. The assertion is H↔T, whose truth value must equal T. If T is true, H must be true; if T is false, H↔false must be false, again requiring H true. Thus the coin is heads, A.

Original paper, page 61 · Answer key

1 mark · MCQ
Report issue

Binary Search & Balanced Trees

Question 27, GATE 2015: Insert 71,65,84,69,67,83, in that order, into an initially empty binary search tree. Which element is at the lowest (deepest) level? (A) 65; (B) 67; (C) 69; (D) 83.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (8 steps)

1. Insertion gives root71, left65, right84; 69 is 65’s right child, 67 is 69’s left child, 83 is 84’s left child.

2. The deepest node is 67 at depth 3, B.

Original paper, page 62 · Answer key

1 mark · MCQ
Report issue

Stacks & Queues

Question 28, GATE 2015: Evaluate the postfix expression whose tokens are: 10 5 + 60 6 / * 8 −. Options: (A) 284; (B) 213; (C) 142; (D) 71.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (10 steps)

1. A stack evaluator pops the right operand first and left operand second. After + the stack contains 15; after / it contains 15,10; after * it contains 150; the final subtraction is 150−8, not 8−150.

2. Postfix evaluation gives 10+5=15, 60/6=10, then 15·10=150, and 150−8=142. Thus C.

Original paper, page 62 · Answer key

1 mark · MCQ
Report issue

SQL & Queries

Question 29, GATE 2015: For Cinema(theater,address,capacity), append a condition to SELECT P1.address FROM Cinema P1 so that it returns addresses of theaters having maximum capacity. Options: (A) WHERE P1.capacity >= ALL (SELECT P2.capacity FROM Cinema P2); (B) WHERE P1.capacity >= ANY (SELECT P2.capacity FROM Cinema P2); (C) WHERE P1.capacity > ALL (SELECT MAX(P2.capacity) FROM Cinema P2); (D) WHERE P1.capacity > ANY (SELECT MAX(P2.capacity) FROM Cinema P2). Explain the ordinary nonnull-capacity assumption.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Our answer: A for nonnull capacities

1. P1.capacity≥ALL capacities selects exactly maximal capacities, including ties, A.

2. ANY admits smaller nonmaximal values, and strictly greater than MAX admits none. This assumes capacities are nonnull: a NULL in the subquery can make ALL unknown even for a maximum; a NULL-safe implementation filters null capacities or compares to MAX.

Original paper, page 62 · Answer key

1 mark · MCQ
Report issue

Heaps & Priority Queues

Question 30, GATE 2015: An array in level-order heap representation is (89,19,50,17,12,15,2,5,7,11,6,9,100). What is the minimum number of interchanges needed to convert it into a max-heap? An interchange swaps two elements. Options: (A) 4; (B) 5; (C) 2; (D) 3.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. With 1-based indices, swaps (13,6), (6,3), (3,1) yield (100,19,89,17,12,50,2,5,7,11,6,9,15). Check each parent against its children: every parent is at least as large. This gives a concrete three-swap witness, not merely the count performed by an unspecified heapify routine.

2. Three swaps along the ancestor chain move 100 through indices 13→6→3→1, producing a valid max-heap. Fewer cannot suffice: 100 must reach the root. If swapped directly with 89, the resulting 89 at 13 exceeds both ancestors 15 at 6 and 50 at 3; one additional swap cannot repair both (swapping with 3 leaves 50 below 15; swapping with 6 leaves 89 below 50). If100 reaches the root in two swaps, at least one of the remaining displaced chain values is still out of heap order. Thus the minimum is 3, D.

Original paper, page 63 · Answer key

1 mark · MCQ
Report issue

Synchronization & Concurrency

Question 31, GATE 2015: Processes X and Y use shared Boolean flags varP and varQ, both initially false. Their synchronization pseudocode is:
X: while(true) { varP=true; while(varQ==true) { /* critical section X */ varP=false; } }
Y: while(true) { varQ=true; while(varP==true) { /* critical section Y */ varQ=false; } }
The critical sections are inside the inner while bodies, not after empty waiting loops. Which claim holds under the usual atomic-flag model? (A) prevents deadlock but fails mutual exclusion; (B) guarantees mutual exclusion but fails to prevent deadlock; (C) guarantees both; (D) guarantees neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Our answer: A under atomic shared-flag model

1. If both flags become true before either loop test, both processes can enter their critical sections, so mutual exclusion fails.

2. The inner loops are not waiting loops: their bodies execute the critical section when the other flag is true. Under fair execution and terminating critical sections, a false test returns to the outer loop and reasserts the flag; there is no state where both wait permanently for an action the other cannot perform. Thus A. Literal unsynchronized C threads would instead require a memory-model analysis; the source is treated as synchronization pseudocode.

Original paper, page 63 · Answer key

1 mark · MCQ
Report issue

Finite Automata

Question 32, GATE 2015: Let Σ={0,1} and L be the language of the regular expression Σ*0011Σ*. What is the minimum number of states in a DFA recognizing the complement of L? Options: (A) 4; (B) 5; (C) 6; (D) 8.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Writing states as matched-prefix lengths 0..4, transitions on (0,1) are 0→(1,0), 1→(2,0), 2→(2,3), 3→(1,4), 4→(4,4). For pattern containment only state 4 accepts; for its complement states 0..3 accept. For any i<j, the suffix completing prefix length j reaches state 4 from j but not from i, proving distinguishability.

2. A DFA tracks the longest suffix matching a prefix of 0011: lengths 0, 1, 2, 3, 4, with 4 an absorbing found-pattern state. These five states are pairwise distinguishable by completing the pattern; flipping accepting states recognizes avoidance of 0011 without changing minimal state count. Thus5, B.

Original paper, page 64 · Answer key

1 mark · NAT
Not in GATE 2027 syllabusReport issue

Software Engineering

Question 33, GATE 2015: A program is deliberately seeded with 100 artificial faults. Testing detects 159 faults in total, including 75 seeded faults. Assuming real and seeded faults have the same nature and distribution, estimate the number of undetected real faults.
Tap to enlarge
Answer & solution

Official answer: 28

1. The fraction 75/100 estimates the detection probability, not the fraction of detected faults that are artificial. First separate the 159 detected faults into 75 artificial and 84 real, then use the common detection-rate assumption only on the real population.

2. The detected seeded fraction is 75/100=0.75. Detected real faults number 159−75=84. Under equal detectability, estimated total real faults=84/0.75=112, leaving 112−84=28 undetected.

Original paper, page 64 · Answer key

1 mark · MCQ
Report issue

Cache Memory

Question 34, GATE 2015: A byte-addressable main memory has size 2²⁰ bytes. Blocks contain 16 bytes, and a direct-mapped cache has 2¹² lines. Two consecutive memory-byte addresses are hexadecimal E201F and E2020. For address E201F, identify the tag and cache-line address, in hexadecimal. (A) E,201; (B) F,201; (C) E,E20; (D) 2,01F.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (7 steps)

1. A hexadecimal digit represents four bits, so the 4+12+4 split aligns exactly with E | 201 | F. The next address E2020 illustrates the offset wrapping from F to 0 and the cache-line index advancing from 201 to 202.

2. The20-bit address has 4 offset bits for 16-byte blocks and 12 index bits for 212 lines, leaving 4 tag bits. Hex E201F therefore splits tagE, index 201, offsetF. Thus A.

Original paper, page 65 · Answer key

1 mark · MCQ
Report issue

Medium Access & Ethernet

Question 35, GATE 2015: A CSMA/CD network transmits at 100 Mbps (10⁸ bits/s) over a 1 km cable without repeaters. Its required minimum frame size is 1250 bytes. Find signal speed in km/s, using the collision-detection minimum-frame condition. Options: (A) 8000; (B) 10000; (C) 16000; (D) 20000.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. A transmitting station must still be transmitting when a worst-case collision indication returns from the far end of the cable. Therefore frame serialization time must cover two one-way propagation delays. Convert bytes to bits before comparing the frame size with the bit rate.

2. Minimum frame serialization time is 1250·8/108=10−4s, which must equal the cable’s round-trip propagation time at the minimum. One-way delay=5·10−5s, so speed 1km/(5·10−5s)=20000km/s, D.

Original paper, page 65 · Answer key

2 marks · NAT
Not in GATE 2027 syllabusReport issue

Numerical Methods

Question 36, GATE 2015: A motorbike starts from rest. Its measured velocities v in km/min at times t in minutes are t=(2,4,6,8,10,12,14,16,18,20), v=(10,18,25,29,32,20,11,5,2,0). Thus the initial point is (t,v)=(0,0). Approximate distance traveled in the first 20 minutes using composite Simpson's 1/3 rule and round to two decimal places.
Tap to enlarge
Answer & solution

Official answer: 308 to 310

Our answer: 309.33

1. Starting from rest supplies v(0)=0.

2. With ten equal subintervals of width h=2, composite Simpson’s rule uses endpoint weights 1, odd-index weights 4, and even-index weights 2. The odd-index velocity sum is 10+25+32+11+2=80; the even-index sum is 18+29+20+5=72. Hence distance ≈ (2/3)[0+0+4·80+2·72]=(2/3)·464=309.333333 km, rounded to 309.33 km. This is inside the official 308–310 interval. The baseline derived_answer 308.67 was an arithmetic error. The arithmetic correction to 309.33 was independently checked against the source table; the official scoring range is unchanged.

Original paper, page 65 · Answer key

2 marks · MCQ
Report issue

Searching, Sorting & Selection

Question 37, GATE 2015: A mergesort implementation takes 30 seconds in the worst case for an input of size 64. Using its standard asymptotic running-time model, which option most closely approximates the maximum input size solvable in 6 minutes? (A) 256; (B) 512; (C) 1024; (D) 2048.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Using the standard dominant-term model T(n)=c n log₂n, the time increases by 360/30=12.

2. Hence n log₂n≈12·64·6=4608. For n=512, 512·9=4608, so B. Lower-order implementation overhead is ignored in this approximation.

Original paper, page 65 · Answer key

2 marks · MCQ
Report issue

Recursion

Question 38, GATE 2015: Consider this recursive C function:
void get(int n) { if(n<1) return; get(n-1); get(n-3); printf("%d",n); }
If main invokes get(6), how many total invocations of get occur before control returns to main, including the initial invocation and calls that immediately return? Options: (A) 15; (B) 25; (C) 35; (D) 45.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (24 steps)

1. For n≤0 the invocation still counts once even though it immediately returns. Starting with C(−2)=C(−1)=C(0)=1, repeatedly apply the recurrence upward; omitting the base-case calls would count printed values rather than invocations.

2. Count every invocation including base cases and the initial call. C(n)=1 for n<1 and C(n)=1+C(n−1)+C(n−3) otherwise. Thus C1=3, C2=5, C3=7, C4=11, C5=17, C6=25. Answer B.

Original paper, page 66 · Answer key

2 marks · NAT
Report issue

Indexing, Storage & Query Processing

Question 39, GATE 2015: A B+ tree has search keys of 12 bytes, blocks of 1024 bytes, record pointers of 10 bytes, and block pointers of 8 bytes. What is the maximum number of keys that fit in each non-leaf node? Use the usual internal-node layout with one more child pointer than keys and no additional stated overhead.
Tap to enlarge
Answer & solution

Official answer: 50

1. For k=50 the node uses 50·12+51·8=1008 bytes, which fits. For k=51 it needs 51·12+52·8=1028 bytes, exceeding the block. These adjacent checks establish the maximum, not just a rounded estimate.

2. An internal node with k keys has k+1 child pointers, so 12k+8(k+1)≤1024. Thus20k≤1016 and k≤50. Record pointers belong in leaves and are not counted here.

Original paper, page 66 · Answer key

2 marks · MCQ
Report issue

Logic Minimization & Karnaugh Maps

Question 40, GATE 2015: For Boolean F=P′+QR, with variable order P,Q,R (P most significant) and P′=NOT P, assess S1: F=Σ(4,5,6); S2: F=Σ(0,1,2,3,7); S3: F=Π(4,5,6); S4: F=Π(0,1,2,3,7). Here Σ denotes sum of minterms and Π product of maxterms. Options list truth values S1,S2,S3,S4: (A) F,T,T,F; (B) T,F,F,T; (C) F,F,T,T; (D) T,T,F,F.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (13 steps)

1. F=¬P+QR is 1 for all P=0 cases 0..3 and for 111 (7).

2. It is 0 exactly on 4, 5, 6. Therefore sum of minterms 0, 1, 2, 3, 7 and product of maxterms4, 5, 6 are correct: S2, S3, option A.

Original paper, page 66 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Complexity & Reductions

Question 41, GATE 2015: Suppose L1 is polynomial-time reducible to L2, L3 is polynomial-time reducible to L2, and L2 is polynomial-time reducible to L4. Which statements follow? I: If L4∈P, then L2∈P. II: If L1∈P or L3∈P, then L2∈P. III: L1∈P iff L3∈P. IV: If L4∈P, then L1∈P and L3∈P. Options: (A) II only; (B) III only; (C) I and IV only; (D) I only.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. The reductions are L1≤pL2, L3≤pL2, L2≤pL4.

2. If L4∈P, compose reductions with its decider to place L2, L1, L3 in P. Thus I and IV. Easy source languages do not imply an easy target; L1 and L3 need not share complexity. For example choose one empty and the other a non-P language reducing to the common target. Hence C.

Original paper, page 67 · Answer key

2 marks · NAT
Report issue

Scope, Lifetime & Storage Classes

Question 42, GATE 2015: Determine the output of this C program, using the standard function-call sequencing model:
#include <stdio.h>
int f1(void); int f2(void); int f3(void);
int x=10;
int main() { int x=1; x += f1()+f2()+f3()+f2(); printf("%d",x); return 0; }
int f1() { int x=25; x++; return x; }
int f2() { static int x=50; x++; return x; }
int f3() { x *= 10; return x; }
Tap to enlarge
Answer & solution

Official answer: 230

1. There are three distinct variables named x: global x, main’s automatic x, and f2’s persistent static x; f1 additionally creates its own automatic x on entry. Name lookup selects the nearest declaration, so f3 alone modifies the global. The two f2 returns may exchange evaluation order, but their sum stays 103.

2. Main’s local x starts 1. f1 returns 26 from its own automatic x; the two f2 calls return 51 and 52 from one static x in either order; f3 multiplies global 10 by 10 and returns 100. Sum1+26+51+52+100=230. Function executions are indeterminately sequenced, so unspecified operand order does not change the sum or cause overlapping unsequenced increments.

Original paper, page 67 · Answer key

2 marks · NAT
Report issue

Pointers & Memory

Question 43, GATE 2015: What is the intended printed output of this C program? Also distinguish that output from its portability limitation.
#include <stdio.h>
int main() { static int a[]={10,20,30,40,50}; static int *p[]={a,a+3,a+4,a+1,a+2}; int **ptr=p; ptr++; printf("%d%d",ptr-p,**ptr); }
There is no separator between the two decimal conversions.
Tap to enlarge
Answer & solution

Official answer: 140

Our answer: 140 under compatible printf type convention

1. After ptr++, ptr=p+1, so ptr−p=1 and **ptr=*(a+3)=40.

2. The adjacent decimal conversions produce 140. Pointer subtraction has type ptrdiff_t, which need not be int; %d is portable only when its promoted type is int. Otherwise the format mismatch is undefined behavior. Use %td for ptr−p, or cast this known-small difference to int, to guarantee the intended display.

Original paper, page 68 · Answer key

2 marks · MCQ
Report issue

Context-Free Grammars & Languages

Question 44, GATE 2015: Which languages are context-free? L1={a^m b^n a^n b^m | m,n≥1}; L2={a^m b^n a^m b^n | m,n≥1}; L3={a^m b^n | m=2n+1}. Exponents denote nonnegative integer counts unless constrained otherwise. Options: (A) L1 and L2 only; (B) L1 and L3 only; (C) L2 and L3 only; (D) L3 only.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. L1=am bn an bm has nested dependencies: S→aSb|aTb and T→bTa|ba generates m, n≥1, so it is CFL.

2. L3 is generated by U→aaUb|a for n≥0. L2=am bn am bn is not CFL: for pumping length p, choose ap bp ap bp. The pumping window of length≤p touches at most two adjacent blocks, so pumping changes at least one block but cannot change its corresponding nonadjacent equal block; if a pumped piece crosses a boundary, pumping can also destroy the four-block form. Thus pumping fails. L1, L3 only, B.

Original paper, page 68 · Answer key

2 marks · MCQ
Report issue

Deadlocks

Question 45, GATE 2015: For mutually exclusive resources, which policies can prevent deadlock? I: A process acquires all resources at the start; if any is unavailable, it releases those acquired so far. II: Resources have unique numbers and requests occur only in increasing number order. III: Resources have unique numbers and requests occur only in decreasing number order. IV: Resources have unique numbers and a process may request only a resource numbered higher than all resources it currently holds. Options: (A) any one of I and III, but not II or IV; (B) any one of I,III,IV, but not II; (C) any one of II and III, but not I or IV; (D) any one of I,II,III,IV.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. I removes hold-and-wait by releasing partial acquisitions if all cannot be obtained.

2. II and III each impose a strict global resource order, excluding circular wait. IV likewise permits only requests larger than every held resource, so any wait cycle would require strictly increasing numbers around a loop, impossible. Each policy individually prevents deadlock, D; this does not promise starvation freedom.

Original paper, page 69 · Answer key

2 marks · NAT
Report issue

IP Addressing, Fragmentation & Address Resolution

Question 46, GATE 2015: For the IPv4 network containing address 200.10.11.144/27, give the fourth octet in decimal of its last assignable host address. The printed address is not necessarily the canonical network base.
Tap to enlarge
Answer & solution

Official answer: 158

Step through it (4 steps)

1. A/27 mask gives blocks of 32.

2. Address144 lies in 128..159, so network address 128 and broadcast 159 leave last usable host 158. The displayed 144/27 is a host/prefix designation, not the canonical subnet-base address.

Original paper, page 69 · Answer key

2 marks · NAT
Report issue

Data Link, Framing, Error Control & ARQ

Question 47, GATE 2015: Two systems are separated by 8000 km. The link rate is 500×10⁶ bits/s, propagation speed is 4×10⁶ m/s, and average packet size is 10⁷ bits. Design a Go-Back-N sliding-window protocol that fully utilizes the link, neglecting processing delays and using the standard negligible-ACK-transmission model. What minimum number of sequence-number bits is required?
Tap to enlarge
Answer & solution

Official answer: 8

Step through it (6 steps)

1. Full utilization requires enough outstanding packets to bridge a packet’s serialization plus the round-trip propagation before its ACK permits reuse. A 201-packet window meets this bound; the Go-Back-N sequence space must contain at least 202 distinct sequence numbers to avoid old/new ambiguity.

2. One-way propagation=8·106/(4·106)=2s. Packet serialization=107/(500·106)=0.02s. To stay busy with negligible ACK time, window≥1+2·2/0.02=201 packets. Go-Back-N requires W≤2k−1; 27−1=127 is insufficient and 28−1=255 suffices. Thus8 bits.

Original paper, page 69 · Answer key

2 marks · NAT
Report issue

Pipelining & Hazards

Question 48, GATE 2015: A three-stage pipeline has a five-column reservation table. Stage S1 is used at time slots 1 and 5, S2 at slots 2 and 4, and S3 only at slot 3; all other cells are blank. Determine the minimum average initiation latency (MAL). Initiation times may vary, but no two active operations may use the same stage simultaneously.
Tap to enlarge
Answer & solution

Official answer: 3

1. The forbidden separations come from differences between occupied columns in the same row, not from differences across different stages. Thus the initial forbidden-latency set is exactly {2,4}. To attain average 3, start operations at times 0,3,6,9,...; every pairwise separation is a positive multiple of 3 and therefore safe.

2. Repeated use in S1 forbids initiation separation 4; S2 forbids 2. Therefore allowed positive gaps include 1, 3, 5. Constant gap 3 is collision-free because no multiple of 3 is 2 or 4, achieving average 3. If any gap is 1, its next gap cannot 1 or 3 (the two-gap total would be 2 or 4) and must be at least 5. Pair each such 1 with its following≥5 gap; every pair averages≥3, while unpaired gaps are≥3. Thus no lower long-run average is possible.

Original paper, page 70 · Answer key

2 marks · MCQ
Report issue

Pipelining & Hazards

Question 49, GATE 2015: Instructions have form OP Ri,Rj,Rk, which reads Rj,Rk and writes Ri. The sequence is I1: ADD R1,R2,R3; I2: MUL R7,R1,R3; I3: SUB R4,R1,R5; I4: ADD R3,R2,R4; I5: MUL R7,R8,R9. Consider S1: I2 and I5 have an anti-dependence; S2: I2 and I4 have an anti-dependence; S3: in a pipeline, an anti-dependence always causes at least one stall. Options: (A) S1 only; (B) S2 only; (C) S1 and S3 only; (D) S2 and S3 only.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. I2 reads R3 and I4 later writes R3, a write-after-read anti-dependence, so S2 holds.

2. I2 and I5 both write R7, an output dependence rather than anti-dependence. In-order reads/writes or register renaming can avoid stalls for anti-dependences, so S3 is false. Thus only S2, B.

Original paper, page 70 · Answer key

2 marks · MCQ
Report issue

Arrays & Strings

Question 50, GATE 2015: Y is a one-dimensional array of size n and X a C two-dimensional n×n array, with 2≤n≤10. Each segment starts with Y[i]=0 and X[i][j]=i+j. All X elements lie in the same main-memory page frame. Segment 1: for(i=0;i<n;i++) Y[i]+=X[0][i]; Segment 2: for(i=0;i<n;i++) Y[i]+=X[i][0]; Assess S1: final Y contents are identical; S2: X elements accessed in segment 1 are contiguous in memory; S3: X elements accessed in segment 2 are contiguous. Options: (A) S2 only; (B) S3 only; (C) S1 and S2 only; (D) S1 and S3 only.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Both loops add i to initially zero Y[i], because X[0][i]=0+i and X[i][0]=i+0.

2. In C row-major storage, X[0][i] traverses consecutive elements, whereas X[i][0] advances by n elements for n≥2. Being in one page does not make those column elements adjacent. Thus S1, S2, C.

Original paper, page 71 · Answer key

2 marks · MCQ
Report issue

Recovery & Logging

Question 51, GATE 2015: A partial schedule lists these operations in time order: 1 T1:read(A); 2 T1:write(A); 3 T2:read(C); 4 T2:write(C); 5 T2:read(B); 6 T2:write(B); 7 T2:read(A); 8 T2:commit; 9 T1:read(B). T1 fails immediately after time 9. Which statement is correct? (A) Abort T2, then restart both T1 and T2 to ensure atomicity. (B) The schedule is non-recoverable and cannot ensure transaction atomicity. (C) Abort and restart only T2 to ensure atomicity. (D) The schedule is recoverable and ensures atomicity without doing anything else.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (12 steps)

1. T2 reads A at time 7 after T1 writes it at time 2, before T1 commits.

2. T2 then commits at 8. When T1 fails after 9, its uncommitted value has already influenced a committed transaction. This violates recoverability: a reader must not commit before the transaction whose value it read. T2 cannot simply be treated as an uncommitted transaction to roll back. Thus B.

Original paper, page 73 · Answer key

2 marks · MCQ
Report issue

Linear Algebra

Question 52, GATE 2015: For real coefficients p,q,r, the homogeneous system px+qy+rz=0; qx+ry+pz=0; rx+py+qz=0 has a nontrivial solution. Which condition must hold? (A) p−q+r=0 or p=q=−r; (B) p+q−r=0 or p=−q=r; (C) p+q+r=0 or p=q=r; (D) p−q+r=0 or p=−q=−r. The real-coefficient convention is needed for the sum-of-squares characterization.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. A nontrivial homogeneous solution requires determinant zero.

2. The determinant is minus(p³+q³+r³−3pqr), which factors as −(p+q+r)((p−q)²+(q−r)²+(r−p)²)/2. Over real coefficients this vanishes exactly when p+q+r=0 or p=q=r, C. The real-domain convention matters for the sum-of-squares implication.

Original paper, page 73 · Answer key

2 marks · NAT
Report issue

Control Flow & Loop Tracing

Question 53, GATE 2015: How many times is printf executed in this C program?
#include <stdio.h>
int main() {
 int i,j,k=0;
 j=2*3/4+2.0/5+8/5;
 k-=--j;
 for(i=0;i<5;i++) {
  switch(i+k) {
   case 1:
   case 2: printf("\n%d",i+k);
   case 3: printf("\n%d",i+k);
   default: printf("\n%d",i+k);
  }
 }
 return 0;
}
There are no break statements.
Tap to enlarge
Answer & solution

Official answer: 10

1. Integer division gives 2*3/4=1 and 8/5=1; adding 2.0/5 produces 2.4, converted to int j=2.

2. Then k-=--j sets j=1 and k=−1. For i=0, 1, 2, 3, 4 the switch values are−1, 0, 1, 2, 3. With no breaks, the numbers of printf executions are 1, 1, 3, 3, 2, totaling 10. Case1 falls into case2 without printing itself.

Original paper, page 74 · Answer key

2 marks · MCQ
Report issue

Calculus

Question 54, GATE 2015: For every nonzero real x, a function f satisfies a f(x)+b f(1/x)=1/x−25, where a≠b. Find ∫ from 1 to 2 of f(x) dx. Options: (A) [a(ln2−25)+47b/2]/(a²−b²); (B) [a(2ln2−25)−47b/2]/(a²−b²); (C) [a(2ln2−25)+47b/2]/(a²−b²); (D) [a(ln2−25)−47b/2]/(a²−b²). Explain why the denominator is nonzero for an existing such function.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Replace x by 1/x to obtain a f(1/x)+b f(x)=x−25.

2. Eliminate f(1/x): f(x)=[a/x−bx−25a+25b]/(a²−b²). Integrating from 1 to 2 yields[a(ln2−25)+(47/2)b]/(a²−b²), A. The source states a≠b. Existence of f at x=1 also forces a+b≠0, since (a+b)f(1)=−24. Together these ensure a²−b² is nonzero.

Original paper, page 74 · Answer key

2 marks · NAT
Report issue

Graph Algorithms

Question 55, GATE 2015: A connected undirected graph G has 100 vertices and 300 edges. The weight of a minimum spanning tree is 500. If the weight of every edge in G is increased by 5, what is the new minimum spanning-tree weight?
Tap to enlarge
Answer & solution

Official answer: 995

1. The 300 graph edges do not all belong to the spanning tree. Connectedness makes every spanning tree have exactly |V|−1=99 edges, so the increment is 99·5 rather than 300·5. Because all candidate trees receive the same increment, a previously minimum tree remains minimum.

2. Every spanning tree on 100 vertices has 99 edges. Adding5 to every edge increases every spanning-tree weight by exactly 495, preserving their ordering and the set of minimum spanning trees. The new minimum weight is 500+495=995.

Original paper, page 75 · Answer key

2 marks · NAT
Report issue

Physical Layer & Transmission

Question 56, GATE 2015: Two hosts are connected through one packet switch by two links, each of rate 10⁷ bits/s and propagation delay 20 microseconds. The switch starts forwarding a packet 35 microseconds after receiving that packet. A total of 10000 bits is transmitted as two 5000-bit packets. Under the standard store-and-forward, back-to-back transmission model, how many microseconds elapse between transmission of the first data bit at the source and reception of the last data bit at the destination?
Tap to enlarge
Answer & solution

Official answer: 1575

1. Each5000-bit packet takes 500microseconds to serialize at 107 bits/s.

2. Packet1 fully reaches the switch at 520, begins forwarding at 555, and finishes arriving at the destination at 1075. Packet2 reaches the switch at 1020 and becomes ready at 1055, exactly when the first packet finishes using the outgoing link. It transmits 1055–1555 and its last bit arrives at 1575. This assumes store-and-forward receipt of a complete packet, independent links and processing that can overlap forwarding, as in the standard switch model.

Original paper, page 75 · Answer key

2 marks · MCQ
Report issue

CPU Scheduling

Question 57, GATE 2015: Processes have (arrival time, processing time): A=(0,3), B=(1,6), C=(4,4), D=(6,2). Which scheduling scheme yields the lowest average turnaround time? Options: (A) first come first serve; (B) non-preemptive shortest job first; (C) shortest remaining time; (D) round robin with quantum 2. Turnaround time is completion minus arrival.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (4 schedules)

1. Shortest remaining time runs A0–3, B3–4, C4–8, D8–10 and B10–15 (the C/D tie at 6 can be resolved either way without changing total turnaround).

2. Completion-minus-arrival times are 3, 14, 4, 4, mean 6.25. FCFS gives 3, 8, 9, 9, mean 7.25; nonpreemptive SJF gives 3, 8, 11, 5, mean 6.75. Round-robin quantum 2 gives a larger mean (8.25 under arrivals-before-requeue at equal times). Hence C.

Original paper, page 75 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Software Engineering

Question 58, GATE 2015: Find McCabe cyclomatic complexities of X,Y,Z in that order. Program X:
sumcal(int maxint,int value) {
 int result=0,i=0;
 if(value<0) { value=-value; }
 while((i<value) AND (result<=maxint)) { i=i+1; result=result+1; }
 if(result<=maxint) { printf(result); } else { printf("large"); }
 printf("end of program");
}
The shown control-flow graph Y has eight vertically ordered nodes v1,...,v8, edges vi→v(i+1) for i=1,...,7, and back edges v3→v1, v6→v4, v8→v1. Graph Z is serial composition of the graph of X followed by the graph of Y. Options: (A) 4,4,7; (B) 3,4,7; (C) 4,4,8; (D) 4,3,8. State the convention for counting the compound while condition.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Treat each compound source-level condition as one decision: X has its first if, the while, and the final if, so complexity 4.

2. The shown Y graph has 8 vertices and 10 edges, giving E−N+2=4. Serial composition adds complexities minus 1, so Z=4+4−1=7. Thus A. Expanding the short-circuit AND into separate predicate nodes would increase X to 5 and Z to 8; the official answer uses source-statement predicate counting rather than that expanded control-flow model.

Original paper, page 76 · Answer key

2 marks · NAT
Report issue

Number Systems & Computer Arithmetic

Question 59, GATE 2015: In positional notation, (43) base x equals (y3) base 8, where x is a valid integer base and y is a valid octal digit. How many (x,y) solutions are possible?
Tap to enlarge
Answer & solution

Official answer: 5

Step through it (9 steps)

1. The complete pairs are (x,y)=(6,3),(8,4),(10,5),(12,6),(14,7). The apparent pair (4,2) is invalid because digit 4 cannot occur in base 4; larger y cannot occur in base 8.

2. The equality gives 4x+3=8y+3, hence x=2y. The base must exceed its largest digit 4, so x≥5, and the octal digit y lies between 0 and 7. Thus y=3, 4, 5, 6, 7 and x=6, 8, 10, 12, 14, giving five solutions.

Original paper, page 76 · Answer key

2 marks · MCQ
Report issue

Sets, Relations & Functions

Question 60, GATE 2015: R is a relation on ordered pairs of positive integers, with ((p,q),(r,s))∈R iff p−s=q−r. Which description is correct? (A) reflexive and symmetric; (B) reflexive but not symmetric; (C) not reflexive but symmetric; (D) neither reflexive nor symmetric.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. The condition p−s=q−r is equivalent to p+r=q+s, unchanged by swapping the two ordered pairs; the relation is symmetric.

2. Reflexivity at(p, q) would require 2p=2q, which fails for example at(1, 2). Thus it is not reflexive but is symmetric, C.

Original paper, page 77 · Answer key

2 marks · NAT
Report issue

Probability & Random Variables

Question 61, GATE 2015: X1,X2,X3 are independent, identically distributed bits with P(Xi=0)=P(Xi=1)=1/2. Let Y=(X1X2) XOR X3, where juxtaposition denotes ordinary multiplication of bits. Find P(Y=0 | X3=0).
Tap to enlarge
Answer & solution

Official answer: 0.75

1. The four conditional equally likely (X1,X2) pairs are 00,01,10,11. With X3=0, XOR changes nothing, so the first three give Y=0 and only 11 gives Y=1.

2. Conditioning on X3=0 makes Y=X1X2. Independence leaves X1 and X2 independent fair bits. Their product is 1 only when both are 1, with probability 1/4. Therefore Pr(Y=0|X3=0)=3/4=0.75.

Original paper, page 77 · Answer key

2 marks · NAT
Report issue

Logic Minimization & Karnaugh Maps

Question 62, GATE 2015: For Boolean f(w,x,y,z)=Σ(0,2,4,5,6,10), with minterm indexing in variable order w,x,y,z, find the total number of prime implicants. There are no don't-care minterms.
Tap to enlarge
Answer & solution

Official answer: 3

Step through it (11 steps)

1. The four-cell group {0,2,4,6} fixes w=0,z=0; pair {4,5} fixes w=0,x=1,y=0; pair {2,10} fixes x=0,y=1,z=0. All singleton minterms and remaining valid pairs expand into one of these maximal groups. Count prime implicants, not just a selected minimum cover.

2. The maximal all-one cubes are 0--0 covering 0, 2, 4, 6; 010- covering 4, 5; and-010 covering 2, 10. They correspond to w′z′, w′xy′ and x′yz′. No cube can expand without including a zero minterm, and every other valid cube is contained in one of these three. Thus there are 3 prime implicants.

Original paper, page 77 · Answer key

2 marks · NAT
Report issue

Correctness, Invariants & Design

Question 63, GATE 2015: DOSOMETHING(c,a,n) receives a bit array c[0..k−1] and positive integers a,n. It sets z=1; then for i=0,...,k−1 sets z=z² mod n, and, if c[i]=1, sets z=(z×a) mod n; finally it returns z. For k=4, c=(1,0,1,1), a=2, n=8, what is returned?
Tap to enlarge
Answer & solution

Official answer: 0

1. Iteration details: bit 1 gives 1²·2 mod 8=2; bit 0 gives 2² mod 8=4; bit 1 gives (4² mod 8)·2 mod 8=0; the last bit 1 keeps the value 0. Each iteration squares before the optional multiplication.

2. The loop processes the binary exponent 1011 from most significant bit to least. The successive z values modulo 8 are 2, 4, 0, 0: square and multiply by 2 when the current bit is 1. Equivalently it computes 211 mod8=0.

Original paper, page 78 · Answer key

2 marks · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 64, GATE 2015: Let f(n)=n and g(n)=n^(1+sin n), for positive integers n, with sine measured in radians. Which asymptotic statements hold? I: f(n)=O(g(n)); II: f(n)=Ω(g(n)). Options: (A) I only; (B) II only; (C) both; (D) neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. The ratio g(n)/f(n)=nsin n.

2. Since1/(2π) is irrational, integer n modulo 2π is dense, and every tail is dense. There are therefore arbitrarily large n with sin n≥1/2 and arbitrarily large n with sin n≤−1/2. Along the former subsequence g/f≥sqrt(n) is unbounded, ruling out f=Ω(g); along the latter f/g≥sqrt(n) is unbounded, ruling out f=O(g). Thus neither statement holds, D, with sine in radians.

Original paper, page 78 · Answer key

2 marks · MCQ
Report issue

Parsing & Syntax Analysis

Question 65, GATE 2015: Grammar G has productions S→F|H, F→p|c, H→d|c. S,F,H are nonterminals; p,d,c are terminals. Assess S1: LL(1) can parse all strings generated using grammar G; S2: LR(1) can parse all strings generated using grammar G. Options: (A) S1 only; (B) S2 only; (C) both; (D) neither. The question concerns this grammar, not whether its language has a different LL(1) or LR(1) grammar.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Step through it (3 parts)

1. The string c has two parse trees: S→F→c and S→H→c.

2. Thus the displayed grammar is ambiguous and is neither LL(1) nor LR(1). Concretely FIRST(F) and FIRST(H) both contain c, causing an LL conflict; after shifting c, completed F→c and H→c items both reduce on end-of-input, causing an LR reduce/reduce conflict. Therefore D for parsing with this grammar. Its finite language can of course be represented by a different unambiguous grammar S→p|d|c.

Original paper, page 79 · Answer key