GATE / CS ARCHIVE

PAPER / ORIGINAL ORDER

GATE 2015 · Set 1

65 questions

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

03:00:00
1 mark · MCQ
Report issue

English Grammar & Usage

Question 1, GATE 2015: Complete: “Didn't you buy ____ when you went shopping?” A any paper; B much paper; C no paper; D a few paper.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Paper is used as a mass noun here, so it does not take “a few” without a countable unit such as sheets. “Any” is the usual neutral determiner in a negative question. “No” would create an unintended double negative. The official preference for A is idiomatic rather than proof that every other grammatical reading is impossible.

Solution: Any paper is the idiomatic choice for asking about an unspecified quantity in a negative question. This yields A. Much paper is also grammatical if the intended question concerns a large quantity, so the isolated sentence does not uniquely exclude B without the intended context.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Vocabulary & Verbal Analogies

Question 2, GATE 2015: Choose the closest meaning of “She enjoyed herself immensely at the party.” A She had a terrible time; B a horrible time; C a terrific time; D a terrifying time, at the party.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

“Immensely” intensifies the positive verb “enjoyed”: she enjoyed the party very much. “Terrific” means excellent in this context, whereas terrible and horrible are negative evaluations and terrifying means frightening. Similar-looking words need not have similar meanings.

Solution: Enjoying it immensely describes a terrific experience, C. The other choices do not express this positive evaluation.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Vocabulary & Verbal Analogies

Question 3, GATE 2015: Which pairing is incorrect? A Acquiescence—Submission; B Wheedle—Roundabout; C Flippancy—Lightness; D Profligate—Extravagant.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Acquiescence is accepting or submitting without protest. Flippancy is inappropriate lightness or lack of seriousness. Profligate describes wastefully extravagant conduct. Wheedle is a verb meaning to coax using flattery; roundabout describes an indirect route or manner, so it is not its synonym.

Solution: Wheedle means coax or persuade by flattery, not roundabout. Thus B is the incorrectly matched pair.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Data Interpretation & Logical Reasoning

Question 4, GATE 2015: Two floors are 9 feet apart. How many steps connect them? I Each step is 3/4 foot high. II Each step is 1 foot wide. A I alone sufficient, II not; B II alone sufficient, I not; C both together sufficient, neither alone; D together insufficient.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Data sufficiency asks whether the number is uniquely determined, not whether every measurement is useful. Equal risers of 3/4 foot divide the vertical separation into 9×4/3=12 rises. Width supplies horizontal information only, and no staircase horizontal length is given. Adding II cannot improve the already sufficient I.

Solution: The vertical rise alone determines the number of steps: 9/(3/4)=12. Tread width does not determine the number without a horizontal run. Therefore statement I alone suffices, A.

Original paper, page 3 · Answer key

1 mark · MCQ
Report issue

Counting, Probability & Sets

Question 5, GATE 2015: Select one number uniformly from each of A={2,3,4,5}, B={11,12,13,14,15}. Find the probability that their sum is 16. A 0.20; B 0.25; C 0.30; D 0.33.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Form the sample space as A×B, not as unordered pairs from a nine-element union: the two selections have different roles. Each first choice has exactly one valid partner, namely 16 minus that choice. Therefore four favorable outcomes among twenty give 1/5. The unused B value 15 pairs with no member of A.

Solution: There are 4×5=20 equally likely ordered choices. Sum16 occurs for(2, 14),(3, 13),(4, 12),(5, 11), giving 4/20=0.2, A.

Original paper, page 3 · Answer key

2 marks · MCQ
Report issue

Vocabulary & Verbal Analogies

Question 6, GATE 2015: Choose the meaning of “took to their heels” in “The chain snatchers took to their heels when the police party arrived.” A took shelter in a thick jungle; B open indiscriminate fire; C took to flight; D unconditionally surrendered.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

This is an idiom: it describes running away quickly, rather than literal attention to one's feet. The arrival of police provides the reason for escape. Neither a specific hiding place nor firing weapons nor surrender follows from the sentence. “Took to flight” is the equivalent idiom.

Solution: Took to his heels means fled or took flight, C.

Original paper, page 3 · Answer key

2 marks · MCQ
Report issue

Reading Comprehension & Verbal Reasoning

Question 7, GATE 2015: Lake levels supplying a city have dropped significantly. Evaluate actions: I partially cut supply; II appeal through mass media for residents to minimize water use; III ban supply in lower areas. A I and II; B I and III; C II and III; D all three.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

A suitable course of action should address the stated shortage and be proportionate to the evidence. Partial rationing and conservation reduce total demand. The premise gives no special reason to deprive residents of lower areas of all supply. Thus III is unsupported even though it would mechanically reduce consumption.

Solution: Partial restriction and a conservation appeal address the reduced water supply. A blanket prohibition in low-lying areas is not justified by the information. Thus the intended courses are I and II, A.

Original paper, page 4 · Answer key

2 marks · NAT
Report issue

Data Interpretation & Logical Reasoning

Question 8, GATE 2015: An engineering college's 2012 department shares are Computer Science 40%, Civil 30%, Mechanical 10%, Electrical 20%. Every department has male:female ratio 5:4. Electrical has 40 males. Find Civil female count minus Mechanical female count.
Tap to enlarge
Answer & solution

Official answer: 32

Use the electrical department to recover the scale: five ratio units equal 40, so one unit is 8, electrical females are 32, and its total is 72. Since 72 is 20% of all students, the college total is 360. Civil has 108 students and 48 females; Mechanical has 36 students and 16 females. Their difference is 32, independently checking the proportional shortcut.

Solution: Electrical accounts for 20% and has 40 men. At male: female=5: 4 it has 32 women. Civil minus mechanical share is 30%−10%=20%, exactly the electrical share. With the same gender ratio, the female difference is therefore 32.

Original paper, page 4 · Answer key

2 marks · MCQ
Report issue

Counting, Probability & Sets

Question 9, GATE 2015: Passing probabilities for Mathematics, Physics, Chemistry are m,p,c. Probability of passing at least one is 0.75, at least two 0.50, exactly two 0.40. Claims: I p+m+c=27/20; II p+m+c=13/20; III pmc=1/10. A I only; B II only; C II and III; D I and III.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Our answer: A; official D disagrees

Let K count passed subjects. Its probabilities for K=0,1,2,3 are respectively 0.25,0.25,0.40,0.10. Linearity of expectation requires no independence: E[K]=m+p+c=1.35. A product of marginal probabilities cannot generally replace an intersection. Indeed, nonnegative numbers summing to 1.35 have product at most (1.35/3)3=0.091125, strictly below 0.10. The product claim is therefore impossible, not merely unproved. Preserve the published D for scoring while teaching A as the mathematical conclusion.

Solution: Exactly three passes has probability 0.5−0.4=0.1, and exactly one has probability 0.75−0.5=0.25. The expected number of passes is m+p+c=0.25+2(0.4)+3(0.1)=1.35=27/20, so I is true and II false. III does not follow: mpc is not the intersection probability without independence. In fact AM–GM gives mpc≤(1.35/3)3=0.091125<0.1, so III is false under these premises. The mathematically correct choice is A (I only), whereas the visible official answer is D (I and III).

Original paper, page 5 · Answer key

2 marks · MCQ
Report issue

Data Interpretation & Logical Reasoning

Question 10, GATE 2015: A class examination has no negative or partial marking. Rows (question,marks,correct,wrong,unattempted) are (1,2,21,17,6),(2,3,15,27,2),(3,1,11,29,4),(4,2,23,18,3),(5,5,31,12,1). Find average total marks per student. A 2.290; B 2.970; C 6.795; D 8.795.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Each row accounts for the same 44 students. Sum marks awarded across questions first: 42+45+11+46+155=299. Dividing this class total by 44 gives 6.79545. Dividing by five would instead average totals per question, and counting wrong answers as negative would contradict the stated marking scheme.

Solution: The weighted total is 21·2+15·3+11·1+23·2+31·5=299. There are 44 students, so the mean is 299/44≈6.79545, matching C.

