GATE CS 2024 Set 2 — All 65 Questions with Solutions
Computer Science (CS). Every question from this paper with the official answer key and a step-by-step solution. 100 marks total.
- Question 1General Aptitudemcq1 markIf '->' denotes increasing order of intensity, then [walk -> jog -> sprint] is analogous to [bothered -> ________ -> daunted]. Which option fits the blank?
- A.phased
- B.phrased
- C.fazed✓
- D.fused
Answer: C
Solution
Answer: (C) fazed bothered < fazed < daunted is increasing intensity of being disturbed/discouraged. "Fazed" (disconcerted) is the correct word (note: "phased", "phrased", "fused" are unrelated homophones/words). - A.
- Question 2General Aptitudemcq1 markTwo wizards mix four elements (water, air, fire, earth) in all possible orders, working independently. After trying all orders, the spell fails. How many attempts does each wizard make independently?
- A.24✓
- B.48
- C.16
- D.12
Answer: A
Solution
Answer: (A) 24 The number of orders (permutations) of 4 distinct elements is . Each wizard independently tries all 24 orders. - A.
- Question 3General Aptitudemcq1 markOf 10,000 students, 1,500 like neither core nor other branches. Students liking core branches of those liking other branches. 500 like both. The number who like their core branches is
- A.1,800✓
- B.3,500
- C.1,600
- D.1,500
Answer: A
Solution
Answer: (A) 1,800 Students liking core or other . Let core , other , with and both . . Substitute : - A.
- Question 4General Aptitudemcq1 markFor positive non-zero , if , then is
- A.1
- B.1/2
- C.2✓
- D.4
Answer: C
Solution
Answer: (C) 2 RHS , so — the arithmetic mean equals the geometric mean, which happens only when . Then . - A.
- Question 5General Aptitudemcq1 markIn the sequence 6, 9, 14, x, 30, 41, a possible value of is
- A.25
- B.21✓
- C.18
- D.20
Answer: B
Solution
Answer: (B) 21 The successive differences are consecutive odd numbers: , , then . So , and indeed , . - A.
- Question 6General Aptitudemcq2 marksSequence the sentences into a coherent passage. P: This fortuitous geological event generated a colossal amount of energy and heat that resulted in the rocks rising to an average height of 4 km across the contact zone. Q: Thus, the geophysicists tend to think of the Himalayas as an active geological event rather than as a static geological feature. R: The natural process of the cooling of this massive edifice absorbed large quantities of atmospheric carbon dioxide, altering the earth's atmosphere and making it better suited for life. S: Many millennia ago, a breakaway chunk of bedrock from the Antarctic Plate collided with the massive Eurasian Plate.
- A.QPSR
- B.QSPR
- C.SPRQ✓
- D.SRPQ
Answer: C
Solution
Answer: (C) SPRQ S introduces the event (collision), P describes its immediate effect (energy, rocks rising), R the subsequent cooling and CO2 absorption, and Q the concluding inference ("Thus..."). Order: S -> P -> R -> Q. - A.
- Question 7General Aptitudemcq2 marksA person sold two different items at the same price, making 10% profit on one and 10% loss on the other. Overall, the person made
- A.1% profit
- B.2% profit
- C.1% loss✓
- D.2% loss
Answer: C
Solution
Answer: (C) 1% loss Selling two items at the same price with equal and always gives a net loss of . For : loss . - A.
- Question 8General Aptitudemcq2 marksPie charts give shares of power generation. 2007: Coal 35, Gas 25, Wind 5, Hydro 30, Solar 5 (%). 2023: Coal 20, Gas 15, Wind 10, Hydro 35, Solar 20 (%). Renewables = Hydro+Solar+Wind. Total generation unchanged. The percentage increase in the renewable share is
- A.25%
- B.50%
- C.77.5%
- D.62.5%✓
Answer: D
Solution
Answer: (D) 62.5% Renewable share: 2007 ; 2023 . Percentage increase - A.
- Question 9General Aptitudemcq2 marksA cube is cut into 8 pieces of equal size and shape; each cut is straight and goes fully through. The minimum number of cuts required is
- A.3✓
- B.4
- C.7
- D.8
Answer: A
Solution
Answer: (A) 3 One straight cut through each of the three axes halves the cube each time: equal pieces. So 3 cuts suffice (and no fewer can double the count three times). - A.
- Question 10General Aptitudemcq2 marksIn the 4x4 array shown, each cell of the first three rows is a cross (X) or a number. The number in a cell = count of its immediate neighbours (left, right, top, bottom, diagonals) that do NOT contain a cross. The last row has no crosses. The sum of the four numbers to be filled in the last row is

