GATE / CS ARCHIVE

PAPER / ORIGINAL ORDER

GATE 2013

65 questions

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

03:00:00
1 mark · MCQ
Report issue

Nadir

Vocabulary & Verbal Analogies

Question 56, GATE 2013: Choose the closest meaning of “nadir”: A highest; B lowest; C medium; D integration.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Nadir means the lowest point, the opposite of zenith. Hence lowest, B.

Use the direction of the word rather than its emotional connotation: a nadir is a bottommost point, whether literal or figurative (for example, the nadir of someone’s fortunes). “Highest” reverses that relation, “medium” is intermediate, and “integration” describes combination rather than position. Thus only lowest preserves the meaning.

Original paper, page 13 · Answer key

1 mark · MCQ
Report issue

Opposite concepts

Vocabulary & Verbal Analogies

Question 57, GATE 2013: Complete the analogy: universalism : particularism :: diffuseness : ___. A specificity; B neutrality; C generality; D adaptation.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Universalism and particularism are contrasting concepts. Diffuseness likewise contrasts with specificity, A.

First identify the relation in the first pair: universalism emphasizes what applies broadly, whereas particularism emphasizes special cases. The second pair must likewise contrast broad, diffuse scope with sharply defined scope. Specificity provides that contrast. Neutrality concerns taking sides, adaptation concerns adjustment, and generality resembles diffuseness instead of opposing it.

Original paper, page 13 · Answer key

1 mark · MCQ
Report issue

Maximum arithmetic partial sum

Algebra, Equations & Number Patterns

Question 58, GATE 2013: Find the maximum sum of an initial segment of 44, 42, 40,… . Options A502, B504, C506, D500.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

The successive terms decrease by 2. Include all positive terms 44, 42,..., 2; adding 0 changes nothing and subsequent negative terms reduce the sum. There are 22 positive terms, with sum 22(44+2)/2=506, C.

Let Sm be the sum of the first m terms. Its next increment is 44−2m. While this is positive, taking another term increases the total; once it is negative, taking it decreases the total. The positive terms stop at 2, so there are (44−2)/2+1=22. The arithmetic-series formula gives S22=22×46/2=506. Taking the following zero term ties this maximum, but no later prefix exceeds it.

Original paper, page 13 · Answer key

1 mark · MCQ
Report issue

Counterfactual conditional

English Grammar & Usage

Question 59, GATE 2013: Complete “Were you a bird, you ___ in the sky.” A would fly; B shall fly; C should fly; D shall have flown.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Were you a bird is an inverted unreal conditional: If you were a bird, you would fly. Thus A.

Moving “were” before the subject creates the same unreal condition as “If you were a bird.” The corresponding result uses would plus the base verb: “you would fly.” “Shall” expresses a different future construction, while “shall have flown” also changes the time relationship to future completion. “Should” does not give the ordinary intended hypothetical consequence here.

Original paper, page 13 · Answer key

1 mark · MCQ
Report issue

Indefinite article before European

English Grammar & Usage

Question 60, GATE 2013: Choose the grammatically incorrect sentence: A He is of Asian origin. B They belonged to Africa. C She is an European. D They migrated from India to Australia.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

European begins with the consonant sound /y/, so the phrase is a European, not an European. The incorrect sentence is C.

The indefinite article depends on the initial sound, not merely the initial letter. “European” is pronounced with an initial /j/ sound, like “you,” so it takes “a.” “Asian” begins with a vowel sound but option A uses the uncountable phrase “of Asian origin,” which needs no indefinite article. The prepositions in the other listed sentences are grammatical. The required incorrect sentence is therefore C.

Original paper, page 13 · Answer key

2 marks · MCQ
Report issue

Telescoping radical sum

Algebra, Equations & Number Patterns

Question 61, GATE 2013: Evaluate Σ from k=1 to 80 of 1/(√k+√(k+1)). Options A7, B8, C9, D10.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Rationalizing gives 1/(√k+√(k+1))=√(k+1)−√k. Summing k=1,..., 80 telescopes to√81−√1=9−1=8, B.

Multiply one summand by the conjugate ratio (√(k+1)−√k)/(√(k+1)−√k). The denominator becomes (k+1)−k=1. The sum is then (√2−1)+(√3−√2)+…+(√81−√80). Every interior square root appears once positively and once negatively. Only9−1 remains, so the sum is 8.

Original paper, page 13 · Answer key

2 marks · MCQ
Report issue

Uniform two-digit selection

Counting, Probability & Sets

Question 62, GATE 2013: Select uniformly from all two-digit positive integers between 1 and 100. Find the probability of not being divisible by 7. A13/90, B12/90, C78/90, D77/90.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

There are 90 two-digit positive integers 10,..., 99. The multiples of 7 are 14,..., 98, numbering 14−2+1=13. Thus77 are not divisible by 7, and the requested probability is 77/90, D.

Two-digit integers run from 10 through 99 inclusive, giving 99−10+1=90 equally likely outcomes. Multiples of 7 in that interval are 7j with 2≤j≤14, so there are 13. Their complement contains 90−13=77 outcomes. Divide favorable by total to obtain 77/90. Including7 or the endpoint 100 would alter the sample space incorrectly.

Original paper, page 13 · Answer key

2 marks · MCQ
Report issue

Persistence passage inference

Reading Comprehension & Verbal Reasoning

Question 63, GATE 2013: A passage describes Robert Bruce, discouraged by repeated military defeats, regaining hope after watching a spider persist through failures and finally complete its web. He returns to fight successfully. Which assertion is best supported? A Failure is the pillar of success. B Honesty is the best policy. C Life begins and ends with adventures. D No adversity justifies giving up hope.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

The account emphasizes renewed hope and continued effort after repeated failure. Among the options, the best-supported moral is that adversity does not justify abandoning hope, D. This is a reading-comprehension interpretation of the passage, not a formal universal theorem inferred from one example.

The passage connects persistence despite failure with renewed hope. D directly summarizes that encouragement. Honesty is never discussed, so B is unsupported. Adventure is not the stated cause of the change, excluding C. A is a possible broad proverb about failure, but D more precisely captures the decision not to abandon hope after adversity. This is a best-supported interpretation, not a proof that every persistent attempt succeeds.

Original paper, page 14 · Answer key

2 marks · MCQ
Report issue

Journey average speed

Time, Work, Speed & Distance

Question 64, GATE 2013: A tourist travels half the total distance by train at 60 km/h, half the remainder by bus at 30 km/h, and the rest by cycle at 10 km/h. Find average speed: A36, B30, C24, D18 km/h.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

For total distance d, the three portions are d/2, d/4, d/4. Time=d/120+d/120+d/40=d/24 hours, so the overall speed is 24 km/h, C. An arithmetic average of the three speeds would incorrectly weight the travel times.

A convenient total distance is 120 km. The train covers 60 km in 1 hour. Half the remaining 60 km is 30 km by bus, also 1 hour. The last 30 km at 10 km/h takes 3 hours. Total time is 5 hours, so average speed is 120/5=24 km/h. The slow segment consumes most of the time even though it is only one quarter of the distance; that is why averaging 60, 30, 10 directly is invalid.

Original paper, page 14 · Answer key

2 marks · MCQ
Report issue

Wage and working-period change

Arithmetic, Ratios & Percentages

Question 65, GATE 2013: Erecting a structure currently costs Rs13, 200. Labour wages per day rise by one fifth, while working hours decrease by one twenty-fourth of the current period. Find the new cost: A16, 500; B15, 180; C11, 000; D10, 120 rupees.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Our answer: B under the intended total-period interpretation

The key treats erection cost as proportional to wage rate and total working period: 13200×(6/5)×(23/24)=15180, B. This assumes the stated reduction concerns total labour time and that the entire relevant cost scales as labour. If working hours means hours per day while the required total labour remains fixed, the number of days instead grows 24/23 and the labour cost becomes 13200×(6/5)×(24/23)≈16528.70, not an option. The wording does not distinguish those interpretations; retain B as the intended model, not an unconditional consequence.

Under the key’s labour-cost interpretation, the wage multiplier is 1+1/5=6/5 and the total labour-period multiplier is 1−1/24=23/24. Apply both to the old cost: 13200×6/5=15840, then 15840×23/24=15180. This arithmetic is internally consistent only with the stated intended model. If the shorter hours are per day and the task requires unchanged total work, fewer hours per day require more paid days, producing the inverse time multiplier instead.

Original paper, page 14 · Answer key

1 mark · MCQ
Report issue

Commutativity and associativity

Algebraic Structures

Question 1, GATE 2013: On the integers define x⊕y=x²+y². Which holds? A commutative but not associative; B both; C associative but not commutative; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

x⊕y=x²+y² is symmetric, so it is commutative. It is not associative: (1⊕1)⊕2=2²+2²=8, whereas 1⊕(1⊕2)=1²+5²=26. Therefore A.

Commutativity asks whether swapping the two inputs changes the output; x²+y²=y²+x² for all integers. Associativity asks whether changing parentheses changes a three-input computation. For inputs 1, 1, 2, first forming 1⊕1 gives 2 and then 2⊕2 gives 8. First forming 1⊕2 gives 5 and then 1⊕5 gives 26. One counterexample is enough to disprove associativity, whereas commutativity was established for arbitrary inputs.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Poisson probability below three

Probability & Random Variables

Question 2, GATE 2013: Cars arriving per minute follow a Poisson distribution of mean 3. Find P(X<3): A8/(2e³), B9/(2e³), C17/(2e³), D26/(2e³).
Tap to enlarge
Your answer
Answer & solution

Official answer: C

For Poisson mean 3, P(X<3)=P(0)+P(1)+P(2)=e−3(1+3+9/2)=17/(2e³), C.