Original paper, page 5 · Answer key

1 mark · MCQ
Report issue

Other / Mixed Topics

Question 11, GATE 2015: g(x)=1−x and h(x)=x/(x−1). Simplify g(h(x))/h(g(x)). A h(x)/g(x); B −1/x; C g(x)/h(x); D x/(1−x)^2.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Substitute before simplifying: g(h(x))=1−x/(x−1)=−1/(x−1), whereas h(g(x))=(1−x)/((1−x)−1)=(x−1)/x. Division gives −x/(x−1)2. Option D has the same squared denominator but the wrong sign. The original composition needs x≠1 and x≠0; simplification must not silently restore excluded inputs.

Solution: For x≠0, 1, g(h(x))=−1/(x−1) and h(g(x))=(x−1)/x. Their ratio is−x/(x−1)2=h(x)/g(x), A. The exclusions are needed for the displayed compositions and ratio.

Original paper, page 6 · Answer key

1 mark · MCQ
Report issue

Calculus

Question 12, GATE 2015: Evaluate lim as x→∞ of x^(1/x). A ∞; B 0; C 1; D not defined.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

A variable base with a vanishing exponent is an indeterminate form, so simply calling the exponent zero is not a valid derivation. Take natural logs: ln(x1/x)=ln(x)/x. By l'Hôpital's rule this tends to (1/x)/1=0. Continuity of exp then gives exp(0)=1.

Solution: Write x1/x=exp((ln x)/x). The exponent tends to 0 as x tends to infinity, so the limit is 1, C.

Original paper, page 6 · Answer key

1 mark · MCQ
Report issue

Other / Mixed Topics

Question 13, GATE 2015: Match algorithms P Prim MST, Q Floyd–Warshall all-pairs shortest paths, R mergesort, S Hamiltonian circuit search with i backtracking, ii greedy, iii dynamic programming, iv divide-and-conquer. A P-iii Q-ii R-iv S-i; B P-i Q-ii R-iv S-iii; C P-ii Q-iii R-iv S-i; D P-ii Q-i R-iii S-iv.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Prim greedily adds a cheapest edge crossing the current tree's cut. Floyd–Warshall builds shortest paths by increasing the allowed intermediate vertices, a dynamic-programming recurrence. Mergesort solves two smaller sorting problems and merges their answers. A standard Hamiltonian-circuit search tries vertices and abandons partial paths that cannot extend, illustrating backtracking.

Solution: Prim uses greedy selection; Floyd–Warshall uses dynamic programming; mergesort uses divide and conquer; the standard Hamiltonian-circuit search uses backtracking. Thus P-ii, Q-iii, R-iv, S-i, C.

Original paper, page 7 · Answer key

1 mark · MCQ
Report issue

Searching, Sorting & Selection

Question 14, GATE 2015: For n≥2, choose the worst-case quicksort recurrence; c is constant. A T(n)=2T(n/2)+cn; B T(n)=T(n−1)+T(1)+cn; C T(n)=2T(n−1)+cn; D T(n)=T(n/2)+cn.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Worst-case pivots repeatedly leave one side with nearly every remaining element. Treat the constant-size side's cost as O(1), yielding T(n)=T(n−1)+Θ(n). Unrolling accumulates n+(n−1)+…+2=Θ(n²). A represents balanced splitting, C duplicates the large subproblem, and D omits one half of a balanced sort. Printed B uses T(1) for constant work.

Solution: The most unbalanced quicksort split leaves one nontrivial subproblem of size n−1 and constant base-case work, plus cn partition work. Hence the listed recurrence T(n)=T(n−1)+T(1)+cn, B, gives Θ(n²).

Original paper, page 7 · Answer key

1 mark · MCQ
Report issue

Tree Properties & Traversals

Question 15, GATE 2015: Height means the length in edges of the longest root-to-leaf path. Find maximum and minimum node counts of a binary tree of height 5. A 63 and 6; B 64 and 5; C 32 and 6; D 31 and 5.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Levels run from depth 0 through 5. At most 2d nodes fit at depth d, so the maximum is the geometric sum 26−1=63. The minimum still requires one path containing five edges, hence six vertices. The number 32 counts only the possible last-level nodes, not the entire tree.

Solution: Height5 counts edges. The complete tree has 1+2+4+8+16+32=63 nodes; a single path needs 6. Thus maximum 63 and minimum 6, A.

Original paper, page 7 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Software Engineering

Question 16, GATE 2015: Match P condition coverage, Q equivalence class partitioning, R volume testing, S alpha testing with i black-box, ii system, iii white-box, iv performance testing. A P-ii Q-iii R-i S-iv; B P-iii Q-iv R-ii S-i; C P-iii Q-i R-iv S-ii; D P-iii Q-i R-ii S-iv.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Condition coverage examines internal Boolean decisions, so it requires code structure. Equivalence partitioning selects representative inputs from behaviorally similar classes without inspecting code. Volume testing studies behavior under large data volumes. Alpha testing evaluates the integrated system in the developer's controlled environment. These distinctions give the paper's intended classification C.

Solution: Condition coverage is white-box, equivalence partitioning is black-box, volume testing concerns performance, and alpha testing is system testing. Hence P-iii, Q-i, R-iv, S-ii, C.

Original paper, page 8 · Answer key

1 mark · MCQ
Report issue

Binary Search & Balanced Trees

Question 17, GATE 2015: Which sequences can be inorder traversals of BSTs? I 3,5,7,8,15,19,25; II 5,8,9,12,10,15,25; III 2,7,10,8,14,16,20; IV 4,6,7,9,18,20,25. A I and IV; B II and III; C II and IV; D II only.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

For distinct keys, recursively visiting left subtree, root, then right subtree produces strictly increasing order. I and IV meet this necessary condition and can be realized, for example, by inserting their keys in ascending order into right chains. II descends from 12 to 10, and III from 10 to 8, violating the property.

Solution: Inorder traversal of a BST with distinct keys must be increasing. I and IV are increasing. II places 12 before 10, and III places 10 before 8. Therefore I and IV, A.

Original paper, page 8 · Answer key

1 mark · MCQ
Report issue

Parsing & Syntax Analysis

Question 18, GATE 2015: At any valid shift-reduce parsing state, which is true? A viable prefixes appear only at the stack bottom, not inside; B only at its top, not inside; C the stack contains only a set of viable prefixes; D it never contains viable prefixes.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

A handle is the portion reduced in a reverse rightmost derivation. A viable prefix stops at or before the right end of such a handle. The parser stack's grammar symbols form one viable prefix, and each initial segment of those symbols is also viable. Read the paper's “set” wording in this prefix sense, not as a claim that arbitrary internal substrings or LR state numbers are grammar prefixes.

Solution: The grammar-symbol portion of a shift-reduce stack is a viable prefix: a prefix of a right-sentential form that does not pass the handle’s right end. Taking a shorter prefix cannot cross that end, so every prefix is viable too. Thus C.

Original paper, page 8 · Answer key

1 mark · MCQ
Report issue

Propositional & Predicate Logic

Question 19, GATE 2015: Which is NOT equivalent to p↔q? A (¬p∨q)∧(p∨¬q); B (¬p∨q)∧(q→p); C (¬p∧q)∨(p∧¬q); D (¬p∧¬q)∨(p∧q).
Tap to enlarge
Your answer
Answer & solution

Official answer: C

A biconditional is true when both truth values agree, namely 00 and 11. A and B express both implications, and D explicitly lists these two agreeing cases. C instead lists 01 and 10. A single test p=q=true makes the biconditional true but C false, already proving nonequivalence.

Solution: The expression (¬p∧q)∨(p∧¬q) is exclusive OR, true precisely when p and q differ. It is the negation of biconditional rather than an equivalent, so C.

Original paper, page 8 · Answer key

1 mark · MCQ
Report issue

Sets, Relations & Functions