- A.11✓
- B.10
- C.12
- D.9
Answer: A
Solution
Answer: (A) 11 For each cell in the last (4th) row, count its neighbours (in the 3rd and 4th rows) that are NOT crosses. Using the given 3rd-row pattern (3, X, 6, X) and that the whole 4th row is cross-free, the four counts sum to 11. - A.
- Question 11Computer Organization & Architecturemcq1 markA 4 MHz processor's DMA controller transfers 8 bytes in 1 cycle via cycle stealing. If 1% of processor cycles are used for DMA, the data transfer rate (bits/sec) is
- A.2,56,000
- B.3,200
- C.25,60,000✓
- D.32,000
Answer: C
Solution
Answer: (C) 25,60,000 Cycles/sec . DMA uses : cycles/sec. Each DMA cycle moves 8 bytes bits. Rate bits/sec. - A.
- Question 12Discrete Mathematicsmcq1 mark: Fail grade can be given. : Student scores more than 50%. Statement: "Fail grade cannot be given when student scores more than 50% marks." Correct representation?
- A.✓
- B.
- C.
- D.
Answer: A
Solution
Answer: (A) "When the student scores more than 50% (), a fail grade cannot be given ()" is exactly . - A.
- Question 13Programming & Data Structuresmcq1 markParameters are evaluated right to left.
Correct output?int g(int p){printf("%d",p);return p;} int h(int q){printf("%d",q);return q;} void f(int x,int y){ g(x); h(y); } int main(){ f(g(10),h(20)); }- A.20101020✓
- B.10202010
- C.20102010
- D.10201020
Answer: A
Solution
Answer: (A) 20101020f(g(10), h(20)): arguments evaluated right-to-left, soh(20)prints 20, theng(10)prints 10 -> "2010". Then insidef,g(x)prints 10,h(y)prints 20 -> "1020". Total: "2010"+"1020" = "20101020". - A.
- Question 14Computer Organization & Architecturemcq1 markIEEE-754 single precision (1 sign, 8 exponent, 23 mantissa). Choose the largest number:
(A) 0 | 0111 1111 | 1111...111 (B) 0 | 1111 1110 | 1111...111 (C) 0 | 1111 1111 | 1111...111 (D) 0 | 0111 1111 | 0000...000- A.(A)
- B.(B)✓
- C.(C)
- D.(D)
Answer: B
Solution
Answer: (B) Exponent (all ones) is reserved for infinity/NaN, so (C) is not a finite number. Among the valid finite numbers, the largest exponent is (254) in (B), with a full mantissa -> this is the largest representable finite value (). (A) and (D) have exponent 127 (much smaller). - A.
- Question 15Algorithmsmcq1 markfor . Which is TRUE?
- A.✓
- B.
- C.
- D.
Answer: A
Solution
Answer: (A) Characteristic equation . General solution . Using and : solving gives , so . (The term vanishes.) - A.
- Question 16Engineering Mathematicsmcq1 markis continuous with . The value of is
- A.0
- B.1✓
- C.2
- D.-1
Answer: B
Solution
Answer: (B) 1 Let . Substituting : . So . - A.
- Question 17Engineering Mathematicsmcq1 markis the adjacency matrix of a simple undirected graph , and is its own inverse (). Which is always TRUE?
- A.G is a cycle
- B.G is a perfect matching✓
- C.G is a complete graph
- D.There is no such graph G
Answer: B
Solution
Answer: (B) G is a perfect matching means for all and off-diagonal. , so every vertex has degree 1. A simple graph in which every vertex has degree exactly 1 is a perfect matching (a disjoint union of edges), and one checks holds. So must be a perfect matching. - A.
- Question 18Engineering Mathematicsmcq1 markSix unbiased dice are rolled. The probability of getting all distinct numbers (1..6) is
- A.
- B.✓
- C.
- D.
Answer: B
Solution
Answer: (B) Favourable outcomes (all permutations). Total . - A.
- Question 19Databasesmcq1 markOnce a transaction is reported complete, its effect persists even if the system crashes before changes reach disk. This property is
- A.durability✓
- B.atomicity
- C.consistency
- D.isolation
Answer: A
Solution
Answer: (A) durability Durability guarantees that the effects of a committed transaction survive subsequent failures (via logging/recovery). - A.
- Question 20Databasesmcq1 markIn the ER model with owner and weak entity sets, which statement is TRUE?
- A.The weak entity set MUST have total participation in the identifying relationship✓
- B.The owner entity set MUST have total participation in the identifying relationship
- C.Both weak and owner entity sets MUST have total participation
- D.Neither must have total participation
Answer: A
Solution
Answer: (A) A weak entity has no key of its own and is existence-dependent on its owner, so it MUST participate totally in the identifying relationship. The owner need not have total participation. - A.
- Question 21Compiler Designmcq1 markMatch Set X to Set Y: P. Lexical Analyzer, Q. Syntax Analyzer, R. Intermediate Code Generator, S. Code Optimizer <-> 1. Abstract Syntax Tree, 2. Token, 3. Parse Tree, 4. Constant Folding.
- A.P-4; Q-1; R-3; S-2
- B.P-2; Q-3; R-1; S-4✓
- C.P-2; Q-1; R-3; S-4
- D.P-4; Q-3; R-2; S-1
Answer: B
Solution
Answer: (B) P-2; Q-3; R-1; S-4 Lexical analyzer produces Tokens (2); syntax analyzer produces the Parse Tree (3); intermediate code generation works from the Abstract Syntax Tree (1); code optimization includes Constant Folding (4). - A.
- Question 22Theory of Computationmcq1 markWhich regular expression is equivalent to the language accepted by the DFA shown (states over )?