For Poisson mean λ, P(X=k)=e−λλk/k!. The event fewer than 3 consists of the disjoint outcomes 0, 1, 2. Substituting λ=3 gives probabilities e−3, 3e−3, and(9/2)e−3. Their sum is(1+3+4.5)e−3=8.5e−3=17/(2e³). Do not include X=3: “fewer than” is strict.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Determinant transformations

Linear Algebra

Question 3, GATE 2013: Let Δ have rows (1, x, x²),(1, y, y²),(1, z, z²). Which determinant is not identically Δ? A rows (1, x(x+1), x+1),(1, y(y+1), y+1),(1, z(z+1), z+1). B rows (1, x+1, x²+1),(1, y+1, y²+1),(1, z+1, z²+1). C rows (0, x−y, x²−y²),(0, y−z, y²−z²),(1, z, z²). D rows (2, x+y, x²+y²),(2, y+z, y²+z²),(1, z, z²).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Let the original columns be u, v, w. Option A has columns u, v+w, u+v. Multilinearity removes repeated-column terms and leaves det(u, w, v)=−det(u, v, w). The other options use determinant-preserving row/column additions or differences. Thus A is the expression not identically equal to the original determinant. If the original determinant happens to be 0, its negative also equals it; the question is understood as asking for a general identity, not pointwise inequality for every possible entry.

For A, the new columns are u, v+w, u+v, where the old columns are u=(1, 1, 1), v=(x, y, z), w=(x², y², z²). Expanding in columns leaves only det(u, w, v), because every other term repeats u or v. One swap of v and w changes the determinant sign. B merely adds column 1 to columns 2 and 3. C replaces row1 by r1−r2 and row2 by r2−r3, with row3 retained; D uses r1+r2, r2+r3, r3. The respective row-transformation matrices for C and D are triangular with diagonal 1, so both preserve Δ. A is the failed general identity, although −Δ=Δ at singular instances.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Eight-bit signed minimum

Number Systems & Computer Arithmetic

Question 4, GATE 2013: What is the smallest integer representable by an 8-bit two’s-complement number? A−256, B−128, C−127, D0.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

An8-bit two’s-complement integer has range−27 through 27−1, hence minimum−128, B.

The leftmost bit has weight−128 and the remaining seven bits have positive weights 64, 32, 16, 8, 4, 2, 1. To minimize the represented integer, set the negative-weight bit to 1 and all positive-weight bits to 0:10000000 represents−128. The opposite endpoint 01111111 represents 127. Unlike sign-magnitude, two’s complement has one more negative value than positive nonzero values, which explains why−127 is not the minimum.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Priority encoder truth table

Combinational Circuits

Question 5, GATE 2013: A circuit has inputs D0, D1, D2, D3 and outputs X0, X1, V. For0000 it outputs don’t-care, don’t-care, 0; for 1000 it outputs 0, 0, 1; for x100 it outputs 0, 1, 1; for xx10 it outputs 1, 0, 1; for xxx1 it outputs 1, 1, 1 (input order D0, D1, D2, D3). Identify A priority encoder; B decoder; C multiplexer; D demultiplexer.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

The table outputs the binary index of the highest asserted input, with D3 taking priority over D2, then D1 and D0. Its validity bit distinguishes no active input from input D0. Thus it is a priority encoder, A.

Read the table from highest priority downward. If D3=1, the other inputs are irrelevant and the code is 11. Otherwise D2=1 selects 10; otherwise D1=1 selects 01; otherwise D0=1 selects 00. This is encoding the index of the highest asserted request. A decoder expands a binary code to selected outputs, the reverse direction. A multiplexer selects a data input using separate select lines, not this priority rule. The validity bit is needed because code 00 otherwise cannot distinguish “D0 asserted” from “no input asserted.”

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Selection-sort swap count

Searching, Sorting & Selection

Question 6, GATE 2013: Give the tightest listed upper bound on selection-sort swaps for n numbers: A O(log n), B O(n), C O(n log n), D O(n²).
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Each selection-sort pass finds the minimum of the unsorted suffix and moves it using at most one swap. There are n−1 passes, and worst-case inputs require a linear number of swaps. Hence O(n), B; the quadratic comparison count does not imply quadratic swaps.

On pass i, selection sort scans the remaining suffix to locate its minimum, then swaps it into position i. It may perform many comparisons during that scan, but at most one swap. There are n−1 such passes, giving at most n−1 swaps. A cyclic displacement input can require a swap on each pass, so the worst-case number grows linearly, not logarithmically. The commonly remembered quadratic selection-sort cost counts comparisons, not swaps.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Worst-case unbalanced BST insertion

Binary Search & Balanced Trees

Question 7, GATE 2013: Give the tightest listed worst-case upper bound for inserting into an ordinary n-node binary search tree: A O(1), B O(log n), C O(n), D O(n log n).
Tap to enlarge
Your answer
Answer & solution

Official answer: C

In an ordinary unbalanced binary search tree, increasing insertions can create a chain of n nodes. Finding the next insertion position then takes a linear search down that chain. Worst-case insertion is O(n), C, not the logarithmic bound of balanced trees.

Insertion follows the search path until it reaches a missing child, then attaches the new node. Its cost is proportional to tree height. A balanced tree has logarithmic height, but no balance requirement is given. Inserting increasing keys creates a right-child chain; a later larger key must inspect all n existing nodes. Thus linear time is possible and O(n) is the tightest listed worst-case bound.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Empty-language concatenation and star

Regular Expressions & Languages

Question 8, GATE 2013: Let L1=∅ and L2={a}. Evaluate L1 L2* ∪ L1*. A{ε}; B∅; C a*; D{ε, a}.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

The concatenation of the empty language with any language is empty. Meanwhile ∅*={ε}. Therefore the displayed union is{ε}, A.

Language concatenation requires one word from each operand. Since L1 contains no word at all, L1 L2* contains none, irrespective of L2*. A Kleene star always includes the concatenation of zero words, namely ε. With an empty base language there are no positive-length concatenations, so L1* contains exactly ε. Taking the union of ∅ with{ε} yields{ε}; do not confuse ∅ with the singleton language containing the empty word.

Original paper, page 3 · Answer key

1 mark · MCQ
Report issue

Reduction-count production terminology

Parsing & Syntax Analysis

Question 9, GATE 2013: A bottom-up parser processes n tokens using a grammar with no epsilon or “unit” productions, expressly described in the source as A→ε and A→a. What is the maximum number of reductions? A n/2; B n−1; C2n−1; D2^n.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Our answer: B under the displayed no-single-symbol-production interpretation

A reduction with a right-hand side of length at least 2 decreases the stack/sentential length by at least 1. Starting with n terminals and ending with one start symbol thus allows at most n−1 such reductions, attained by binary reductions, giving B. However the source calls A→a a unit-production, whereas standard CFG terminology reserves unit-production for A→B with B a nonterminal. If only standard unit rules and epsilon rules are forbidden, terminal rules A→a remain, and a Chomsky-normal-form derivation can require n terminal reductions plus n−1 binary reductions=2n−1. The key therefore relies on the source’s intended ban on length-one reductions, not the usual terminology alone.

Each reduction replaces a right-hand side by one nonterminal. If every permitted right-hand side has at least two symbols, each reduction shrinks the total length by at least one. Reducing n tokens to one start symbol then permits at most n−1 reductions; a binary parse tree attains that many internal combinations. The caveat is not optional: a normal terminal production A→a has length 1 and would add reductions without shortening the string. The printed parenthetical explicitly rules those out, even though it uses nonstandard “unit” terminology.

Original paper, page 3 · Answer key

1 mark · MCQ
Report issue

Waiting-time priority scheduling

CPU Scheduling

Question 10, GATE 2013: All processes arrive at time 0, have no I/O, and start with zero priority. Priority is proportional to accumulated waiting time. Every T time units priorities are reevaluated and the next process is selected. Which policy is equivalent? A FCFS; B round-robin; C shortest-job-first; D shortest-remaining-time-first.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Our answer: B under the usual cyclic tie convention

With all jobs arriving together and no blocking, running a process stops its waiting time from growing while the others continue to accumulate waiting time. At each T-unit reassessment, the previously waiting processes take priority over the one just served. With a fixed fair cyclic resolution of ties this is round-robin with quantum T, B. The statement does not independently specify how equal priorities are ordered, so an exact fixed cyclic order requires that usual tie convention.

For processes that remain ready, elapsed time equals CPU service received plus accumulated waiting time. At a fixed reassessment time, maximizing waiting time is therefore the same as favoring the process that has received the least service. Starting together, the unserved processes outrank the one just given a T-unit slice. With consistent cyclic tie-breaking, each gets a slice before that process gets another, reproducing round-robin. Neither job lengths nor remaining times are consulted, excluding SJF/SRTF. FCFS would let the first job keep running rather than preempt it at each reassessment.

Original paper, page 3 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Service-oriented architecture matching

Web Technologies

Question 11, GATE 2013: Match P service-oriented computing, Q heterogeneous communicating systems, R information representation, S process description to 1 interoperability, 2 BPMN, 3 publish-find-bind, 4 XML. A P1 Q2 R3 S4; B P3 Q4 R2 S1; C P3 Q1 R4 S2; D P4 Q3 R2 S1.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Service-oriented computing uses publish/find/bind interactions, giving P→3. Heterogeneous systems require interoperability, Q→1. Neutral data representation is provided by XML, R→4. Business-process composition corresponds to BPMN, S→2. This mapping is C.

The service workflow publishes a description, lets a client find it, then binds the client to the provider, fixing P→3. Interoperability is the ability of heterogeneous systems to communicate, fixing Q→1. XML is a structured information representation, giving R→4. BPMN explicitly denotes Business Process Model and Notation, giving S→2. Checking these four associations against the complete choices leaves C, not a mapping chosen from only one match.