Question 20, GATE 2015: A={5,{6},{7}} and P(A)=2^A. Evaluate I ∅∈P(A); II ∅⊆P(A); III {5,{6}}∈P(A); IV {5,{6}}⊆P(A). A I and III; B II and III; C I,II,III; D I,II,IV.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Membership in P(A) means being a subset of A. Thus I holds because the empty set is a subset of A, and III holds because both 5 and {6} are elements of A. II uses the independent fact that the empty set is a subset of every set. IV would require each of its elements, including the number 5, to be an element of P(A); this is false in the intended elementary set model. Do not interchange ∈ and ⊆.

Solution: The empty set is a subset of every set and belongs to every power set. The set{5,{6}} is a subset of A, so belongs to P(A). But it is not a subset of P(A), since its element 5 is not a subset of A. Therefore I, II, III, C.

Original paper, page 9 · Answer key

1 mark · MCQ
Report issue

Counters & Timing

Question 21, GATE 2015: A 4-bit Johnson counter starts at 0000. Choose its decimal sequence. A 0,1,3,7,15,14,12,8,0; B 0,1,3,5,7,9,11,13,15,0; C 0,2,4,6,8,10,12,14,0; D 0,8,12,14,15,7,3,1,0.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Our answer: D for one shift orientation; A for the reverse

A Johnson counter feeds the complement of one end bit into the other end of a shift register. With the right-shift/MSB-insertion convention, bits fill with ones and then zeros, producing eight states before returning. Reversing the bit-weight convention reflects each four-bit word and converts D into A. Therefore the official D is consistent but not uniquely forced by the direction-free wording; B and C are not this eight-state twisted-ring cycle.

Solution: Complemented end-bit feedback with right shifts gives 0000→1000→1100→1110→1111→0111→0011→0001→0000, the official D. With left shifts and the opposite end-bit feedback, the equally valid Johnson counter gives 0, 1, 3, 7, 15, 14, 12, 8, 0, option A. The question does not specify shift direction or bit-weight orientation; D is conventional, not uniquely implied.

Original paper, page 9 · Answer key

1 mark · MCQ
Report issue

Instructions & Addressing Modes

Question 22, GATE 2015: In a three-address instruction format, what may an address field specify? S1 memory operand; S2 processor register; S3 implied accumulator register. A either S1 or S2; B either S2 or S3; C only S2 and S3; D all S1,S2,S3.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

An instruction such as ADD destination,source1,source2 names its explicit operands. Depending on the instruction-set architecture, these fields can select memory locations or registers. An implied accumulator needs no address field because its identity is determined by the opcode or architecture. The issue is explicit versus implicit designation, not whether an accumulator physically exists.

Solution: Three-address instruction operands can refer to registers or memory as defined by the architecture. An accumulator is implicit in an accumulator architecture, not required as one of these explicit operand addresses. Thus A.

Original paper, page 9 · Answer key

1 mark · MCQ
Report issue

Transport, Congestion Control & Traffic Shaping

Question 23, GATE 2015: Two hosts transfer a large file over TCP. Which claims are false? I a segment numbered m is always followed by m+1; II estimated RTT t implies retransmission timeout≥t; III advertised window size never changes; IV unacknowledged bytes are always≤advertised window. A III only; B I and III; C I and IV; D II and IV.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Our answer: B under nonshrinking-window textbook model

A segment carrying L data bytes advances the data sequence number by L, not by one, so a 1000-byte segment beginning at m normally leads to m+1000. The receive window tracks available receiver buffer space and can change as data arrives and is consumed. The textbook RTO adds a delay-variation allowance to the smoothed RTT. The intended flow-control invariant yields B, but the absolute “always” in IV must retain the inherited window-shrink qualification: a new smaller advertisement does not retract bytes already in flight.

Solution: Sequence numbers count bytes, so I is false. RTO includes estimated RTT plus a nonnegative variability margin, making II true in the usual model. The receiver-advertised window varies, so III is false. With a nonshrinking receive-window right edge, outstanding data respects the advertised window, giving IV true and false statements I and III, official B. The word always in IV needs qualification: a receiver can shrink its window after data was sent, leaving more outstanding bytes than its new advertisement. TCP discourages shrinking but implementations must tolerate it. Therefore B assumes the simplified flow-control model.

Original paper, page 10 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Network Security

Question 24, GATE 2015: N people want pairwise secret communication using symmetric encryption, confidential even from other group members. How many keys are needed in the whole system? A 2N; B N(N−1); C N(N−1)/2; D (N−1)^2.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

A symmetric key can serve both directions of one pair's communication. Count unordered pairs: choose the first member in N ways and the second in N−1 ways, then divide by two because each pair was counted twice. One group-wide key would violate secrecy from other members, while N(N−1) unnecessarily counts two directional keys per pair.

Solution: Every unordered pair needs its own secret key so that third members cannot decode its traffic. There are C(N, 2)=N(N−1)/2 pairs, C.

Original paper, page 10 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Web Technologies

Question 25, GATE 2015: Which claims are false? I XML supports structured content beyond HTML's limitations; II XML is case-insensitive while HTML is case-sensitive; III XML supports user-defined tags while HTML uses predefined tags; IV XML tags need not be closed but HTML tags must be. A II only; B I only; C II and IV; D III and IV.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

XML distinguishes names differing in letter case: an opening <Item> cannot be closed by </item>. Every XML element must be properly closed, either by a matching end tag or empty-element syntax. Ordinary HTML syntax is case-insensitive for element names and permits certain omitted end tags. II and IV reverse these relevant distinctions; the question uses conventional HTML rather than XHTML syntax.

Solution: XML names are case-sensitive; ordinary HTML element names are case-insensitive. XML requires properly closed elements, including self-closing syntax, while HTML permits omission of certain end tags. Thus II and IV are false, C. XML supports application-defined names; HTML uses its vocabulary.

Original paper, page 10 · Answer key

1 mark · MCQ
Report issue

IP Addressing, Fragmentation & Address Resolution

Question 26, GATE 2015: Which IPv4 header field is NOT modified by a typical IP router? A checksum; B source address; C Time To Live; D length.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

A forwarding router decrements TTL to prevent indefinite circulation and must recompute the header checksum accordingly. If it fragments an IPv4 datagram, each fragment's total length differs from the original. Routing alone leaves the source address identifying the originating host. NAT is a separate address-rewriting function and is outside the typical-forwarding premise.

Solution: Ordinary IPv4 forwarding preserves the source address, B. A router decrements TTL and updates the header checksum; fragmentation can alter total length. Address translation is an additional NAT function, not assumed here.

Original paper, page 11 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Application Protocols

Question 27, GATE 2015: Which pair of protocols can both use multiple TCP connections between the same client and server? A HTTP,FTP; B HTTP,TELNET; C FTP,SMTP; D HTTP,SMTP.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Traditional web clients may fetch multiple resources using parallel HTTP TCP connections. FTP separates its control conversation from data transfer, so its ordinary operation uses multiple connections. This explains A under the exam's application-session model. Merely counting arbitrary concurrent sessions is a different interpretation, since multiple independent TELNET or SMTP sessions between two hosts are also possible.

Solution: HTTP may use parallel TCP connections for a page’s resources, and FTP uses separate control and data TCP connections. Thus both HTTP and FTP, A, under the intended application-session comparison. This does not prohibit multiple simultaneous SMTP sessions or transport connections between the same pair of machines.

Original paper, page 11 · Answer key

1 mark · MCQ
Report issue

Closure Properties & Language Hierarchy

Question 28, GATE 2015: L1 is context-free; L2 is recursively enumerable but not recursive. Which must hold? I complement(L1) is recursive; II complement(L2) is recursive; III complement(L1) is context-free; IV complement(L1)∪L2 is recursively enumerable. A I only; B III only; C III and IV; D I and IV.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

A CFL has a terminating membership algorithm, so it and its complement are recursive. If complement(L2) had a decider, exchanging accept/reject would decide L2, a contradiction. CFL closure under complement fails in general, so III is not necessary. For IV, first decide whether the input is outside L1; accept if so, otherwise run the recognizer for L2. That algorithm recognizes the union and may loop only for nonmembers.