- A.✓
- B.
- C.
- D.
Answer: A
Solution
Answer: (A) From the DFA, strings reach the accepting state by first taking any number of 0's then a 1 (), after which the self/return transitions allow repeating patterns of a single or a followed by : . This exactly describes the accepted language. - A.
- Question 23Computer Networksmsq1 markX has a TCP connection to Y through IP router R; Ethernet switch S is the first switch on the path X-R. For a packet from X to Y when it leaves X, which statements are TRUE?
- A.Destination IP is R's IP
- B.Destination IP is Y's IP✓
- C.Destination MAC is S's MAC
- D.Destination MAC is Y's MAC
Answer: B
Solution
Answer: (B) The destination IP is the final destination's IP (Y) end-to-end -> (B) true, (A) false. The destination MAC is the next-hop L2 device, which is the first-hop router R (not the switch S, which forwards transparently by MAC, and not Y which is remote). So (C) and (D) are false. - A.
- Question 24Operating Systemsmsq1 markWhich tasks is/are the responsibility of the MMU in paging-based memory management?
- A.Allocate a new page table for a newly created process
- B.Translate a virtual address to a physical address using the page table✓
- C.Raise a trap when a virtual address is not found in the page table✓
- D.Raise a trap when writing to a read-only page✓
Answer: B, C, D
Solution
Answer: (B), (C) and (D) The MMU (hardware) translates virtual->physical addresses using the page table (B), and raises faults/traps on invalid translations (page fault) (C) and on permission violations like writing a read-only page (D). Allocating a new page table (A) is done by the OS, not the MMU. - A.
- Question 25Operating Systemsmsq1 markWhich events ALWAYS trigger a context switch moving process P to a non-running state?
- A.P makes a blocking disk read syscall✓
- B.P accesses a page in swap space (page fault)✓
- C.An interrupt from the disk delivering data for another process
- D.A timer interrupt
Answer: A, B
Solution
Answer: (A) and (B) - (A) A blocking syscall puts P into the blocked state and yields the CPU -> always a context switch. - (B) A major page fault (data in swap) blocks P while the page is fetched -> always a context switch. - (C) A disk interrupt for another process does not necessarily move P out of running. - (D) A timer interrupt does not always preempt P (only if the OS decides to reschedule). - A.
- Question 26Databasesmsq1 markWhich file organization(s) is/are I/O efficient for the scan operation?
- A.Sorted✓
- B.Heap✓
- C.Unclustered tree index
- D.Unclustered hash index
Answer: A, B
Solution
Answer: (A) and (B) Scanning reads all records sequentially. A Sorted file and a Heap file store records contiguously, so a full scan reads pages sequentially and is I/O efficient. Unclustered indexes (tree or hash) point to records scattered across pages, so scanning through them causes random I/O and is inefficient. - A.
- Question 27Databasesmsq1 markWhich statements about the 2PL protocol is/are TRUE?
- A.2PL permits only serializable schedules✓
- B.With 2PL, a transaction locks just before every operation and releases just after
- C.Once a lock is released in a transaction, no more locks can be obtained in that transaction✓
- D.A deadlock is possible with 2PL✓
Answer: A, C, D
Solution
Answer: (A), (C) and (D) 2PL guarantees conflict-serializable schedules (A). Its defining rule is a growing phase then a shrinking phase: once any lock is released, no new lock may be acquired (C). 2PL can still deadlock (D). (B) is false — that describes a non-2PL lock-just-around-each-operation discipline, which violates the two-phase rule. - A.
- Question 28Computer Networksmsq1 markWhich statements about IPv4 fragmentation is/are TRUE?
- A.Fragmentation is performed only at the source
- B.Fragmentation is performed at any router whose outgoing MTU is exceeded✓
- C.Reassembly is performed only at the destination✓
- D.Reassembly is performed at all intermediate routers
Answer: B, C
Solution
Answer: (B) and (C) In IPv4, any router may fragment a datagram if it exceeds the next link's MTU (B). Reassembly is done only at the final destination (C), never at intermediate routers (D). So (A) is false (not only the source) and (D) is false. - A.
- Question 29Compiler Designmsq1 markWhich statements is/are FALSE?
- A.An attribute grammar is an SDD whose semantic-rule functions have no side effects
- B.The attributes in an L-attributed definition cannot always be evaluated in depth-first order✓
- C.Synthesized attributes can be evaluated by a bottom-up parser as the input is parsed
- D.All L-attributed definitions based on an LR(1) grammar can be evaluated using bottom-up parsing✓
Answer: B, D
Solution
Answer: (B) and (D) - (B) is FALSE: L-attributed definitions are specifically designed so that all attributes CAN be evaluated in a single depth-first (left-to-right) traversal. - (D) is FALSE: not every L-attributed SDD on an LR grammar can be evaluated bottom-up (inherited attributes can be problematic); only the S-attributed subset is always bottom-up evaluable. - (A) and (C) are TRUE statements. - A.
- Question 30Digital Logicmsq1 markFor a Boolean variable , which statements is/are FALSE?
- A.
- B.✓
- C.✓
- D.
Answer: B, C
Solution
Answer: (B) and (C) - (B) FALSE: (not ). - (C) FALSE: (idempotent), not . - (A) TRUE (); (D) TRUE (complement law). - A.
- Question 31Computer Organization & Architecturemsq1 markInstructions: I1: DIV R3,R1,R2; I2: SUB R5,R3,R4; I3: ADD R3,R5,R6; I4: MUL R7,R3,R8. Which dependencies hold?
- A.RAW on R3 between I1 and I2✓
- B.WAR on R3 between I1 and I3
- C.RAW on R3 between I2 and I3
- D.WAW on R3 between I3 and I4
Answer: A
Solution
Answer: (A) I1: DIV R3,... I2: SUB R5,R3,... I3: ADD R3,... I4: MUL R7,R3,... - (A) I1 writes R3, I2 reads R3 -> Read-After-Write on R3 between I1 and I2. TRUE. - (B) A WAR needs an earlier READ then a later WRITE; I1 does not read R3, so there is no WAR between I1 and I3 (the actual WAR is between I2 and I3). FALSE. - (C) I2 reads R3 and I3 writes R3 - that is WAR, not RAW (RAW needs a write then a read, but I2 does not write R3). FALSE. - (D) I3 writes R3 and I4 only reads R3 - no WAW between them. FALSE. Only (A) holds. - A.
- Question 32Computer Networksmsq1 markWhich IP header field(s) is/are ALWAYS modified by any router before forwarding?
- A.Source IP Address
- B.Protocol
- C.Time to Live (TTL)✓
- D.Header Checksum✓
Answer: C, D
Solution
Answer: (C) and (D) Every router decrements the TTL (C); since a field changed, it must recompute the Header Checksum (D). Source IP and Protocol are not changed by an ordinary router. - A.
- Question 33Programming & Data Structuresmsq1 mark
int fX(char *a){ char *b=a; while(*b) b++; return b-a; }Which statements is/are TRUE?- A.fX("abcd") will always return a value✓
- B.With char c[]="abcd" in main, fX(c) always returns a value✓
- C.The function will not compile
- D.With char *c="abcd" in main, fX(c) always returns a value✓
Answer: A, B, D
Solution
Answer: (A), (B) and (D)fXcomputes the string length by advancing to the terminating '\0'. It works for any valid, null-terminated string: a string literal argument (A), a char array (B), and a char pointer to a literal (D) all give length 4. The code compiles fine, so (C) is false. - A.
- Question 34Discrete Mathematicsnat1 markPartial order on . The number of total orders on containing is __________
Answer: 5
Solution
Answer: 5 We need linear extensions respecting , , . Enumerating permutations consistent with these constraints:
There are exactly 5 such total orders.3 1 2 4, 3 1 4 2, 1 3 2 4, 1 3 4 2, 3 4 1 2 - Question 35Algorithmsnat1 markDistance of array = minimum number of elements to replace so becomes non-decreasing. The distance of [2,5,3,1,4,2,6] is __________
Answer: 3
Solution
Answer: 3 Elements that can stay form a longest non-decreasing subsequence (LNDS); the rest must be replaced. For [2,5,3,1,4,2,6], an LNDS is (length 4). So replacements . - Question 36Programming & Data Structuresmcq2 marks
Output?double a[2]={20.0,25.0},*p,*q; p=a; q=p+1; printf("%d,%d",(int)(q-p),(int)(*q-*p));- A.4,8
- B.1,5✓
- C.8,5
- D.1,8
Answer: B
Solution
Answer: (B) 1,5q-pis pointer difference in units of elements .*q-*p = 25.0-20.0 = 5.0, cast to int . Output: "1,5". - A.
- Question 37Operating Systemsmcq2 marksProcesses A(0,10), B(2,6), C(4,3), D(6,7) (arrival, burst). Give the average waiting times for preemptive SRTF and non-preemptive SJF.
- A.SRTF=6, NP-SJF=7
- B.SRTF=6, NP-SJF=7.5✓
- C.SRTF=7, NP-SJF=7.5
- D.SRTF=7, NP-SJF=8.5
Answer: B
Solution
Answer: (B) SRTF=6, NP-SJF=7.5 SRTF timeline: A runs 0-2; B(6)<A(8) runs 2-4; C(3)<B(4) runs 4-7; B 7-11; D 11-18; A 18-26. Waiting = completion-arrival-burst: A=16,B=3,C=0,D=5 -> avg . NP-SJF: A 0-10; then ready {B,C,D}, shortest C 10-13; B 13-19; D 19-26. Waiting: A=0,B=11,C=6,D=13 -> avg . - A.
- Question 38Computer Networksmcq2 marksWhich CIDR prefix exactly represents the range 10.12.2.0 to 10.12.3.255?
- A.10.12.2.0/23✓
- B.10.12.2.0/24
- C.10.12.0.0/22
- D.10.12.2.0/22
Answer: A
Solution
Answer: (A) 10.12.2.0/23 The range spans addresses , so the host part is 9 bits and the prefix is . The block covers – exactly (the 3rd octet varies over 2 and 3). - A.
- Question 39Programming & Data Structuresmcq2 marksA BST is built by inserting all elements of a set in some unknown order. Which can be determined from alone?
- A.Inorder traversal of T✓
- B.Root node of T
- C.Preorder traversal of T
- D.Postorder traversal of T
Answer: A
Solution
Answer: (A) The inorder traversal of any BST is the sorted order of its keys, which is determined by the set regardless of insertion order. The root, preorder, and postorder all depend on the (unknown) insertion sequence. - A.
- Question 40Compiler Designmcq2 marksFor , , , fill the partially-filled LL(1) table cells (1),(2),(3),(4). Which combination is correct?
- A.(1) (2) (3) (4)✓
- B.(1) (2) (3) (4)
- C.(1) (2) (3) blank (4) blank
- D.(1) (2) (3) blank (4) blank
Answer: A
Solution
Answer: (A) FIRST (A can be ) and FIRST. So under : (cell 1); under : (cell 2). For : FOLLOW includes and , so appears under (cell 3). For : appears under (cell 4). This matches (A). - A.
- Question 41Theory of Computationmcq2 marksThe 5-state NFA (with -transitions) shown accepts which language?