Original paper, page 3 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Application transport protocols

Transport, Congestion Control & Traffic Shaping

Question 12, GATE 2013: Choose conventional transport protocols for real-time multimedia, file transfer, DNS, email, respectively. A TCP/UDP/UDP/TCP; B UDP/TCP/TCP/UDP; C UDP/TCP/UDP/TCP; D TCP/UDP/TCP/UDP.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

For the actual listed applications, real-time multimedia conventionally uses UDP to avoid retransmission delays; file transfer uses reliable TCP; DNS lookup commonly uses UDP; email transfer uses TCP. The order is UDP, TCP, UDP, TCP, C. DNS can also use TCP and multimedia can use other transports; this is the conventional application mapping, not an exclusive claim about every implementation.

The classification concerns conventional transports, not application-layer names. Multimedia often values timeliness over retransmitting late packets, favoring UDP. File transfer and email need reliable ordered delivery, favoring TCP. Ordinary DNS query/response fits UDP. Therefore the pattern is UDP, TCP, UDP, TCP. The DNS answer is not a claim that DNS never uses TCP: large responses, truncation fallback and zone transfers are familiar exceptions.

Original paper, page 3 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Confidential authenticated public-key message

Network Security

Question 13, GATE 2013: X signs message M, encrypts the message/signature pair for Y, and Y decrypts and verifies. Choose the ordered key sequence. A sender private, recipient private;sender public, recipient public. B sender private, recipient public;sender public, recipient private. C sender public, recipient private;recipient public, sender private. D sender private, recipient public;recipient private, sender public.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

X authenticates by signing with X’s private key and protects confidentiality for Y using Y’s public key. Y decrypts with Y’s private key and verifies the signature with X’s public key. This matches D. Actual signature schemes need not literally encrypt the whole message with the signing key; signing/verification is the appropriate cryptographic interpretation.

Authentication and confidentiality have different key owners. Only X should be able to create X’s signature, so signing uses X’s private key. Anyone may encrypt a message for Y using Y’s public key, but only Y’s private key decrypts it. Since encryption is the outer layer, Y must first remove that layer and only then verify X’s signature with X’s public key. D has that receive-side order; B reverses the two receive operations. Real signatures use a signature algorithm, usually over a digest, rather than literal message encryption.

Original paper, page 3 · Answer key

1 mark · MCQ
Report issue

Layer processing across two routers

Network Layers & Devices

Question 14, GATE 2013: S sends a packet to D via two routers, S–R1–R2–D. Count network-layer and data-link-layer visits, respectively. A4/4; B4/3; C4/6; D2/6.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

The network layer is visited at the source, each of the two routers, and the destination: 4 times. There are three links, and each requires a data-link send and receive, so the data-link layer is visited 6 times. Hence C.

Count at nodes and links separately. Network-layer processing occurs at S, R1, R2, D, once at each. The links are S–R1, R1–R2, R2–D. Each link has a sending data-link action and a receiving data-link action, so three links contribute six visits. A router participates in two data-link interfaces: it receives one frame and constructs/transmits another, while forwarding the enclosed network packet.

Original paper, page 4 · Answer key

1 mark · MCQ
Report issue

Clustered-index definition

Indexing, Storage & Query Processing

Question 15, GATE 2013: An index is clustered if A its fields form a candidate key; B its fields include the primary key; C data records follow the same order as index data entries; D data records do not follow that order.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

A clustered index has its data records physically organized in the same order as the index’s data entries. This is about file ordering, not merely whether the indexed fields form a candidate or primary key. Hence C.

Clustering describes physical locality/order of the records relative to the index ordering. Scanning adjacent index entries can therefore correspond to nearby ordered records. Key uniqueness is a different property: an index can be clustered on a nonunique field, and a primary-key index need not determine the physical record order in every storage design. Thus C states the defining relationship, while A/B confuse clustering with key constraints and D describes the opposite relationship.

Original paper, page 4 · Answer key

1 mark · MCQ
Report issue

Deadlock-free semaphore acquisition

Deadlocks

Question 16, GATE 2013: Binary semaphores a, b, c, d start at 1. X acquires a, b, c; Y acquires b, c, d; Z acquires c, d, a, then each releases its three locks after work. Which acquisition ordering is deadlock-free? A X:abc, Y:bcd, Z:cda; B X:bac, Y:bcd, Z:acd; C X:bac, Y:cbd, Z:acd; D X:abc, Y:cbd, Z:cda.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Option B respects a single global order b<a<c<d in every process: X takes b, a, c; Y takes b, c, d; Z takes a, c, d. A circular wait would require strictly increasing lock ranks around a cycle, which is impossible. The other choices admit contradictory acquisition orders and circular-wait executions. Thus B.

Assign ranks b=1, a=2, c=3, d=4. In B every process acquires strictly increasing ranks, so a process holding one lock can wait only for a higher-ranked lock. A circular chain would require rank to increase all the way back to its starting value, which is impossible. For contrast, A permits X holding a while Z holds c, d and waits for a, with X eventually waiting for c. C permits X holding b and Y holding c, each waiting for the other. D permits X holding a, b and Z holding c, d, with X waiting for c and Z for a. These are concrete circular waits, not merely inconvenient orderings.

Original paper, page 4 · Answer key

1 mark · MCQ
Report issue

Recognizable-language closure

Closure Properties & Language Hierarchy

Question 17, GATE 2013: Which statements are false?1 Every nondeterministic TM has an equivalent deterministic TM.2 Recognizable languages are closed under union and complement.3 Decidable languages are closed under intersection and complement.4 Recognizable languages are closed under union and intersection. A1, 4; B1, 3; C2 only; D3 only.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Nondeterministic Turing machines can be simulated deterministically by dovetailing. Recognizable languages are closed under union and intersection by dovetailing recognizers, but not generally under complement. Decidable languages are closed under intersection and complement. Therefore only statement 2 is false, C.

A deterministic simulator explores a nondeterministic computation tree fairly, preventing an infinite branch from starving an accepting finite branch; this establishes 1. To recognize a union, interleave two recognizers and accept if either accepts. For intersection, interleave and accept after both have accepted, establishing 4. A recognizer may run forever on a rejected input, so simply swapping accept/reject does not recognize its complement; statement 2 is false. A decider always halts, so complementing its result and combining two runs both work, establishing 3.

Original paper, page 4 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Cycle detection and complexity classes

Computational Complexity

Question 18, GATE 2013: Which are true?1 Undirected-cycle detection is in P.2 It is in NP.3 Every NP-complete problem has a nondeterministic polynomial-time algorithm. A1, 2, 3; B1, 2; C2, 3; D1, 3.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Undirected-cycle detection is polynomial via DFS or union-find, so it belongs to P and therefore also NP. By definition an NP-complete decision problem belongs to NP and has a nondeterministic polynomial-time algorithm. All three statements are true, A.

DFS detects an undirected cycle in O(V+E) time by finding an already visited neighbor other than the parent, so the first claim is polynomial. Every deterministic polynomial computation is also an allowed nondeterministic polynomial computation, giving P⊆NP and claim 2. NP-completeness includes membership in NP in its definition, not only NP-hardness, so claim 3 follows. No assumption that P≠NP is needed for any of these conclusions.

Original paper, page 4 · Answer key

1 mark · MCQ
Report issue

Bellman-Ford on a complete graph

Graph Algorithms

Question 19, GATE 2013: What is standard Bellman–Ford complexity on a complete n-vertex graph? AΘ(n²), BΘ(n²log n), CΘ(n³), DΘ(n³log n).
Tap to enlarge
Your answer
Answer & solution

Official answer: C

The standard Bellman-Ford algorithm performs up to n−1 full edge-relaxation passes. A complete graph has Θ(n²) edges, yielding Θ(n³) time, C, for the usual worst-case/full-pass algorithm.

One relaxation pass examines all edges. The standard algorithm allows n−1 passes because a simple shortest path can use up to n−1 edges. A complete directed graph has n(n−1) edges; an undirected one has n(n−1)/2, both Θ(n²). Multiplying by Θ(n) passes gives Θ(n³). Early termination may improve a particular instance, but does not change the stated standard worst-case/full-pass bound.

Original paper, page 5 · Answer key

1 mark · MCQ
Report issue

Set-associative cache line range

Cache Memory

Question 20, GATE 2013: A cache has v sets of k consecutive lines each, sets numbered from 0 in order. Memory block j maps to which line interval? A(j mod v)k through(j mod v)k+k−1; B(j mod v) through(j mod v)+k−1; C(j mod k) through(j mod k)+v−1; D(j mod k)v through(j mod k)v+v−1.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Block j maps to set s=j mod v. Each earlier set occupies k consecutive lines, so this set starts at sk and ends at sk+k−1. Substituting s gives the interval in A.

First choose the set, not a particular way: s=j mod v. There are s earlier sets, each occupying k line positions, so the first line of set s is sk. The k allowed ways occupy offsets 0 through k−1, hence last line sk+k−1. For example, v=4, k=2, j=6 gives s=2 and lines 4, 5. This example also shows why omitting the factor k, as in B, gives the wrong physical positions.

Original paper, page 5 · Answer key

1 mark · MCQ
Report issue

XOR and XNOR complements

Boolean Algebra & Logic Gates

Question 21, GATE 2013: Which does not represent XNOR(x, y)? A xy+¬x¬y; B x XOR ¬y; C ¬x XOR y; D ¬x XOR ¬y.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Complementing exactly one XOR input produces XNOR, while complementing both leaves XOR unchanged: x′⊕y′=x⊕y. Also xy+x′y′ is XNOR. Thus only D fails to represent XNOR.