Solution: Every CFL is decidable, so complement(L1) is recursive. The complement of nonrecursive L2 cannot be recursive, because recursive languages are closed under complement. CFLs are not closed under complement. Since complement(L1) is recursive and L2 is RE, their union is RE by dovetailing recognizers. Hence I and IV, D.

Original paper, page 11 · Answer key

1 mark · NAT
Report issue

Virtual Memory & Paging

Question 29, GATE 2015: Byte-addressable memory has 32-bit logical addresses, 4-kilobyte pages, and 4-byte page-table entries. Find the single-level page-table size in megabytes.
Tap to enlarge
Answer & solution

Official answer: 4

Step through it (6 steps)

There are 232 addressable bytes and 212 bytes per page, so the virtual address space contains 220 pages. Each needs one entry even though physical memory size is not given. Multiply entries by bytes per entry: 220×4=222 bytes=4 MiB. The question labels binary MiB as MB; the answer is not the page size itself.

Solution: A4 KiB page uses 12 offset bits, leaving 20 page-number bits in a 32-bit address. A single-level table needs 220 entries of 4 bytes, totaling 222 bytes=4 MiB. Thus4 under the question’s binary MB convention.

Original paper, page 11 · Answer key

1 mark · NAT
Report issue

Synchronization & Concurrency

Question 30, GATE 2015: Shared B starts at 2. Concurrent P1 executes C=B−1; B=2*C. Concurrent P2 executes D=2*B; B=D−1. How many distinct final values can B have? Treat each assignment as atomic.
Tap to enlarge
Answer & solution

Official answer: 3

Name P1's statements a,b and P2's c,d. The six order-preserving interleavings abcd,acbd,acdb,cabd,cadb,cdab end with B values 3,3,2,3,2,4 respectively. C and D retain the values calculated when their own reads occurred; later writes to B do not recompute them. Thus the distinct set is {2,3,4}. This is the exam's interleaving model, not an assertion that unsynchronized shared-variable C code has defined behavior.

Solution: Respecting each process’s assignment order, the possible final values of B are 2, 3, 4. Running P1 then P2 gives 3; P2 then P1 gives 4; reading both old B values before either write and leaving P1’s write last gives 2. Enumerating the six order-preserving interleavings adds no others. Thus three distinct values, with atomic statements and sequential consistency.

Original paper, page 12 · Answer key

1 mark · MCQ
Report issue

SQL & Queries

Question 31, GATE 2015: The SELECT operation in SQL corresponds to which relational-algebra operation? A selection; B selection but retaining duplicates; C projection; D projection but retaining duplicates.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Projection chooses output columns, whereas relational selection filters rows. A SQL SELECT list chooses the displayed columns, and ordinary SELECT uses bag semantics: two identical projected rows can both remain. Classical relational projection eliminates duplicates because a relation is a set. SELECT DISTINCT supplies the duplicate-eliminating counterpart. A full SQL query may additionally perform filtering, grouping and joins.

Solution: The SQL SELECT list performs projection, but without DISTINCT it retains duplicate result rows. Thus it corresponds to relational projection with duplicate retention, D; this describes the list operation, not every clause of a full query.

Original paper, page 12 · Answer key

1 mark · MCQ
Report issue

Indexing, Storage & Query Processing

Question 32, GATE 2015: A file's data-record order is the same as, or close to, the order of entries in an index. What kind of index is it? A dense; B sparse; C clustered; D unclustered.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Clustering concerns how the data records themselves are arranged relative to the search key, making nearby key values physically nearby. Dense versus sparse concerns how many index entries exist, not whether the underlying file follows the key order. Therefore density alone cannot answer the question. An unclustered index may point to records scattered throughout the file.

Solution: A clustered index determines the physical ordering/grouping of the underlying data records on its search key. Thus C.

Original paper, page 12 · Answer key

1 mark · NAT
Report issue

Linear Algebra

Question 33, GATE 2015: A=[[2,2],[4,9]]=LU, where L is lower triangular and both U diagonal entries equal 1. Find L's lower diagonal entry l22.
Tap to enlarge
Answer & solution

Official answer: 5

Write L=[[a,0],[b,c]] and U=[[1,d],[0,1]]. Their product is [[a,ad],[b,bd+c]]. Matching entries gives a=2, 2d=2, b=4, and 4d+c=9, hence d=1,c=5. The unit diagonal is imposed on U, not L; assuming the common alternative convention of unit-diagonal L would solve a different decomposition.

Solution: Let L=[[a, 0],[b, c]] and U=[[1, d],[0, 1]]. Equating LU with[[2, 2],[4, 9]] gives a=2, d=1, b=4, c=9−4=5. Thus l22=5.

Original paper, page 12 · Answer key

1 mark · NAT
Report issue

Functions & Parameter Passing

Question 34, GATE 2015: Find the printed integer. C code: void f1(int a,int b){int c;c=a;a=b;b=c;} void f2(int *a,int *b){int c;c=*a;*a=*b;*b=c;} int main(){int a=4,b=5,c=6;f1(a,b);f2(&b,&c);printf("%d",c-a-b);}. Assume required declarations.
Tap to enlarge
Answer & solution

Official answer: -5

Our answer: −5

At f1 entry the parameters copy the caller's 4 and 5; swapping these copies leaves main's a,b,c at 4,5,6. In f2, the pointer parameters are also copied, but dereferencing them reaches main's b and c. Saving *a before overwriting prevents losing the original b. After the swap main has 4,6,5; subtraction is left-associative, so (5−4)−6=−5.

Solution: The value-parameter swap f1 changes only its local copies. The pointer-based f2 swaps caller b and c, giving a=4, b=6, c=5. Therefore c−a−b=−5, with routine declarations assumed.

Original paper, page 13 · Answer key

1 mark · MCQ
Report issue

Binary Search & Balanced Trees

Question 35, GATE 2015: What are worst-case insertion and deletion costs in a binary search tree with n keys? A Θ(log n),Θ(log n); B Θ(n),Θ(n); C Θ(n),Θ(log n); D Θ(log n),Θ(n).
Tap to enlarge
Your answer
Answer & solution

Official answer: B

BST operations take O(h) time in terms of tree height h. Without a balancing guarantee, sorted insertion can create a chain with height n−1. Insertion may search to its bottom, and deletion of a specified key may likewise require a full-height search, with successor/predecessor work also bounded by height. Logarithmic guarantees require a balanced structure, which is not stated.

Solution: An unbalanced BST can be a chain of n nodes. Finding an insertion position or locating a node for deletion can then traverse Θ(n) nodes, so both worst-case costs are linear, B.

Original paper, page 13 · Answer key

2 marks · NAT
Report issue

Data Link, Framing, Error Control & ARQ

Question 36, GATE 2015: Stop-and-wait uses a 64-kilobit/s link with “20 milliseconds propagation delay.” ACK transmission and node processing are negligible. Find the minimum frame size in bytes for at least 50% utilization.
Tap to enlarge
Answer & solution

Official answer: 160

Our answer: 320 bytes for one-way 20ms; official 160

For frame transmission time T and one-way propagation d, a cycle lasts T+2d: the last data bit travels outward and the ACK returns. Requiring T/(T+2d)≥1/2 gives T≥2d. At d=0.020 s this requires 0.040 s of data transmission, or 64000×0.040/8=320 bytes. The official 160 gives only 1/3 utilization under that model, but gives 1/2 if the stated 20 ms is RTT. Retain both interpretation and official scoring explicitly.

Solution: Ignoring ACK serialization, stop-and-wait utilization is T/(T+2Tp). At50%, T=2Tp. With the stated propagation delay Tp=20ms, T=40ms and frame size 64000·0.040=2560 bits=320 bytes. The official 160 bytes instead treats 20ms as the entire round-trip delay. The one-way versus round-trip interpretation changes the answer and is explicitly unresolved.

Original paper, page 14 · Answer key

2 marks · MCQ
Report issue

Heaps & Priority Queues