- A.
- B.✓
- C.
- D.
Answer: B
Solution
Answer: (B) Tracing the NFA: from the start there are -moves to a branch counting 0's (loop of two 0's, with accept allowing -like behaviour) and a branch for a 1 followed by pairs of 1's. Combining the accepting paths yields , matching option (B). - A.
- Question 42Programming & Data Structuresmcq2 marksA C snippet computes the longest subarray with at most two distinct integers. len1 = longest suffix of equal values, len2 = longest suffix with <=2 distinct values. Fill (P) and (Q):
- A.(P) len1+1 (Q) len2+1
- B.(P) 1 (Q) len1+1✓
- C.(P) 1 (Q) len2+1
- D.(P) len2+1 (Q) len1+1
Answer: B
Solution
Answer: (B) (P) 1 (Q) len1+1 WhenX[i]equals the second-most-recent distinct value (theelse ifbranch), the run of equal values restarts at this element, solen1 = 1(P). WhenX[i]is a brand-new third value (theelsebranch), the at-most-two-distinct window can only extend the previous equal-run plus this element, solen2 = len1+1(Q). - A.
- Question 43Compiler Designmcq2 marksFor , fill the missing triples (1),(3),(6). Which option is correct?
- A.(1) =[] s i (3) * (0)(2) (6) []= x i✓
- B.(1) []= s i (3) - (0)(2) (6) =[] x (5)
- C.(1) =[] s i (3) * (0)(2) (6) []= x (5)
- D.(1) []= s i (3) - (0)(2) (6) =[] x i
Answer: A
Solution
Answer: (A) The three-address form of uses the triples: (0) + p r ; (1) =[] s i (fetch s[i]) ; (2) uminus (1) ; (3) * (0)(2) ; (4) / u w ; (5) + (3)(4) ; (6) []= x i (address of x[i]) ; (7) = (6)(5). So the missing entries are (1) =[] s i, (3) * (0)(2), and (6) []= x i - option (A). - A.
- Question 44Engineering Mathematicsmcq2 markstake values in (not necessarily independent), , means . Which is TRUE?
- A.
- B.
- C.
- D.✓
Answer: D
Solution
Answer: (D) Since , we have pointwise (as ), so taking expectations . The others fail without independence (e.g. can be with positive correlation). - A.
- Question 45Databasesmcq2 marksPerson(pid, city). Using selection, projection, cross product, rename, the minimum number of cross-product operations to find cities where at least 3 persons reside is
- A.1
- B.2✓
- C.3
- D.4
Answer: B
Solution
Answer: (B) 2 To require three distinct persons in the same city, we need three copies of Person joined on equal city with distinct pids. Combining three renamed copies needs 2 cross-product (join) operations: , then select equal cities and pairwise-distinct pids, then project the city. - A.
- Question 46Operating Systemsmsq2 marksT1: wait(s1); x=x+1; print(x); wait(s2); signal(s1). T2: wait(s1); x=x+1; print(x); signal(s2); signal(s1). s1=1, s2=0, x=0. Which outcomes are possible?
- A.T1 first prints 1, T2 next prints 2
- B.T2 first prints 1, T1 next prints 2✓
- C.T1 first prints 1, T2 deadlock✓
- D.T2 first prints 1, T1 next prints 2 (no deadlock)
Answer: B, C
Solution
Answer: (B) and (C) - If T2 acquires s1 first: it prints 1, signals s2, signals s1; then T1 acquires s1, prints 2, wait(s2) succeeds (s2=1), signal(s1). Works -> (B) possible. - If T1 acquires s1 first: it prints 1, then wait(s2) blocks (s2=0) while still holding s1; T2 can never get s1 -> deadlock -> (C) possible. - (A) impossible (T1 first always deadlocks). (D) impossible (T2 first prints 1 then T1 prints 2 is exactly (B), not a new distinct option as worded — the valid non-deadlock case is (B)). - A.
- Question 47Engineering Mathematicsmsq2 marksis obtained from ( real) by swapping two rows. Which statements is/are TRUE?
- A.det(B) = -det(A)✓
- B.If A is invertible, B is invertible✓
- C.If A is symmetric, B is symmetric
- D.If trace(A)=0, trace(B)=0
Answer: A, B
Solution
Answer: (A) and (B) Swapping two rows negates the determinant (A). Since when is invertible, is also invertible (B). A row swap generally destroys symmetry (C false) and changes which diagonal entries appear, so the trace can change (D false). - A.
- Question 48Programming & Data Structuresmsq2 marksS1 (capacity 4) holds 100,200,300,400 (400 top); S2 (capacity 2) empty. Operations: PushToS2 (S1->S2), PushToS1 (S2->S1), GenerateOutput (pop S1 to output). No pop on empty / push on full. Which output sequences can be generated?
- A.100, 200, 400, 300
- B.200, 300, 400, 100✓
- C.400, 200, 100, 300✓
- D.300, 200, 400, 100✓
Answer: B, C, D
Solution
Answer: (B), (C) and (D) This is a stack-permutation question with the auxiliary stack S2 (capacity 2) allowing limited reordering. Simulating the allowed moves, sequences (B) 200,300,400,100, (C) 400,200,100,300, and (D) 300,200,400,100 are each reachable, while (A) 100,200,400,300 cannot be produced under the capacity constraints. - A.
- Question 49Computer Organization & Architecturemsq2 marksWhich is/are EQUAL to in radix-5?
- A.64 in radix-10✓
- B.100 in radix-8✓
- C.50 in radix-16
- D.121 in radix-7✓
Answer: A, B, D
Solution
Answer: (A), (B) and (D) . - (A) . Equal. - (B) . Equal. - (C) . Not equal. - (D) . Equal. - A.
- Question 50Digital Logicmsq2 marksGiven , , , feeding AND () and OR (), whose outputs feed an XOR to give . Which options are CORRECT?