XNOR is 1 exactly on equal inputs 00 and 11. Complementing both XOR operands does not change whether they differ, so ¬x XOR ¬y has the same truth values as x XOR y:0, 1, 1, 0. It therefore disagrees with XNOR on every row. Complementing one input toggles equality versus inequality and produces XNOR. The sum xy+¬x¬y directly lists the two equal-input cases.

Original paper, page 5 · Answer key

1 mark · MCQ
Report issue

Continuity at three

Calculus

Question 22, GATE 2013: Which function is continuous at 3? A f(3)=2, f(x)=x−1 for x>3, f(x)=(x+3)/3 for x<3. B f(3)=4, f(x)=8−x otherwise. C f(x)=x+3 for x≤3 and x−4 for x>3. D f(x)=1/(x³−27) for x≠3, with no value supplied at 3.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

For option A, the left limit is(3+3)/3=2, the right limit is 3−1=2, and f(3)=2. All agree. B has limit 5 but value 4; C has unequal one-sided limits 6 and−1; D is undefined at 3. Hence A.

Continuity at a point needs three things: the function value must exist, both one-sided limits must agree, and their common value must equal the function value. A satisfies all three with value 2. B approaches 5 but assigns 4, a removable discontinuity. C approaches 6 from the left and−1 from the right, a jump. D provides no finite value at 3 and its denominator vanishes there, so it cannot meet the continuity test as given.

Original paper, page 5 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Composite trapezoidal integration

Numerical Methods

Question 23, GATE 2013: For x=0,.3,.6,.9, 1.2, 1.5, 1.8, 2.1, 2.4, 2.7, 3.0, the ordinates are 0,.09,.36,.81, 1.44, 2.25, 3.24, 4.41, 5.76, 7.29, 9.00. Approximate the integral from 0 to 3 using the trapezoidal rule. A8.983, B9.003, C9.017, D9.045.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

The spacing is h=.3. The nine interior ordinates sum to 25.65. The composite trapezoidal estimate is .3[(0+9)/2+25.65]=.3×30.15=9.045, D.

Each interval contributes its width times the average of its two endpoint heights. On adding ten intervals of equal width.3, each interior ordinate is counted twice inside the half-weighted sum, while endpoints appear once. Thus use .3[(f(0)+f(3))/2+Σ interior values]. The interior sum .09+.36+.81+1.44+2.25+3.24+4.41+5.76+7.29 is 25.65, giving 9.045. Although these ordinates equal x², the question asks the trapezoidal estimate, not the exact integral 9.

Original paper, page 5 · Answer key

1 mark · MCQ
Report issue

Expected triangles in a random graph

Probability & Random Variables

Question 24, GATE 2013: An undirected random graph has 8 vertices, with edge probability 1/2 for each vertex pair. Find the expected number of unordered triangles. A1/8, B1, C7, D8. The standard independent-edge model is intended.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Our answer: C under independent-edge model

For each of C(8, 3)=56 vertex triples, its triangle indicator has mean(1/2)3=1/8 under the standard independent-edge random-graph model. By linearity of expectation the expected count is 56/8=7, C. Equal individual edge probabilities alone would not establish independence: choosing either the complete or empty graph with probability 1/2 would instead give mean 28. The usual random-graph model is therefore a necessary convention.

Use one indicator variable for each unordered three-vertex subset, not for each ordered traversal of a triangle. There are 8·7·6/6=56 such subsets. Its three edges must all occur, with probability(1/2)³ under independence. The expected sum is the sum of expectations, so 56/8=7. Distinct triangle indicators can share edges and need not be independent; linearity of expectation does not require their independence. The independence needed is within the three edges of one triangle.

Original paper, page 5 · Answer key

1 mark · MCQ
Report issue

Handshaking lemma for undirected graphs

Graph Theory

Question 25, GATE 2013: For undirected graphs, assess P:the number of odd-degree vertices is even; Q:the sum of all degrees is even. A Ponly; B Qonly; C both; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

The source asks about undirected graphs. Each edge contributes 2 to the sum of vertex degrees, so that sum is 2|E| and even. Reducing the sum modulo 2 shows that the number of odd-degree vertices must also be even. Thus both P and Q hold, C.

Count edge endpoints in two ways. Summing degrees counts each undirected edge once at each end, so Σdeg(v)=2|E| and Q holds. Separate even- and odd-degree vertices. Even degrees contribute 0 modulo 2; each odd degree contributes 1. Since the total is even, the count of odd contributions must be even, proving P. The result also accommodates loops if each loop contributes 2 to degree, though the ordinary simple-graph convention suffices.

Original paper, page 5 · Answer key

2 marks · MCQ
Report issue

Line-graph properties

Graph Theory

Question 26, GATE 2013: The line graph has one vertex per original edge, adjacent when the corresponding edges share an endpoint. Which claims hold universally? P line graph of a cycle is a cycle; Q of a clique is a clique; R of a planar graph is planar; S of a tree is a tree. A Ponly; B P, R; C Ronly; D P, Q, S.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

A cycle’s edges form another cycle in the line graph, so P holds. Q fails for K4: two disjoint original edges become nonadjacent vertices. R fails for the planar star K1, 5, whose line graph is nonplanar K5. S fails for the tree K1, 3, whose line graph is the triangle K3. Therefore only P is universally true, A.

A universal assertion can be refuted with one permitted example. On a cycle each edge meets exactly its predecessor and successor, forming another cycle. In K4, edges 12 and 34 are disjoint, so their line-graph vertices are not adjacent: Q fails. A planar star with five leaves has all five edges meeting the center, so its line graph is K5 and nonplanar: R fails. A three-leaf star is a tree but has line graph K3, a cycle: S fails. Only P survives.

Original paper, page 6 · Answer key

2 marks · MCQ
Report issue

No perfect friend in predicate logic

Propositional & Predicate Logic

Question 27, GATE 2013: Translate “None of my friends are perfect,” with F(x)=friend and P(x)=perfect. A ∃x(F(x)∧¬P(x)); B ∃x(¬F(x)∧P(x)); C ∃x(¬F(x)∧¬P(x)); D ¬∃x(F(x)∧P(x)).
Tap to enlarge
Your answer
Answer & solution

Official answer: D

The statement says there is no object that is both a friend and perfect: ¬∃x(F(x)∧P(x)), option D. Equivalently ∀x(F(x)→¬P(x)). A merely says at least one friend is imperfect and does not rule out another perfect friend. MuPDF rendering was used to verify the existential quantifiers and conjunctions omitted by the Poppler render.

“None” rules out the existence of a perfect friend, which is the negation of an existential conjunction. It does not assert that any friend exists at all. Therefore the statement remains true when the speaker has no friends, whereas A would be false in that case because it requires an imperfect friend to exist. B and C speak about nonfriends and do not constrain perfect friends. D is exactly the desired prohibition, equivalently ∀x(F(x)→¬P(x)).

Original paper, page 6 · Answer key

2 marks · MCQ
Report issue

Interrupt-entry micro-operations

Input/Output, DMA & Interrupts

Question 28, GATE 2013: Micro-operations are MBR←PC; MAR←X; PC←Y; Memory←MBR (write at MAR). Which operation can this implement? A instruction fetch; B operand fetch; C conditional branch; D interrupt-service initiation.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

MBR receives the current PC, MAR selects location X, PC is changed to Y, and the saved PC is written at X. This saves a return address and transfers control to another routine, consistent with interrupt-service initiation, D.

Track the values rather than just the register names. The old PC is copied into MBR before PC is overwritten, so it is preserved. MAR directs the final write to X, saving that old PC in memory. Loading Y into PC redirects execution. Together these actions save a return location and jump to a service routine, consistent with D. An instruction fetch would read memory into an instruction register/buffer rather than store the old PC to memory.

Original paper, page 6 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Last cylinder of a contiguous disk file

Secondary Storage

Question 29, GATE 2013: A disk has 16 surfaces, 16384 cylinders, 512 bytes/sector and the source says 64 sectors per cylinder. A contiguous 42797 KB file begins at<cylinder 1200, surface 9, sector 40>. Find last cylinder: A1281, B1282, C1283, D1284. The answer model interprets64 sectors per surface-track and KB=1024 bytes.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Our answer: D under 64 sectors per track and binary KB

Using the intended geometry, each cylinder has 16×64=1024 sectors and each 512-byte sector is half a KiB. The file occupies 42797×2=85594 sectors. Its starting within-cylinder offset is 9×64+40=616. The last sector is therefore at cylinder 1200+floor((616+85594−1)/1024)=1284, D. The source literally says each cylinder contains 64 sectors, but also supplies a surface coordinate and uses the geometry above in the key. The calculation needs 64 sectors per surface-track, rather than per entire cylinder, and KB=1024 bytes; these are explicit intended interpretations.

Under the intended track geometry, one cylinder contains 16×64=1024 sectors, hence 512 KiB. Convert the file to sectors:42797 KiB×1024/512=85594. The starting surface/sector is offset 9×64+40=616 within cylinder 1200. Numbering the first file sector as offset 0 makes its last sector offset 85593, so the combined last offset is 86209. Divide by 1024:84 full cylinders and remainder 193. Add84 to 1200 to obtain 1284. Subtracting1 before the division prevents an off-by-one error for a file ending on a cylinder boundary.

Original paper, page 6 · Answer key

2 marks · MCQ
Report issue

Inverting heapsort complexity

Searching, Sorting & Selection

Question 30, GATE 2013: How many elements can heapsort sort in Θ(log n) time? AΘ(1), BΘ(√log n), CΘ(log n/log log n), DΘ(log n).
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Let m be the number of elements. Heapsort takes Θ(m log m). Choosing m=Θ(log n/log log n) gives log m=Θ(log log n), so m log m=Θ(log n). Hence C; m=Θ(log n) would require an extra log log n factor.