Question 37, GATE 2015: Insert 35 into the max-heap array (indices 1–9) [40,30,20,10,15,16,17,8,4]. A [40,30,20,10,15,16,17,8,4,35]; B [40,35,20,10,30,16,17,8,4,15]; C [40,30,20,10,35,16,17,8,4,15]; D [40,35,20,10,15,16,17,8,4,30].
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (5 steps)

Preserve the complete-tree shape by inserting at the next free index 10, then repair only its ancestor path. Its parent is floor(10/2)=5, holding 15, so swap. At index 5 the parent is 2, holding 30, so swap again. At index 2 the parent is 1, holding 40, so stop. Option C stops too early and violates 30≥35.

Solution: Append35 at index 10. It exceeds its parent15 at index 5, then 30 at index 2, but not 40 at the root. The array becomes 40, 35, 20, 10, 30, 16, 17, 8, 4, 15, option B.

Original paper, page 14 · Answer key

2 marks · NAT
Not in GATE 2027 syllabusReport issue

Software Engineering

Question 38, GATE 2015: Find cyclomatic complexity of: while(first<=last){if(array[middle]<search) first=middle+1; else if(array[middle]==search) found=TRUE; else last=middle-1; middle=(first+last)/2;} if(first>last) notPresent=TRUE;.
Tap to enlarge
Answer & solution

Official answer: 5

For a single connected control-flow graph with binary conditions, McCabe complexity is one plus the number of decisions. Count while, if(<), else-if(==), and the final if(>): four decisions, hence five. An unconditional else is not an additional test; assignments are not branches. The code can fail to terminate after finding the value, but that semantic defect does not remove a syntactic decision from its control-flow graph.

Solution: The control-flow graph has four binary decisions: the while condition, the first if, the else-if, and the final if. For one connected entry/exit graph, cyclomatic complexity is decisions+1=5. This graph count does not require every syntactic path to be feasible or terminating.

Original paper, page 14 · Answer key

2 marks · NAT
Report issue

Probability & Random Variables

Question 39, GATE 2015: A slotted LAN has four nodes S1–S4. Frames start only at slot boundaries; more than one transmission in a slot collides. Their frame-generation probabilities in the first slot are 0.1,0.2,0.3,0.4. Find the probability of one collision-free frame.
Tap to enlarge
Answer & solution

Official answer: 0.40 to 0.46

Our answer: 0.4404

Assume independent generation at the four nodes, as required by the intended product calculation. “Any station succeeds” means exactly one transmits, not at least one. The disjoint cases S1 only through S4 only have probabilities 0.0336,0.0756,0.1296,0.2016. Their sum is 0.4404. Multiplying all nontransmission probabilities would instead count an idle slot; subtracting that from one would also include collisions.

Solution: Assuming independent transmission attempts, exactly one succeeds with probability 0.1·0.8·0.7·0.6+0.2·0.9·0.7·0.6+0.3·0.9·0.8·0.6+0.4·0.9·0.8·0.7=0.4404, within the official 0.40 to 0.46 range. Marginal attempt probabilities alone would not determine this without the independence assumption.

Original paper, page 15 · Answer key

2 marks · MCQ
Report issue

Boolean Algebra & Logic Gates

Question 40, GATE 2015: Binary operator ≠ has truth table (p,q,result): (0,0,0),(0,1,1),(1,0,1),(1,1,0). Which properties hold? A commutative and associative; B commutative only; C associative only; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Recognize XOR, which is addition modulo 2. Swapping its two inputs preserves their sum modulo 2, proving commutativity. Grouping three inputs either way gives (p+q+r) mod 2, proving associativity. A truth table for only two inputs can show commutativity directly, but associativity needs the three-input relation or this algebraic argument.

Solution: The truth table is XOR. Both (a XOR b) XOR c and a XOR (b XOR c) give parity of the three bits, and a XOR b=b XOR a. Thus the operation is associative and commutative, A.

Original paper, page 15 · Answer key

2 marks · NAT
Report issue

Other / Mixed Topics

Question 41, GATE 2015: Evaluate the sum, x=1 to 99, of 1/[x(x+1)].
Tap to enlarge
Answer & solution

Official answer: 0.99

Partial fractions give 1/[x(x+1)]=1/x−1/(x+1). Write a few terms: (1−1/2)+(1/2−1/3)+…+(1/99−1/100). Every interior reciprocal cancels, leaving 1−1/100=99/100. The last denominator is 100 because the final x is 99; stopping at 1/99 is an off-by-one error.

Solution: Use1/[x(x+1)]=1/x−1/(x+1). Summing x=1 through 99 telescopes to 1−1/100=0.99.

Original paper, page 15 · Answer key

2 marks · MCQ
Report issue

Partial Orders & Lattices

Question 42, GATE 2015: L={p,q,r,s,t} has bottom p, top t, and three mutually incomparable atoms q,r,s, each covering p and covered by t. Choose (x,y,z) uniformly from L^3. For Pr[x∨(y∧z)=(x∨y)∧(x∨z)], choose A 0; B 1; C 0<Pr≤1/5; D 1/5<Pr<1.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

There are 5³=125 ordered triples, with repeated elements allowed. If x,y,z are three distinct atoms, y∧z=p and x∨p=x, while x∨y=x∨z=t, so the right side is t: distributivity fails. There are 3!=6 such triples. If an entry is p or t, or atom entries repeat, absorption and bound identities make the equality hold. Hence 119 triples satisfy it, giving 119/125=0.952 and D. A lattice can be nondistributive while most sampled triples still satisfy this equation.

Solution: The diagram is the five-element diamond lattice M3. Distributivity fails exactly for triples whose first entry is one atom and whose other two entries are the other two distinct atoms: six ordered triples. Other triples satisfy it. Thus the probability is 119/125=0.952, which lies strictly between 1/5 and 1, D.

Original paper, page 15 · Answer key

2 marks · MCQ
Report issue

Boolean Algebra & Logic Gates

Question 43, GATE 2015: Boolean operations are f(X,Y,Z)=X′YZ+XY′+Y′Z′ and g(X,Y,Z)=X′YZ+X′YZ′+XY. Which singleton basis is functionally complete? A both; B only {f}; C only {g}; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

For g, factor Y: X′Y(Z+Z′)+XY=Y(X′+X)=Y. Repeated use of a projection can merely select existing inputs, not synthesize negation. For f, connect the third input to the second: f(X,Y,Y)=X′Y+XY′+Y′=X′Y+Y′=X′+Y′=(XY)′. This constructs NAND without supplying constants; NAND alone realizes NOT and AND and therefore all Boolean functions.

Solution: g=¬XYZ+¬XY¬Z+XY=Y. Compositions of this projection cannot produce all Boolean functions. For f=¬XYZ+X¬Y+¬Y¬Z, substitute Z=Y: f(X, Y, Y)=¬XY+X¬Y+¬Y=¬X+¬Y, NAND. Since NAND alone is functionally complete, f is complete whereas g is not, B.

Original paper, page 16 · Answer key

2 marks · NAT
Report issue

Graph Theory

Question 44, GATE 2015: A connected plane graph has 10 vertices, and each face has three boundary edges. How many edges does it have?
Tap to enlarge
Answer & solution

Official answer: 24

Count edge incidences with faces: every edge borders two face sides, so 3F=2E, including the unbounded exterior face. Euler's equation V−E+F=2 becomes 10−E+2E/3=2. Solving yields E=24 and F=16. Checking 3×16=2×24 verifies the count. Ignoring the exterior face would break both equations.

Solution: Every face, including the outer face, has three boundary edges, so 3F=2E. Euler’s formula for the connected plane graph gives 10−E+F=2. Substitution yields E=3·10−6=24.

Original paper, page 16 · Answer key

2 marks · MCQ
Report issue

Recurrences & Generating Functions