- A.
- B.
- C.✓
- D.✓
Answer: C, D
Solution
Answer: (C) and (D) Let (common minterms) and (union). Then minterms in exactly one of them. Computing the symmetric difference gives — option (C). Equivalently (the complementary maxterms) — option (D). (A) and (B) are different minterm sets. - A.
- Question 51Discrete Mathematicsmsq2 marksis connected with positive integer edge weights, and every spanning tree has even weight. Which statements are TRUE for every such ?
- A.All edges have even weight
- B.All edges have even weight OR all edges have odd weight
- C.In each cycle C, all edges have even weight
- D.In each cycle C, either all edges in C are even OR all are odd✓
Answer: D
Solution
Answer: (D) If all spanning trees have the same parity (even), then swapping one tree edge for a non-tree edge on its fundamental cycle must not change the parity, which forces the two swapped edges to have the same parity. Propagating this around each cycle means every cycle's edges share one parity -> (D). (A),(B),(C) are too strong: edges in different cycles may have different parities as long as within each cycle they match. - A.
- Question 52Theory of Computationmsq2 marks: , , . For , with the counts of , which statements is/are TRUE?
- A.
- B.✓
- C.✓
- D.
Answer: B, C
Solution
Answer: (B) and (C) Each use of adds one and one ; adds an ; and each eventually becomes a . Counting: every comes with the rule, and the number of 's is always one more than the number of 's -> (C). Since each has a matching (plus possibly extra 's), , and relating to gives (B). (A) fails when no rule is used and (D) is false in general. - A.
- Question 53Computer Organization & Architecturenat2 marksDisk: 6000 RPM, avg seek 5 ms, 500 sectors/track, 512-byte sectors. A file is in 3000 sectors randomly located. Assuming average rotational latency, the total read time (seconds) is _________
Answer: 29.5 to 30.5
Solution
Answer: 30.06 Rotation time ms; average rotational latency ms; read time per sector ms. Each randomly located sector needs seek + rotational latency + read ms. Total s. - Question 54Computer Networksnat2 marksA TCP connection has cwnd 12 MSS when a timeout occurs. Assuming all segments in the next two RTTs are acknowledged, the cwnd (in MSS) during the third RTT is _________
Answer: 4
Solution
Answer: 4 On timeout, ssthresh and cwnd resets to 1, entering slow start (doubling each RTT):So during the third RTT, cwnd .RTT1: cwnd = 1 RTT2: cwnd = 2 RTT3: cwnd = 4 (still below ssthresh=6, so still doubling) - Question 55Computer Networksnat2 marksEthernet: transmission speed bps, max segment length 500 m, propagation speed m/s. The minimum frame size (bits) for collision detection is _________
Answer: 500
Solution
Answer: 500 Propagation time one-way . Minimum frame transmission time must be : - Question 56Databasesnat2 marksA useful FD requires , , . For a relation R with 4 attributes, the number of possible useful FDs is ________
Answer: 50
Solution
Answer: 50 Each attribute is independently placed in , in , or in neither choices, giving assignments. Subtract those with empty ( gets none: each attribute in or neither ) and empty (), then add back the all-neither case counted twice (): - Question 57Computer Organization & Architecturenat2 marksA processor with 16 registers uses 32-bit instructions: opcode + addressing-mode + two register operands + 16-bit scalar. 8 addressing modes are supported. The max number of unique opcodes per addressing mode is _________
Answer: 32
Solution
Answer: 32 Register field bits (two fields bits). Addressing mode bits. Scalar bits. Opcode bits , giving unique opcodes. - Question 58Computer Organization & Architecturenat2 marksNon-pipelined: 6 cycles/instruction at 2 GHz. Pipelined (5 stages, 2 GHz, ideal 1 IPC): 20% of instructions stall 2 cycles (data), 20% stall 3 cycles (control). The speedup is _________
Answer: 2.9 to 3.1
Solution
Answer: 3.0 Pipelined effective CPI . Speedup (same clock). - Question 59Algorithmsnat2 marksThe number of distinct minimum-weight spanning trees of the shown weighted graph (vertices a,b,c,d,e,f,g) is _________

Answer: 9
Solution
Answer: 9 All four weight-1 edges () are forced into every MST (no cycle among them), connecting and , with isolated. The MST (weight 8) then needs 2 weight-2 edges to join the three parts , , :Counting the valid ways the weight-2 edges connect all three components without a cycle gives distinct MSTs.to g from {a,b,f}: a-g, b-g, f-g (3 choices) to join {c,d,e}: either g-c / g-d / g-e (to g side) - Question 60Discrete Mathematicsnat2 marksThe chromatic number of the shown graph (8 vertices drawn as an octagon with diagonals) is _________

Answer: 2
Solution
Answer: 2 The graph is bipartite — it is the complete bipartite graph (each vertex on one side joins every vertex on the other). A bipartite graph with at least one edge has chromatic number exactly 2 (it contains no odd cycle). - Question 61Computer Organization & Architecturenat2 marks32-bit instructions, 150 distinct instructions split equally into R-type and I-type. 1 opcode bit distinguishes I/R; 50 architectural registers; equal register-field sizes. X = UNUSED bits (R-type), Y = OPCODE bits, Z = immediate bits (I-type). The value of X+2Y+Z is ________
Answer: 34
Solution
Answer: 34 Registers: bits each. Opcode bits (75 ops per type). R-type: . I-type: . - Question 62Theory of Computationnat2 marksis given by and . The number of strings in that are also in is __________
Answer: 15
Solution
Answer: 15 is exactly the set of strings over with an ODD number of 's. Counting strings of length with an odd number of 's:
Total .length 1: a -> 1 length 2: ab, ba -> 2 length 3: 1 a (C(3,1)=3) + 3 a (C(3,3)=1) -> 4 length 4: 1 a (C(4,1)=4) + 3 a (C(4,3)=4) -> 8 - Question 63Discrete Mathematicsnat2 marksunder addition mod . The number of elements in that are their own inverses is ________
Answer: 4
Solution
Answer: 4 An element is its own inverse iff in the respective groups. - : for -> 2 solutions. - : -> 1 solution. - : -> 2 solutions. Total . - Question 64Operating Systemsnat2 marks32-bit system, 4 KB pages, 4-byte PTEs, 2-level page table (outer directory + inner tables), demand-paged inner tables (allocated only if they hold a valid PTE). A process accesses 2000 unique pages. X = min, Y = max number of pages across the two page-table levels. X+Y is ________
Answer: 1028
Solution
Answer: 1028 Page offset bits; VPN bits split . An inner page table holds entries page. Outer directory is always 1 page. - Minimum: pack 2000 valid entries into as few inner tables as possible: inner tables -> . - Maximum: spread the 2000 pages so as many inner tables as possible each hold entry; there are only possible inner tables, and , so all are used -> . - Question 65Compiler Designnat2 marksAugmented grammar: ; ; ; . With , the number of items in is ___________
Answer: 9
Solution
Answer: 9 moves the dot past in every item with , giving and , then closure of re-adds all -, -, -productions:
That is items.S' -> S. S -> S.S S -> .SS S -> .Aa S -> .bAc S -> .Bc S -> .bBa A -> .d# B -> .@
Practice the full paper with a timer
Attempt GATE CS 2024 Set 2 in the exact GATE interface and get a detailed score and topic-wise analysis — free.
Create free account →