Use a new variable m for the input length, since n only describes the time budget. Heapsort costs Θ(m log m). Set L=log n. The candidate m=L/log L has log m=log L−log log L=Θ(log L), so m log m=Θ(L). Constant m is too small, and m=√L gives Θ(√L log L)=o(L). Setting m=L instead gives Θ(L log L), which is too large. Thus the inverse scale is log n/log log n.

Original paper, page 6 · Answer key

2 marks · MCQ
Report issue

Returned value of nested loops

Control Flow & Loop Tracing

Question 31, GATE 2013: For integer n, unknown initializes k=0; for i=n/2 through n inclusive, for j=2 while j≤n doubling each time, it adds n/2 to k; finally returns k. Choose growth of returned value: AΘ(n²), BΘ(n²log n), CΘ(n³), DΘ(n³log n). Integer divisions truncate; asymptotics use no-overflow mathematical arithmetic.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

The outer loop runs Θ(n) times and the doubling inner index takes Θ(log n) iterations for each. Each iteration adds a value Θ(n) to the accumulator. Thus the returned value is Θ(n² log n), B. The number of loop-body executions, and hence the usual unit-cost running time, is only Θ(n log n); the question asks for the value returned. This asymptotic calculation uses mathematical integers or assumes no integer overflow, rather than literal fixed-width C behavior for arbitrarily large n.

There are n−floor(n/2)+1 outer iterations. For n≥2 the inner values are 2, 4,…, 2^floor(log2 n), so there are floor(log2 n) inner iterations each time. Each contributes floor(n/2), giving the exact mathematical-integer value [n−floor(n/2)+1]floor(log2 n)floor(n/2). Multiplying these three orders gives Θ(n²log n). A running-time answer would omit the magnitude added per iteration and would be a different question.

Original paper, page 7 · Answer key

2 marks · MCQ
Report issue

Regular and unequal-block languages

Context-Free Grammars & Languages

Question 32, GATE 2013: Let L1={0^p1^q0^r:p, q, r≥0} and L2={0^p1^q0^r:p, q, r≥0, p≠r}. Which is false? A L2 is context-free. B L1∩L2 is context-free. C complement(L2) is recursive. D complement(L1) is context-free but not regular.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

L1=0*1*0* is regular. L2, whose outer zero-block counts differ, is context-free: split into more leading zeros or more trailing zeros and use a pushdown comparison. Since L2⊆L1, their intersection is L2 and context-free. L2 is decidable by finite examination of the block counts (including the possible zero middle block), so its complement is recursive. The complement of regular L1 is regular and consequently context-free. Thus option D, which says this last complement is context-free but not regular, has a false not-regular clause. It is regular and therefore context-free; D is the requested false statement.

For the decisive option D, L1 is represented directly by 0*1*0*, hence is regular. Complement a complete DFA by swapping accepting and nonaccepting states; this proves its complement is regular as well. Being regular implies context-free, but it contradicts the extra words “not regular.” For L2, a pushdown machine can compare the first and final zero blocks when a nonempty middle 1block separates them; the all-zero case can be treated separately. A finite input can also be tested by enumerating its finitely many possible block splits, giving decidability without needing a closed form.

Original paper, page 7 · Answer key

2 marks · MCQ
Report issue

DFA language and equivalent states

Finite Automata

Question 33, GATE 2013: A DFA starts in nonaccepting s; s--1→t and s--0→f. Nonaccepting t loops on 1 and goes to f on 0. Accepting f loops on 0, 1. Which claims are false?1 complement of its language is context-free.2 its language has regex(11*0+0)(0+1)*0*1*.3 this three-state DFA is minimal.4 it accepts every binary string of length≥2. A1, 3; B2, 4; C2, 3; D3, 4.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

The accepting state is reached once a 0 occurs and then loops on both symbols. The language is all binary strings containing at least one 0. Its complement is 1*, hence context-free. The given regular expression describes that same language: its leading component reaches a first 0 and the remaining factors allow arbitrary continuation. The two nonaccepting states have identical future acceptance behavior, so the three-state DFA is not minimal. It does not accept 11. Thus statements 1 and 2 are true and statements 3 and 4 are false. The question asks for the false statements, so the pair 3 and 4 gives option D.

Before the first 0, the machine is in s or t; after the first 0 it stays in accepting f forever. Thus its language is 1*0(0+1)*. The regex’s first factor(11*0+0) is precisely 1*0, and its trailing 0*1* can always be empty, so the expression describes the same language. States s and t accept exactly the same suffixes (those containing a0), hence can be merged. Finally11 is a length 2counterexample to claim 4. Therefore claims 3and4, and only those, are false.

Original paper, page 7 · Answer key

2 marks · MCQ
Report issue

Largest raced shared-variable value

Synchronization & Concurrency

Question 34, GATE 2013: Shared x starts 0. W and X each read x, add1 locally, then store; Y and Z each read x, subtract 2 locally, then store. Each process waits on a counting semaphore initially 2 before reading and signals after storing. Each executes once. Maximum final x: A−2, B−1, C1, D2.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Each increment operation adds 1 to a previously read value, while each decrement subtracts 2. A causal chain of reads and writes contains at most the two increment operations, so no value can exceed 2 starting from 0. This is attainable with semaphore capacity 2: W reads 0 and pauses; Y reads 0 and writes−2; Z reads−2 and writes−4; W then writes 1; X reads 1 and writes 2. The capacity restriction is respected throughout. Thus the largest final value is 2, D.

A write stores a locally computed value based on an earlier read, so updates need not add algebraically to−2. With capacity 2, W can occupy one slot while reading 0; the other slot is reused by Y then Z, producing−2 then−4. W’s delayed write overwrites these with 1. After W leaves, X can read 1 and write 2. For the upper bound, trace a written value backward through the reads it depends on. Each increment process can appear at most once in such a causal chain, so no chain adds more than 2; decrements only decrease it. This proves both attainability and optimality.

Original paper, page 7 · Answer key

2 marks · MCQ
Report issue

Equivalent SQL and relational-calculus queries

Relational Algebra & Calculus

Question 35, GATE 2013: Schemas: Students(rollno, sname), Courses(courseno, cname), Registration(rollno, courseno, percent). Desired result is distinct student names scoring>90 in course 107. I SQL SELECT DISTINCT S.sname FROM Students S, Registration R WHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent>90. II relational projection sname after selecting courseno107 and percent>90 from Registration natural-join Students. III tuple calculus {T:∃S∈Students,∃R∈Registration(S.rollno=R.rollno∧R.courseno=107∧R.percent>90∧T.sname=S.sname)}. IV domain calculus {<SN>:∃SR∃RP(<SR, SN>∈Students∧<SR, 107, RP>∈Registration∧RP>90)}. Which equivalent queries? A all four; B I, II, III; C I, II, IV; D II, III, IV.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Each expression joins a student to a registration on roll number, requires course 107 and percent>90, and returns the student name. SQL DISTINCT and set-valued relational algebra/calculi remove duplicate names. Hence all four are equivalent, A, with the tuple-calculus output T understood to have the displayed single sname attribute.

All four forms bind the same join witness: a student row and a registration row with equal rollno, course 107 and percent greater than 90. SQL DISTINCT removes duplicate names; relational projection and calculus use set semantics. The Courses table is not needed because filtering uses its numeric course identifier, not its name. In IV, SR is the shared roll number, SN is the returned name, and RP is the qualifying percentage. In III, the result tuple is understood to have just the sname attribute, matching the projected result schema.

Original paper, page 8 · Answer key

2 marks · MCQ
Report issue

Ethernet collision-detection cable length

Medium Access & Ethernet

Question 36, GATE 2013: Ethernet data rate 500 Mbps, frame length 10000 bits, propagation speed 200000 km/s. Ignoring other delays, maximum cable length for collision detection: A1, B2, C2.5, D5 km.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Frame transmission time=10000/(500×106)=20μs. Collision detection requires the round-trip propagation time not to exceed this, so one-way delay≤10μs. At200000 km/s the maximum length is 2 km, B, neglecting other delays as in the question.

A transmitter must still be sending when a collision signal from the far end could return. A frame occupies 10000/(500×106)=20×10−6 seconds on the wire. Therefore the round trip 2L/v must be at most 20 microseconds. Solving L≤v·10 microseconds with v=200000 km/s gives 2 km. Using one-way propagation alone would incorrectly double the allowed length. This ideal collision-domain calculation excludes repeater and transceiver delays.

Original paper, page 8 · Answer key

2 marks · MCQ
Report issue

IPv4 last-fragment byte range

IP Addressing, Fragmentation & Address Resolution

Question 37, GATE 2013: IPv4 has MF=0, HLEN=10, total length 400 bytes and fragment offset 300. Choose position and first/last payload byte indexes. A last, 2400, 2789; B first, 2400, 2759; C last, 2400, 2759; D middle, 300, 689.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (4 steps)

MF=0 indicates the last fragment; its positive offset shows it is not the sole initial fragment. The first payload byte has zero-based index 300×8=2400. HLEN10 means 40 header bytes, leaving 400−40=360 payload bytes. The last byte index is 2400+360−1=2759. Therefore C.

The fragment offset unit is 8 bytes, not 1byte, so offset 300 starts at original payload byte2400. HLEN counts 32-bit words:10 words=40 bytes of header. Subtracting that from total length 400 leaves 360payload bytes. Inclusive indexing makes the final byte2400+359=2759. MF=0 says no more fragments follow; because the offset is nonzero, this is a final fragment rather than a complete unfragmented datagram beginning at 0.

Original paper, page 8 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Moving a method between modules

Software Engineering