Question 45, GATE 2015: Let a_n count n-bit strings containing two consecutive 1s. Which recurrence gives a_n? A a_(n−2)+a_(n−1)+2^(n−2); B a_(n−2)+2a_(n−1)+2^(n−2); C 2a_(n−2)+a_(n−1)+2^(n−2); D 2a_(n−2)+2a_(n−1)+2^(n−2).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Partition strings into mutually exclusive initial patterns 0,10,11. A leading 0 leaves a suffix of length n−1 that must contain 11. A leading 10 leaves length n−2 with the same requirement. A leading 11 already satisfies it, so all 2n−2 suffixes qualify. This gives A for n≥2 with a0=a1=0; as a check, a2=1 and a3=3.

Solution: Partition valid n-bit strings by prefixes 0, 10, 11. The first class contributes a(n−1), the second a(n−2), and the third has arbitrary remaining n−2 bits, contributing 2n−2. Hence a(n)=a(n−1)+a(n−2)+2n−2, A.

Original paper, page 17 · Answer key

2 marks · MCQ
Report issue

Code Optimization & Data-Flow Analysis

Question 46, GATE 2015: A variable is live at statement Si if some reachable use Sj has no intervening assignment, including Si and Sj. CFG: block 1 p=q+r; s=p+q; u=s*v; branches to block 2 v=r+u or block 3 q=s*u; both go to block 4 q=v+r; block 4 loops to block 1. Which are live at both block 2 and block 3 entry? A p,s,u; B r,s,u; C r,u; D q,v.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Use the old value test: a value matters only if a path reads it before replacement. At block 2, r and u are read immediately; old v is killed by v=r+u, old q by block 4, and p,s by block 1 before future use. At block 3, s,u are immediate reads and v,r remain needed at block 4. Taking the intersection of {r,u} and {s,u,v,r} leaves {r,u}. Liveness is backward data flow and uses possible paths, not just values read in the next line.

Solution: At entry to block 2, r and u are used by v=r+u; old v is overwritten and old q is overwritten in block 4. At entry to block 3, s and u are used by q=s*u, while v and r are needed by block 4. Thus live-in sets are{r, u} and{s, u, v, r}; their intersection is{r, u}, C. Values overwritten in block 1 before any later use need not be added.

Original paper, page 17 · Answer key

2 marks · NAT
Report issue

Intermediate Code

Question 47, GATE 2015: Find the least temporary-variable count for static-single-assignment three-address code for q+r/3+s−t*5+u*v/w.
Tap to enlarge
Answer & solution

Official answer: 8

One valid translation is t1=r/3; t2=q+t1; t3=t2+s; t4=t*5; t5=t3−t4; t6=u*v; t7=t6/w; t8=t5+t7. There are eight binary-operation nodes and each three-address instruction computes only one. SSA forbids assigning a later intermediate into an already used temporary name, so the intended unoptimized translation needs eight names, including its final result. Reusing one scratch register would not be SSA.

Solution: The expression has eight binary operations: the divisions r/3 and (u*v)/w, multiplications t*5 and u*v, and four outer additive/subtractive operations. A three-address translation with a fresh temporary for every operation therefore uses eight temporaries, including the expression result.

Original paper, page 17 · Answer key

2 marks · NAT
Report issue

Database Models, Architecture & ER Diagrams

Question 48, GATE 2015: Entities E1,E2,E3 have single-valued attributes (a11 key,a12),(a21 key,a22),(a31 key,a32). E1–E2 has m:n relationship R12; E1–E3 has 1:n R13, n on E3 side. Relationships have no attributes. Find minimum relations when all are in 3NF.
Tap to enlarge
Answer & solution

Official answer: 4

Construct E1(a11,a12), E2(a21,a22), E3(a31,a32,a11), and R12(a11,a21). E3's added a11 foreign key records its single associated E1 without a separate R13 table. R12 needs a separate association relation because either entity may participate in multiple pairs. Given only the stated dependencies, these four relations meet 3NF; merging an entity's nonkey attributes into R12 would introduce redundant dependencies.

Solution: Use one relation for each of the three entity types. Implement the 1: n relationship by a foreign key on the n side, requiring no extra relation. The m: n relationship needs its own relation containing the participating keys. Thus four relations suffice under the displayed constraints.

Original paper, page 18 · Answer key

2 marks · NAT
Report issue

Finite Automata

Question 49, GATE 2015: Two complete DFAs over {a,b} each have start nonfinal state 0 and final state 1. M: on a, either state goes to 1; on b, either goes to 0. N: on a, either goes to 0; on b, either goes to 1. Find states in a minimal DFA for L(M)∩L(N).
Tap to enlarge
Answer & solution

Official answer: 1

M records whether the most recent symbol is a; N records whether it is b. Empty input is rejected by both initial states. A nonempty string cannot end in both symbols, so no string belongs to the intersection. Although a mechanical product construction offers up to four states, minimization merges all reachable states into one rejecting sink because every continuation is rejected. A DFA still requires its start state, so the answer is not zero.

Solution: The first DFA accepts exactly strings ending in a, and the second exactly strings ending in b. Their intersection is empty. The minimal complete DFA for the empty language is one nonaccepting state with loops on both symbols, so 1.

Original paper, page 18 · Answer key

2 marks · MCQ
Report issue

Pushdown Automata

Question 50, GATE 2015: NPDA states q0(start),q1,q2(final), stack bottom ⊥. At q0 read b∈{0,1} and push b; transition to q1 may consume 0,1,or ε without changing stack. At q1 read 0 and pop 1, or read 1 and pop 0. With only ⊥ left, ε-pop it and enter q2. Which suffix appended to 101100 is accepted? A 10110; B 10010; C 01010; D 01001.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

The push phase remembers a prefix in reverse order; the pop phase checks its complemented reverse. Thus accepted strings have form w z complement(reverse(w)), where z is empty or one symbol. Every listed concatenation has eleven symbols, forcing |w|=5 and one middle symbol. Here w=10110, middle=0, and reverse(w)=01101. Complementing gives 10010. The nondeterministic phase switch is constrained by total length, so one cannot push all six supplied prefix bits.

Solution: The NPDA pushes a prefix, optionally consumes a middle symbol while changing phase, then pops only on the complementary symbol. The full listed strings have length 11, so the first five symbols 10110 are pushed and the sixth 0 is the middle. The remaining five must be the complement of the reversed prefix: reverse 10110=01101, complement 10010. Thus B.

Original paper, page 18 · Answer key

2 marks · MCQ
Report issue

Graph Algorithms

Question 51, GATE 2015: G is a simple undirected graph, s a source, d(x) shortest distance from s, and T a BFS tree. For an edge (u,v) not in T, which cannot equal d(u)−d(v)? A −1; B 0; C 1; D 2.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

An edge gives a one-step extension of a shortest path: d(u)≤d(v)+1 and d(v)≤d(u)+1. Combining gives −1≤d(u)−d(v)≤1. BFS non-tree edges can connect two vertices on the same level or consecutive levels; being non-tree does not force equal levels. Distances must be finite, so interpret u,v as vertices in the explored source component.

Solution: For any edge joining reachable vertices u, v, a shortest path to v followed by that edge proves d(u)≤d(v)+1, and symmetrically d(v)≤d(u)+1. Hence their distances differ by at most 1, so 2 is impossible, D. The restriction to a non-tree edge does not change the bound; same-level and adjacent-level non-tree edges can occur. Distances are understood within the source component, since subtraction of two infinite unreachable distances is not defined.

Original paper, page 19 · Answer key

2 marks · NAT
Report issue

CPU Scheduling

Question 52, GATE 2015: A preemptive uniprocessor runs periodic T1,T2,T3 with periods 3,7,20 ms and execution times 1,2,4 ms. Shorter period means higher priority. All first jobs arrive at the beginning of millisecond 1. At the end of which millisecond does first T3 finish?
Tap to enlarge
Answer & solution

Official answer: 12

Set time zero at that initial arrival. T1 releases at 0,3,6,9; T2 at 0,7. First T3 starts at 4 after T1,T2,T1 consume four units, gets two units until time 6, then waits while T1,T2,T1 run through time 10. It completes its remaining two units in [10,12). Thus the finish is the end of the twelfth millisecond, not the beginning of millisecond 12. No context-switch overhead is supplied.

Solution: With time 0 at the beginning of the first millisecond, rate-monotonic priorities are T1>T2>T3. Execute T1: 0–1, T2: 1–3, T1: 3–4, T3: 4–6, T1: 6–7, T2: 7–9, T1: 9–10, T3: 10–12. The first T3 job receives its required 4ms and finishes at time 12, the end of the twelfth millisecond. Context-switch overhead is unspecified and taken as zero.

Original paper, page 20 · Answer key

2 marks · MCQ
Report issue

Flip-Flops, Registers & Sequential Circuits

Question 53, GATE 2015: Positive-edge D and JK flip-flops share a clock. D output drives both J,K; JK output drives D input. Initially D output=1, JK output=0. J=K=1 toggles JK; J=K=0 holds it. Both have nonzero propagation delay. Choose JK output including initial value: A 0110110…; B 0100100…; C 011101110…; D 011001100….
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Denote outputs by d,j to distinguish the JK output from its input terminal names. At an edge d′=j. The JK output toggles exactly when d=1, so j′=j XOR d. Apply both using pre-edge values: (1,0)→(0,1)→(1,1)→(1,0). The JK column is 0,1,1,0,1,1,… . Nonzero propagation delay prevents treating one edge-triggered output update as an input sampled by the other at that same edge.

Solution: Let the old outputs be(D, J), where J denotes the JK output. At a common positive edge, Dnext=J and Jnext=J XOR D. From initial(1, 0), the state sequence is(0, 1),(1, 1),(1, 0), repeating every three edges. The JK output including its initial value is 0110110..., A. Both devices sample old outputs at the edge; propagation delays do not make the updates sequential.

Original paper, page 20 · Answer key

2 marks · NAT
Not in GATE 2027 syllabusReport issue

Secondary Storage

Question 54, GATE 2015: Disk seek=4 ms, rotation=10000 RPM, 600 sectors/track, 512 bytes/sector. File has 2000 sectors. Every sector access needs a seek and average half-rotation latency. Find total read time in ms.
Tap to enlarge
Answer & solution

Official answer: 14020

Convert RPM carefully: 10000 revolutions take 60000 ms, so each revolution lasts 6 ms. Half is 3 ms; one of 600 sectors occupies 6/600=0.01 ms of rotation. The stipulated independent per-sector cost is 4+3+0.01=7.01 ms, so the file costs 14020 ms. Assuming sequential sectors share one seek would ignore the explicit premise; 512-byte size is unnecessary once sectors per rotation is known.

Solution: A rotation takes 60000/10000=6ms, so average rotational latency is 3ms. One sector transfer takes 6/600=0.01ms. With a fresh 4ms seek for every sector as stipulated, 2000 sectors take 2000*(4+3+0.01)=14020ms.

Original paper, page 20 · Answer key

2 marks · NAT
Report issue

Pipelining & Hazards

Question 55, GATE 2015: A nonpipelined CPU runs at 2.5 GHz with average CPI=4. A five-stage pipelined version runs at 2 GHz due to pipeline delay, with no stalls. Find speedup.
Tap to enlarge
Answer & solution

Official answer: 3.2

Compare time per instruction, not stage count alone. Initially an instruction costs four 0.4-ns cycles, or 1.6 ns. A full stall-free pipeline produces one result per 0.5-ns cycle. Throughput speedup is 1.6/0.5=3.2. Five stages affect latency and initial fill; they do not make the improvement automatically fivefold. This is the steady-state limit for a sufficiently long stream.

Solution: Nonpipelined throughput is 2.5GHz/4=0.625 billion instructions/s. A stall-free full pipeline at 2GHz completes one instruction per cycle, giving 2 billion/s. The steady-state speedup is 2/0.625=3.2. This ignores fill/drain overhead for a finite short instruction sequence, whose length is not supplied.

Original paper, page 21 · Answer key

2 marks · NAT
Report issue

I/O & Disk Scheduling

Question 56, GATE 2015: Disk has 100 tracks. Pending sequence: 45,20,90,10,50,60,80,25,70. Initial head=50. Find extra travel by SSTF compared with SCAN, initially moving towards 100.
Tap to enlarge
Answer & solution

Official answer: 10

Our answer: Official10 uses LOOK; true SCAN difference is−10 with endpoint 100

SSTF repeatedly chooses the nearest pending track, producing total 130. In an upward sweep followed by reversal at the highest request, travel is 50→90→10, or 120; this is LOOK and yields the published +10. SCAN conventionally visits the physical end before reversing. Ending the accounting at the last served request 10 gives 140 if the upper end is 100, or 138 if tracks are 0–99. Therefore literal SSTF−SCAN is −10 or−8 under those conventions. The source's positive answer remains recorded but must not be presented as an unqualified SCAN derivation.

Solution: SSTF services 50, 45, 60, 70, 80, 90, 25, 20, 10, with movements 0+5+15+10+10+10+65+5+10=130. Reversing at the last pending upper request 90 gives(90−50)+(90−10)=120, so SSTF exceeds that LOOK distance by 10, the published answer. True SCAN continues to the disk endpoint before reversing: using endpoint 100 gives(100−50)+(100−10)=140 and SSTF−SCAN=−10. If100 tracks means 0..99, SCAN gives 138 and the difference is−8. The stated SCAN name/endpoints do not support the published positive 10 without a LOOK-style convention.

Original paper, page 21 · Answer key

2 marks · MCQ
Report issue

Virtual Memory & Paging

Question 57, GATE 2015: Five initially empty page frames receive 3,8,2,3,9,1,6,3,8,9,3,6,2,1,3. Compare FIFO and LRU faults. A same; B FIFO has two more; C LRU has two more; D FIFO has one more.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (2 policies)

After filling with 3,8,2,9,1, FIFO removes 3 for 6, then 8 for 3, then 2 for 8; the repeated hits do not change its queue. LRU updates recency at every hit, so it evicts 8 when 6 arrives, then 2 when 8 returns. Continuing through the full sequence gives nine faults for each, although different victims and fault positions occur. Equal totals in this example do not imply the policies behave identically or have equal performance on all strings.

Solution: Starting with empty frames, FIFO faults at reference positions 1, 2, 3, 5, 6, 7, 8, 9, 13; LRU faults at 1, 2, 3, 5, 6, 7, 9, 13, 14. Each has 9 faults, though at different references. Thus A. The simulation updates LRU recency on hits but does not change FIFO insertion order on hits.

Original paper, page 21 · Answer key

2 marks · NAT
Report issue

Calculus

Question 58, GATE 2015: Evaluate integral from 1/π to 2/π of cos(1/x)/x² dx.
Tap to enlarge
Answer & solution

Official answer: -1

Our answer: −1

Let u=1/x, so du=−dx/x². The lower x bound gives u=π and the upper gives u=π/2, reversing order. Therefore the integral is −∫ from π to π/2 cos(u)du=sin(π)−sin(π/2)=−1. The negative answer is plausible because cos(1/x) is nonpositive on this interval; losing the substitution minus sign would give the wrong sign.

Solution: An antiderivative of cos(1/x)/x² is−sin(1/x). Evaluating from 1/π to 2/π gives−sin(π/2)+sin(π)=−1.

Original paper, page 21 · Answer key

2 marks · MCQ
Report issue

Linear Algebra

Question 59, GATE 2015: Matrix A=[[1,4],[b,a]] has eigenvalues −1 and 7. Find (a,b). A (6,4); B (4,6); C (3,5); D (5,3).
Tap to enlarge
Your answer
Answer & solution

Official answer: D

The sum of eigenvalues equals the trace, so 1+a=6 and a=5. Their product equals determinant, so a−4b=−7. Substitute a=5 to obtain b=3. As a check, the characteristic polynomial is λ²−6λ−7=(λ−7)(λ+1), recovering both given eigenvalues without computing eigenvectors.