Question 38, GATE 2013: Two access-graph modules each have 4attribute nodes. M1 has 4 methods and M2 has 3; each method accesses 2 attributes of its own module. Method m in M1 additionally accesses 2 attributes in M2. Move m to M2, keeping attributes fixed. Under access-density cohesion and cross-module access coupling, what changes? A neither; B cohesion rises, coupling falls; C both fall; D both rise. Filled circles in the source are methods, unfilled circles attributes.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

The diagram shows m accessing two attributes in its own module and two in the other. Moving m exchanges two internal accesses for two external ones in each direction, so the number of cross-module accesses remains 2. Every method accesses two of the four attributes of its current module; internal access densities stay 8/16=.5 and 6/12=.5 before the move, then 6/12=.5 and 8/16=.5 after. Thus average cohesion and coupling are unchanged under this access-based measure, A.

Before moving m, internal accesses total 4×2=8in M1 and 3×2=6in M2; possible method-attribute pairs are 4×4=16and3×4=12. Both densities are 1/2. After moving m, the method counts exchange, so the two densities remain 6/12and8/16. The two accesses from m to M2 become internal, but its two accesses to its old M1 attributes become external. Thus cross-module accesses stay 2. The conclusion is tied to this access-graph measure, rather than every possible software cohesion metric.

Original paper, page 8 · Answer key

2 marks · MCQ
Report issue

Binary-semaphore producer-consumer rendezvous

Synchronization & Concurrency

Question 39, GATE 2013: Producer X computes a[i]=f(i), then ExitX; consumer Y calls EntryY, then computes b[i]=g(a[i]), for i=0,…, n−1. Binary semaphores R, S initially 0. Which implementation synchronizes them? A Exit=P(R), V(S);Entry=P(S), V(R). B Exit=V(R), V(S);Entry=P(R), P(S). C Exit=P(S), V(R);Entry=V(S), P(R). D Exit=V(R), P(S);Entry=V(S), P(R).
Tap to enlarge
Your answer
Answer & solution

Official answer: C

In C, the consumer first signals S to indicate readiness, then waits on R; the producer waits on S before signaling R after its item has been computed. The consumer reads the item only after that R handshake. Since the next S is not issued until the preceding consumer iteration finishes, signals cannot outrun the corresponding item and collapse in a binary semaphore. A deadlocks immediately because both sides initially wait on zero semaphores. B lacks a readiness handshake, so multiple signals can collapse. In D, the producer can signal R for the next item before the consumer consumes the preceding R, again collapsing signals. Thus C provides the required synchronization.

A binary semaphore stores only whether a signal is pending, not an unbounded count. The consumer’s V(S) in C grants permission for one producer notification, then its P(R) waits for the corresponding completed a[i]. The producer cannot notify the next item without another S grant, which the consumer issues only in its next iteration. This prevents two notifications collapsing into one. In D, after the first readiness signal the producer can release R twice before the consumer takes R even once, losing a notification and potentially blocking a later consumer iteration.

Original paper, page 9 · Answer key

2 marks · MCQ
Report issue

Merging LR items for LALR parsing

Parsing & Syntax Analysis

Question 40, GATE 2013: Two LR(1) states have items X→c·X, X→·cX, X→·d; first has lookaheads c/d on all, second $. About merging them into LALR, which claims are false?1 cannot merge because lookaheads differ;2 merging creates shift/reduce conflict;3 merging creates reduce/reduce conflict;4 cannot merge because goto on c leads to different states. A1 only, B2 only, C1and4, Dallfour.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

The two LR(1) states have the same LR(0) core, so LALR construction merges them and unions the lookahead sets for each core item. Every displayed item still has symbols to the right of the dot. Consequently this merged state has no reduction action and can create neither a shift/reduce nor a reduce/reduce conflict there. Its equal-core goto states are likewise merged in the LALR construction. Each of the four asserted objections is false, so D.

LALR equivalence compares items after removing lookaheads, and the two displayed sets then match exactly. Unioning lookaheads gives{c, d,$} for each item. Shift actions depend on the symbol after the dot; none of these items has its dot at the end, so there is no reduce action to conflict with a shift or another reduction. Goto targets with equal cores are treated by the same merging rule. Different lookaheads and different original state numbers are not reasons to reject the merge.

Original paper, page 9 · Answer key

2 marks · MCQ
Report issue

Decidable and undecidable language properties

Decidability & Computability

Question 41, GATE 2013: Which problems are undecidable?1 CFG emptiness L(G)=∅;2 CFG universality L(G)=Σ*;3 regularity of the language of a TM;4 equality of a DFA language with an NFA language. A3 only; B3, 4; C1, 2, 3; D2, 3.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Statement 1 is decidable: repeatedly mark CFG variables that can derive terminal strings; L(G) is nonempty exactly when the start variable becomes marked. Statement 2, universality of a general CFG (whether L(G)=Σ*), is undecidable. Statement 3 is undecidable by Rice’s theorem: regularity is a nontrivial property of the language recognized by a Turing machine, since some recognizable languages are regular and some are not. Statement 4 is decidable: determinize the NFA, form the product automaton for the symmetric difference with the DFA, and test whether any accepting product state is reachable. Thus only 2 and 3 are undecidable, option D.

Separate finite-state and general-machine questions. DFA/NFA equivalence remains decidable even if determinization is exponentially expensive: decidability requires termination, not efficiency. CFG emptiness is a finite fixed-point computation over its nonterminals. In contrast, general CFG universality is a standard undecidable property. TM language regularity is semantic and nontrivial, so Rice’s theorem applies; regular and nonregular recognizable languages both exist. These distinctions leave exactly 2and3.

Original paper, page 9 · Answer key

2 marks · MCQ
Report issue

Reference parameter and multiplication evaluation order

Runtime Environments & Parameter Passing

Question 42, GATE 2013: p starts 5. The function uses reference parameter x and value parameter c: int f(int &x, int c){c=c−1;if(c==0)return1;x=x+1;return f(x, c)*x;} What does f(p, p) return? A3024, B6561, C55440, D161051. The published key awards Marks to All; source does not specify operand evaluation order.
Tap to enlarge
Your answer
Answer & solution

Official answer: Marks to All

Our answer: No uniquely specified value; 3024 (A) and 6561 (B) arise from different operand orders.

The parameter declaration int &x is C++ reference syntax, not valid C. Every recursive invocation aliases the same p through x, whereas c is a private by-value copy. The four non-base calls increment p successively to 6, 7, 8 and 9; the fifth call returns 1 without incrementing p. In return f(x, c) * x, multiplication does not require the left operand to be evaluated first. If each call reads its right-hand x before executing the recursive call, the stored factors are 6, 7, 8, 9 and the return value is 6×7×8×9=3024 (A). If each call executes the recursive call before reading its right-hand x, all four factors are the final p=9 and the result is 9^4=6561 (B). Mixed choices can give other values. Under C++ rules sequencing a function’s execution as a unit relative to otherwise unsequenced outside evaluations, this is an unspecified operand-order issue; the recursive function call must not be confused with an unsequenced x++ written directly beside a read of x. The source does not prescribe an evaluation convention or a language version, so no unique numerical option follows. The official Code A key explicitly awards Marks to All. This record is classified under compiler parameter-passing/evaluation semantics, not as a valid C program.

Make the parameter environments explicit: each call has its own c, but every x refers to the same external p. The nonbase frames correspond to c after decrement 4, 3, 2, 1. Each increments p once, so p becomes 9 at the base return. A frame can fetch its multiplication operand before recursion, preserving its current 6, 7, 8or9, or fetch after recursion, seeing9. Thus a single deterministic answer requires an evaluation-order convention absent from the prompt. The official MTA must remain an adjudication label, not be replaced by whichever value one compiler happens to print.

Original paper, page 10 · Answer key

2 marks · MCQ
Report issue

Recover BST postorder from preorder

Binary Search & Balanced Trees

Question 43, GATE 2013: A BST has preorder 30, 20, 10, 15, 25, 23, 39, 35, 42. Choose postorder: A10, 20, 15, 23, 25, 35, 42, 39, 30; B15, 10, 25, 23, 20, 42, 35, 39, 30; C15, 20, 10, 23, 25, 42, 35, 39, 30; D15, 10, 23, 25, 20, 35, 42, 39, 30.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Step through it (21 steps)

The root is 30. Its preorder left-subtree segment is 20, 10, 15, 25, 23 and its right-subtree segment is 39, 35, 42. Under 20, node 10 has right child 15, and node 25 has left child 23; their postorders are 15, 10 and 23, 25, giving the full left-subtree postorder 15, 10, 23, 25, 20. Under 39 are children 35 and 42, so its postorder is 35, 42, 39. Appending the root gives 15, 10, 23, 25, 20, 35, 42, 39, 30, option D.

Preorder identifies each subtree’s root first. Split the remaining values around 30: values below 30 form the left subtree and above 30 the right. Repeat around 20 and 39. Postorder reverses the placement of each root in the traversal: recursively emit its left subtree, then right subtree, then the root. This yields left block 15, 10, 23, 25, 20 and right block 35, 42, 39, followed by 30. Checking only that 30 is last is insufficient; every nested subtree must satisfy the same rule.

Original paper, page 10 · Answer key

2 marks · MCQ
Report issue

Amortized cost of MultiDequeue

Asymptotic Analysis & Recurrences

Question 44, GATE 2013: Besides constant-time Enqueue/Dequeue, MultiDequeue sets m=k and repeatedly dequeues while the queue is nonempty and m>0, decrementing m. Starting with an empty queue, find worst-case total time for n top-level operations: AΘ(n), BΘ(n+k), CΘ(nk), DΘ(n²).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Let E be the number of Enqueue operations among the n top-level operations. Starting from an empty queue, at most E elements can be removed in total, whether by individual Dequeue calls or inside MultiDequeue. Therefore all successful inner-loop iterations together cost O(E)⊆O(n), not O(nk). Each top-level call and each terminating loop check contribute O(1), adding O(n). Conversely, n calls incur Ω(n) total overhead, and n Enqueue calls witness that bound. The worst-case total is Θ(n), option A, assuming constant-time primitive queue operations and constant-time arithmetic on the counter.