Solution: The trace is 1+a=(−1)+7=6, so a=5. The determinant is a−4b=(−1)*7=−7, so 5−4b=−7 and b=3. Thus D.

Original paper, page 22 · Answer key

2 marks · MCQ
Report issue

Arrays & Linked Lists

Question 60, GATE 2015: An algorithm performs N inserts and sqrt(log N) each of find, delete, decrease-key on ordered keys. Delete and decrease-key receive pointers to their records. Which structure minimizes total asymptotic cost? A unsorted array; B min-heap; C sorted array; D sorted doubly linked list.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Let k=sqrt(log N). Unsorted insertion is constant amortized time, while each arbitrary-key find scans O(N), giving O(N+Nk)=O(Nsqrt(log N)). Even charging O(N) per deletion for compaction leaves the same order; decrease-key requires no ordering repair. A binary heap's online inserts can cost Θ(Nlog N) altogether and it does not speed arbitrary-key search. Sorted structures pay to locate or maintain insertion positions, potentially Θ(N²). Pointer access removes the search for a deletion target, not the need to preserve a chosen ordering.

Solution: Let k=sqrt(log N). With an unsorted array, N insertions take O(N) amortized and k arbitrary-key finds take O(Nk); pointer-directed deletion and decrease-key need at most O(Nk) total even if compaction work is charged. Total O(Nsqrt(log N)). A standard online binary min-heap costs O(Nlog N) for N worst-case insertions, and arbitrary-key finds are still linear. Maintaining sorted arrays or lists can cost Θ(N²) over the N insertions. Thus the unsorted array is best among the listed textbook online structures, A. This comparison is for the specified operation model, not an alternative offline bulk-sorting/heap-building algorithm.

Original paper, page 22 · Answer key

2 marks · NAT
Report issue

SQL & Queries

Question 61, GATE 2015: Student(Roll_No,Student_Name) rows: (1,Raj),(2,Rohit),(3,Raj). Performance(Roll_No,Course,Marks): (1,Math,80),(1,English,70),(2,Math,75),(3,English,80),(2,Physics,65),(3,Math,80). SQL: SELECT S.Student_Name,sum(P.Marks) FROM Student S,Performance P WHERE S.Roll_No=P.Roll_No GROUP BY S.Student_Name. How many output rows?
Tap to enlarge
Answer & solution

Official answer: 2

The equality join associates each course result with the appropriate student record, producing six joined rows. GROUP BY uses the name column, not the unique roll number, so the two Raj students become one aggregate group. The result contains (Raj,310) and (Rohit,140). Counting students gives three and counting course records gives six, but neither is the number of distinct grouping keys.

Solution: The join matches each performance row to its student by Roll_No, but grouping is by Student_Name alone. Roll numbers 1 and 3 both have name Raj and collapse into one group with total 80+70+80+80=310. Rohit forms the other group with 75+65=140. Hence2 result rows.

Original paper, page 23 · Answer key

2 marks · MCQ
Report issue

Pointers & Memory

Question 62, GATE 2015: Assume x address=2000 decimal and unsigned int occupies four bytes. Code: int main(){unsigned int x[4][3]={{1,2,3},{4,5,6},{7,8,9},{10,11,12}};printf("%u, %u, %u",x+3,*(x+3),*(x+2)+3);}. A 2036,2036,2036; B 2012,4,2204; C 2036,10,10; D 2012,4,6.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Our answer: A under intended address display; literal printf has undefined behavior

x decays to a pointer to a whole three-element row, so adding 3 advances 3×12 bytes. Dereferencing that pointer produces a row array, which decays to its first-element pointer rather than the value 10. By contrast *(x+2)+3 adds three four-byte elements to the third row's base2024, again yielding numerical address 2036, now one past that row. These address calculations explain intended A only. Printing pointers with %u is a variadic type mismatch and undefined behavior; there is no guaranteed actual C output.

Solution: Each row occupies 3*4=12 bytes. x+3 points to the fourth row at 2000+36=2036; *(x+3) decays to that row’s first element at 2036. *(x+2)+3 is the valid one-past pointer of the third row, also numerically 2036 under the stated layout. Thus the intended address triple is 2036, 2036, 2036, A. However all three arguments are pointers while %u requires unsigned int; this variadic format mismatch is undefined behavior in C. A conforming address display uses %p with each pointer cast to void*, whose textual format is implementation-defined. The omitted stdio declaration is another standalone-code caveat.

Original paper, page 23 · Answer key

2 marks · NAT
Report issue

Graph Algorithms

Question 63, GATE 2015: Graph vertices A,B,C,D,E,F; edges AB,AC,BC,BE,CD,DE,DF,EF. All eight weights are distinct integers. Its MST has weight 36 and edges AC=9,BC=2,BE=15,EF=4,DF=6. Find the minimum total of all eight edges.
Tap to enlarge
Answer & solution

Official answer: 69

Adding a non-tree edge creates one cycle. If its weight were below the largest edge on that tree path, replacing that tree edge would give a lighter spanning tree. Distinctness forces a strict inequality. AB's path maximum is 9, CD's is 15, and DE's is 6, so their least integer choices are 10,16,7. These choices do not clash with any existing weight. The cycle conditions are also sufficient to preserve this MST, establishing attainability, not merely a lower bound. Total is 36+33=69.

Solution: For a tree to remain the MST with distinct weights, every non-tree edge must be heavier than the maximum edge on its tree path. AB must exceed max(AC9, CB2)=9, so at least 10. CD must exceed max(CB2, BE15, EF4, FD6)=15, so at least 16. DE must exceed max(DF6, FE4)=6, so at least 7. Values10, 16, 7 are mutually distinct and different from the given tree weights, and satisfy all cycle conditions. Minimum total is 36+10+16+7=69.

Original paper, page 24 · Answer key

2 marks · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 64, GATE 2015: C function: int fun1(int n){int i,j,k,p,q=0;for(i=1;i<n;++i){p=0;for(j=n;j>1;j=j/2)++p;for(k=1;k<p;k=k*2)++q;}return q;}. Which most closely approximates its return value? A n³; B n(log n)²; C n log n; D n log(log n).
Tap to enlarge
Your answer
Answer & solution

Official answer: D

The first inner loop computes p≈log₂n but never increments q. The second loop increments q for k=1,2,4,… below p, about log₂p times. Multiplying by n−1 outer iterations gives Θ(n log log n). This asks for the returned number, not running time: computing p itself costs Θ(log n) each iteration, so the code's runtime is Θ(n log n). Mathematical asymptotics assume integers do not overflow.

Solution: The outer loop runs n−1 times. Repeated integer halving of j from n until≤1 gives p=floor(log₂n). Doubling k from 1 while k<p increments q ceil(log₂p) times when p≥1. Thus for sufficiently large n the return value is(n−1)*ceil(log₂ floor(log₂n))=Θ(n log log n), D. This is the mathematical count under no-overflow arithmetic; q can overflow a fixed-width int for sufficiently large inputs.

Original paper, page 24 · Answer key

2 marks · MCQ
Report issue

Control Flow & Loop Tracing

Question 65, GATE 2015: For positive integers x,y: q:=0; r:=x; while r≥y do {r:=r−y; q:=q+1}. Which postcondition holds? A r=qx+y and r<y; B x=qy+r and r<y; C y=qx+r and 0<r<y; D q+1<r−y and y>0.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Prove the invariant x=qy+r by initialization and preservation: (q+1)y+(r−y)=qy+r. The guard ensures subtracting y never makes r negative. Since positive y decreases r at every step, the loop terminates and the false guard gives r<y. Therefore q is the integer quotient and r the remainder with 0≤r<y. A remainder may be zero, so a strict lower bound such as that in C would be wrong.

Solution: Initially q=0, r=x, so x=qy+r. Each iteration replaces r by r−y and q by q+1, preserving that invariant. Positive y decreases nonnegative r on every iteration; termination gives 0≤r<y. Hence the listed postcondition x=qy+r and r<y is B; the full invariant also supplies the nonnegative lower bound.

Original paper, page 25 · Answer key