Charge every actual deletion to the earlier insertion that supplied that element. Since an element cannot be deleted twice without being inserted again, the total number of successful dequeues is no larger than the number of Enqueue operations, at most n. MultiDequeue also performs one final failing guard check, but there are at most n top-level calls to pay for those checks. This accounting bounds the complete sequence by a constant times n regardless of k. Multiplying the worst cost of one call by n would ignore the initially empty queue and double-count available elements.

Original paper, page 10 · Answer key

2 marks · MCQ
Report issue

Taken branch in a five-stage pipeline

Pipelining & Hazards

Question 45, GATE 2013: Five pipeline stages FI, DI, FO, EI, WO take 5, 7, 10, 8, 6 ns, with 1 ns buffer delay. Program I1… I12 has only branch I4, taken to I9. Without branch prediction, under end-of-EI resolution, time to complete is A132, B165, C176, D328 ns.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

The pipeline clock period is max(5, 7, 10, 8, 6)+1=11 ns. Because I4 branches to I9, the useful executed instructions are I1, I2, I3, I4, I9, I10, I11, I12: eight instructions. Using the standard model in which the branch is resolved at the end of EI, I4 occupies FI in cycle 4, DI in cycle 5, FO in cycle 6 and EI in cycle 7. Without prediction, target fetch starts in cycle 8. Then I9 finishes WO in cycle 12 and I12 finishes WO in cycle 15. Equivalently, eight useful instructions need 8+5−1=12 cycles without a control hazard, plus three branch-wait cycles. The total is 15×11=165 ns, option B. The answer relies on branch resolution in EI and target fetch in the following cycle; the prompt does not separately specify an earlier branch-resolution mechanism.

A common clock must accommodate the slowest stage plus its buffer:10+1=11 ns. Branch I4 enters EI in cycle 7, after FI4, DI5, FO6. Its target can enter FI in cycle 8, then DI9, FO10, EI11, WO12. The next target-path instructions finish in cycles 13, 14, 15. Thus the total is 165 ns. Counting all 12 source instructions would incorrectly include the skipped I5–I8. The branch resolution convention is stated because a different resolution stage would change the stall count.

Original paper, page 10 · Answer key

2 marks · MCQ
Report issue

Decoder hierarchy for a 16K by 16 memory

Memory Organization & Address Translation

Question 46, GATE 2013: Build16K×16 RAM from 1K×8 chips. How many 2-to-4 decoders with enable are needed? A4, B5, C6, D7.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Two 1K×8 chips operate in parallel to supply each 16-bit word, making one 1K×16 bank. Sixteen such banks give 16K×16, so there are 32 memory chips but only 16 bank-select signals. The low ten address bits select a word within a bank; the upper four bits select the bank. Construct the required 4-to-16 decoding with one 2-to-4 decoder on the upper two bank bits. Its four outputs enable four further 2-to-4 decoders, each decoding the lower two bank bits. The total is 1+4=5 decoders, option B. Four bottom-level decoders are needed to provide sixteen outputs and an additional level is needed to select their enables.

Separate width expansion from depth expansion. Pairing two 8-bit chips gives 16 data bits at one address; it does not double the number of addresses. Sixteen such pairs are needed for 16Kdepth. A4-bit bank number chooses one pair, while 10low address bits are broadcast to all chips. A top decoder selects one group of four pairs, and four enabled bottom decoders select within each group. This produces 16mutually exclusive bank enables with five decoders; it is not one decoder per memory chip.

Original paper, page 10 · Answer key

2 marks · MCQ
Report issue

Nonunique logical-nonequivalence choice

Propositional & Predicate Logic

Question 47, GATE 2013: Which option is NOT equivalent to ¬∃x[(∀y α)∧(∀z β)]? A∀x[(∃z¬β)→∀yα]; B∀x[(∀zβ)→∃y¬α]; C∀x[(∀yα)→∃z¬β]; D∀x[(∃y¬α)→∃z¬β]. The single-choice source has official Marks to All.
Tap to enlarge
Your answer
Answer & solution

Official answer: Marks to All

Our answer: Both A and D are not equivalent.

For each x, write P(x)=∀y α and Q(x)=∀z β. Quantifier negation and De Morgan’s law turn the target ¬∃x(P∧Q) into ∀x(¬P∨¬Q). Option B is ∀x(Q→¬P), and option C is ∀x(P→¬Q); both simplify to that target. Option A is ∀x(¬Q→P)=∀x(Q∨P), while option D is ∀x(¬P→¬Q)=∀x(P∨¬Q). Neither is equivalent to the target. For an explicit countermodel, use a nonempty singleton domain and let α and β both be true: the target is false, but A and D are both true. Hence the single-choice request has two qualifying options, A and D. The official Code A key resolves scoring as Marks to All; it does not select one letter.

Using P=∀yα and Q=∀zβ, the target is universally ¬P∨¬Q. Implication U→V means ¬U∨V. Therefore B becomes¬Q∨¬P and C becomes¬P∨¬Q, both correct equivalents. A instead becomes Q∨P, and D becomes P∨¬Q. At P=Q=true, both AandDare true while the target is false. This is a direct two-option counterexample to a single-choice “NOT equivalent” question, explaining why MTA rather than a repaired single letter is retained.

Original paper, page 10 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Minimum register spills with code motion

Code Generation & Register Allocation

Question 48, GATE 2013: Register-only processor allows at most 2 source operands and 1destination. Code: c=a+b;d=c*a;e=c+a;x=c*c;if(x>a){y=a*a;}else{d=d*d;e=e*e;}. All variables dead after segment. With only 2 registers and code motion as the only optimization, minimum spills to memory: A0, B1, C2, D3.
Question 48, GATE 2013: Register-only processor allows at most 2 source operands and 1destination. Code: c=a+b;d=c*a;e=c+a;x=c*c;if(x>a){y=a*a;}else{d=d*d;e=e*e;}. All variables dead after segment. With only 2 registers and code motion as the only optimization, minimum spills to memory: A0, B1, C2, D3.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

One spill store suffices. With registers R1, R2, start with a in R1 and b in R2. Compute R2←R1+R2 (c), store c once in spill slot S, and compute R2←R2×R2 (x). Compare R2 with R1. On the true branch compute y as R1←R1×R1. On the false branch execute: load R2←S; R2←R2×R1 (d); R2←R2×R2 (d²); load R2←S; R2←R2+R1 (e); R2←R2×R2 (e²). The computations d=c*a and e=c+a have been sunk into the false branch, where they are used, and arranged just before their respective squarings. Their former values are unused on the true branch, and all variables are dead after the segment, so this code motion preserves the required values. It performs one spill store and two reloads on the false path; reloads are not additional spills to memory. For the lower bound, after forming c the independent live values a and c already occupy both registers. Before the branch can be decided, at least one of d=c*a, e=c+a or x=c*c must be computed. If d or e is first, its result is needed for its later square while both a and c remain necessary for the other operations. If x is first, x and a are needed for the test while c is still needed on the false path. Thus the first such result forces three simultaneously needed values in a no-spill schedule, regardless of permitted reordering. A live value must be saved. Since recomputation and dead-code elimination are not allowed, zero spills is impossible and the minimum is one, option B.

The spill count in this question counts stores of live register values to memory. It does not count initial operand loads or each subsequent reload as another spill. The construction saves c once, reuses its register for x, then reloads c separately for the two false-branch calculations. Its one-store bound and the three-live-values argument together establish an exact minimum, not just an example. If arbitrary recomputation or elimination of dead code were allowed, the optimization problem would change, which is why the stated restriction matters.

Original paper, page 11 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Minimum registers without code motion

Code Generation & Register Allocation

Question 49, GATE 2013: For the same code c=a+b;d=c*a;e=c+a;x=c*c;if(x>a)y=a*a;else{d=d*d;e=e*e;}, all variables dead afterward. With original statement order and only register-allocation optimization, how many registers avoid spills? A3, B4, C5, D6.
Question 49, GATE 2013: For the same code c=a+b;d=c*a;e=c+a;x=c*c;if(x>a)y=a*a;else{d=d*d;e=e*e;}, all variables dead afterward. With original statement order and only register-allocation optimization, how many registers avoid spills? A3, B4, C5, D6.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Retain the printed statement order. Immediately after e=c+a and before x=c*c, a is live for the comparison and true branch, c is live for x, and d, e are live for their possible false-branch squarings. Thus {a, c, d, e} is a four-value live set, giving a lower bound of four registers. Four also suffice: R1 holds a throughout the straight-line part; R2 starts as b, is overwritten by c=a+b, then is overwritten by x=c*c once c has had its last use; R3 holds d=c*a and R4 holds e=c+a. The comparison uses R2 and R1. On the true branch, y=a*a can overwrite R1. On the false branch, d² and e² overwrite R3 and R4 respectively. No extra destination register is needed because destinations may alias source registers. Hence the exact minimum is four, option B.

Liveness asks whether a computed value will still be needed on some future path. Before x is computed, a is required for comparison, c for the square, and d/e for the possible false branch. Even though only one branch eventually executes, register allocation cannot discard d/e before the condition is known under the fixed order. Four live values therefore impose four registers. At the next step c has its final use, so x can overwrite its register and no fifth register is needed.

Original paper, page 11 · Answer key

2 marks · MCQ
Report issue

Which replacement maps expose cascading substitutions

Arrays & Strings

Question 50, GATE 2013: Code loops i=0…4 then j=0…2, and if A[i]==oldc[j] immediately sets A[i]=newc[j], without breaking. Maps are 1 abc→dab;2 cde→bcd;3 bca→cda;4 abc→bac. Testing every 5-character input from{a, b, c, d, e}, how many maps expose its replacement flaw? A1, B2, C3, D4.
Question 50, GATE 2013: Code loops i=0…4 then j=0…2, and if A[i]==oldc[j] immediately sets A[i]=newc[j], without breaking. Maps are 1 abc→dab;2 cde→bcd;3 bca→cda;4 abc→bac. Testing every 5-character input from{a, b, c, d, e}, how many maps expose its replacement flaw? A1, B2, C3, D4.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

The defect is that the inner loop continues after a match, so a replacement character can match a later oldc entry and be replaced again. In case 1 (abc→dab), a becomes d, b becomes a after the a-entry has already been passed, and c becomes b after the b-entry has been passed. No input character cascades. In case 2 (cde→bcd), each replacement is absent from the remaining suffix of oldc, so again no character cascades. In case 3 (bca→cda), an original b first becomes c and then becomes d; the intended one-step result is c. In case 4 (abc→bac), an original a first becomes b and then becomes a; the intended result is b. Exhaustive length-five input testing includes strings containing b and a, respectively, so exactly cases 3 and 4 can reveal the flaw. That is two cases, option B. The five-character array need not be NUL-terminated because the code accesses exactly its five given elements.

The intended specification performs one replacement based on the original character, whereas the code repeatedly tests the updated character. For each map, inspect whether a replacement equals an oldc entry at a later j. Only later entries matter: a match with an earlier entry is never revisited. Map3 has b→c with c later, and map 4 has a→b with b later. Maps 1and2 only map backward or outside the remaining entries, so no repeated substitution can occur. Exhaustive input testing guarantees witnesses containing the affected characters.

Original paper, page 11 · Answer key

2 marks · MCQ
Report issue

Replacement-map failures on abcde

Arrays & Strings

Question 51, GATE 2013: Use the same nested replacement loops and four maps 1 abc→dab;2 cde→bcd;3 bca→cda;4 abc→bac. For input abcde specifically, which expose the flaw? A none; B2 only; C3and4; D4 only.
Question 51, GATE 2013: Use the same nested replacement loops and four maps 1 abc→dab;2 cde→bcd;3 bca→cda;4 abc→bac. For input abcde specifically, which expose the flaw? A none; B2 only; C3and4; D4 only.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Apply each map once to each original character to obtain the intended result, then compare with the procedure’s sequential replacements. For input abcde, case 1 has intended and actual output dabde. Case 2 has intended and actual output abbcd. Case 3 should produce acdde, but its b is changed twice, b→c→d, producing addde. Case 4 should produce bacde, but its initial a is changed twice, a→b→a, producing aacde. Therefore cases 3 and 4 expose the defect, option C.

The fixed input contains every candidate letter once, including both b and a that trigger the two flaws. In map 3 the intended b→c is followed by an unintended c→d, changing the second character from expected c to d. In map 4 the intended a→b is followed by unintended b→a, undoing that substitution. Comparing complete strings confirms the discrepancy rather than relying merely on the presence of an intermediate match. Cases 1and2remain unaffected.

Original paper, page 11 · Answer key

2 marks · MCQ
Report issue

Page size in a three-level page table

Virtual Memory & Paging

Question 52, GATE 2013: A46-bit virtual/32-bit physical address machine uses 3-level paging. T1 fits exactly one page; T1 entries point to page-sized T2 blocks; T2 entries point to page-sized T3 blocks of 32-bit PTEs. Under32-bit table entries throughout, page size: A2, B4, C8, D16 KB. Shared data:1MB16-way virtually indexed physically tagged cache, 64-byte block.
Question 52, GATE 2013: A46-bit virtual/32-bit physical address machine uses 3-level paging. T1 fits exactly one page; T1 entries point to page-sized T2 blocks; T2 entries point to page-sized T3 blocks of 32-bit PTEs. Under32-bit table entries throughout, page size: A2, B4, C8, D16 KB. Shared data:1MB16-way virtually indexed physically tagged cache, 64-byte block.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Let each page contain 2p bytes. Under the standard fixed-width organization, a 32-bit PTE or physical-address entry occupies four bytes, so each page-sized table contains 2p−2 entries and each of the three levels uses p−2 index bits. The page offset uses p bits. Covering the 46-bit virtual address therefore gives 3(p−2)+p=46, hence 4p=52 and p=13. The page size is 213 bytes=8 KiB, labeled 8 KB in the options, so C. This uses 32-bit entries at the upper levels as well as the stated 32-bit leaf PTE, page-sized table blocks, full address-space coverage, and the usual binary KB convention.

A page of 2^pbytes contains 2p/4=2p−2table entries when each occupies 4 bytes. Hence each level contributes p−2 index bits and the final byte offset contributes pbits. With three levels, the address budget is(p−2)+(p−2)+(p−2)+p=46. Solving gives p=13and8192 bytes. The result is conditional on the usual fixed-width pointer entries at upper levels; the problem explicitly gives the leaf PTE size and implies that conventional organization.

Original paper, page 12 · Answer key

2 marks · MCQ
Report issue

VIPT synonym avoidance by page colouring

Cache Memory

Question 53, GATE 2013: Using the preceding page size and 1MB16-way VIPT cache with 64-byte blocks, how many page colours prevent synonyms mapping to different sets? A2, B4, C8, D16.
Question 53, GATE 2013: Using the preceding page size and 1MB16-way VIPT cache with 64-byte blocks, how many page colours prevent synonyms mapping to different sets? A2, B4, C8, D16.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

There are 220/(16×64)=210 cache sets. A 64-byte cache block uses six offset bits, so the ten set-index bits are virtual-address bits 6 through 15. From the preceding linked question, the page size is 8 KiB and the page offset consists of bits 0 through 12. Only seven set-index bits (6 through 12) lie inside the page offset and are automatically identical for synonyms. The remaining three bits (13 through 15) can differ between virtual aliases of the same physical page. Distinguishing 23=8 page colours, and requiring aliases of a physical page to use the same colour, makes all index bits agree. Thus eight colours are necessary and sufficient, option C. Equivalently, colours=(cache size)/(associativity×page size)=1 MiB/(16×8 KiB)=8.

Synonyms share a physical page but can have different virtual page numbers. A VIPT lookup uses virtual index bits before the physical tag is known; if any such bit is outside the page offset, aliases can select different sets. Here10 index bits follow 6block-offset bits, ending at bit15. Only bits 0–12belong to the 8KiBpage offset, leaving three potentially different index bits. Colouring controls exactly those three bits, requiring eight choices. More tag bits do not repair selection of the wrong set.

Original paper, page 12 · Answer key

2 marks · MCQ
Report issue

Candidate keys from the functional dependencies

Functional Dependencies & Keys

Question 54, GATE 2013: R(A, B, C, D, E, F, G, H) has atomic fields and exactly FD closure generated by CH→G, A→BC, B→CFH, E→A, F→EG. Number of candidate keys: A3, B4, C5, D6.
Question 54, GATE 2013: R(A, B, C, D, E, F, G, H) has atomic fields and exactly FD closure generated by CH→G, A→BC, B→CFH, E→A, F→EG. Number of candidate keys: A3, B4, C5, D6.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (8 steps)

D never occurs on any right-hand side, so every key must contain D. The dependencies A→B, B→F, F→E and E→A form a reachability cycle among A, B, E, F. Starting from any one of those four attributes derives the other three, C and H through B→CFH, and G through F→EG. Consequently A+, B+, E+, F+ each equal {A, B, C, E, F, G, H}, missing only D. Thus AD, BD, DE and DF are candidate keys, and each is minimal. For completeness, any set containing none of A, B, E, F can include only C, D, G, H; its closure can at most add G via CH→G and can never reach that four-attribute cycle. Therefore every key includes at least one of A, B, E, F, and a minimal key includes exactly one together with D. There are precisely four candidate keys, option B.

Compute closures to establish keys and then prove the list exhaustive. D cannot be derived because it never appears on an FD right side, so it must be supplied. Any one of A, B, E, F reaches all the other members of that cycle and then C, H, G. Supplying D alongside one therefore determines all eight attributes. With none of A, B, E, F, the remaining C, D, G, Hcannot generate an entry point into the cycle. Consequently a minimal key consists of Dplus exactly one cycle member: four possibilities.

Original paper, page 12 · Answer key

2 marks · MCQ
Report issue

Highest normal form with a partial dependency

Normalization & Decomposition

Question 55, GATE 2013: For the same relation and FDs CH→G, A→BC, B→CFH, E→A, F→EG, classify normal form: A1NFnot2NF; B2NFnot3NF; C3NFnotBCNF; DBCNF.
Question 55, GATE 2013: For the same relation and FDs CH→G, A→BC, B→CFH, E→A, F→EG, classify normal form: A1NFnot2NF; B2NFnot3NF; C3NFnotBCNF; DBCNF.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (10 steps)

Atomic fields give 1NF. The candidate keys are AD, BD, DE, DF, so the prime attributes are A, B, D, E, F and the non-prime attributes are C, G, H. From the given dependency A→BC we obtain A→C. Here A is a proper subset of the candidate key AD and C is non-prime, so C has a partial dependency on a candidate key. This violates 2NF. Therefore the relation is in 1NF but not 2NF, option A; no higher-normal-form analysis is needed.

Second normal form forbids a nonprime attribute from depending on a proper subset of any candidate key. AD is a candidate key and C is nonprime, but Aalone determines C through A→BC. This single partial dependency suffices to disprove 2NF. Atomic fields already establish 1NF, so the exact classification is 1NFbut not 2NF. There is no need to test every FD against 3NF/BCNF after a lower prerequisite has failed.

Original paper, page 12 · Answer key