GATE CS 2023 — 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.

  1. Question 1General Aptitudemcq1 mark
    We reached the station late, and _______ missed the train.
    • A.
      near
    • B.
      nearly
      ✓
    • C.
      utterly
    • D.
      mostly

    Answer: B

    Solution

    Answer: (B) nearly "nearly missed" means almost missed — the idiomatically and grammatically correct adverb here. "near" is not an adverb in this sense, and "utterly"/"mostly" do not fit.
  2. Question 2General Aptitudemcq1 mark
    Kind : _______ :: Often : Frequently (By word meaning)
    • A.
      Mean
    • B.
      Type
      ✓
    • C.
      Cruel
    • D.
      Kindly

    Answer: B

    Solution

    Answer: GATE awarded Marks To All (MTA) for this question. "Often" and "Frequently" are synonyms. "Kind" as a noun means a sort/category, whose synonym would be "Type" (B). However, "Kind" as an adjective (benevolent) has no synonym among the options ("Cruel" is its antonym), making the analogy ambiguous. Because of this ambiguity, GATE 2023 awarded marks to all candidates.
  3. Question 3General Aptitudemcq1 mark
    A series of natural numbers obeys for all . If and , what is ?
    • A.
      4
      ✓
    • B.
      5
    • C.
      8
    • D.
      9

    Answer: A

    Solution

    Answer: (A) 4 Work backwards with :
    F5 = 60-37 = 23
    F4 = 37-23 = 14
    F3 = 23-14 = 9
    F2 = 14-9  = 5
    F1 = 9-5   = 4
  4. Question 4General Aptitudemcq1 mark
    A survey found 90% of pregnant women received medical care at least once before birth. Of these, 60% received care from doctors, 40% from other providers. Which statement can be inferred with certainty?
    • A.
      More than half of the pregnant women received medical care at least once from a doctor.
      ✓
    • B.
      Less than half of the pregnant women received medical care at least once from a doctor.
    • C.
      More than half received medical care at most once from a doctor.
    • D.
      Less than half received medical care at most once from a doctor.

    Answer: A

    Solution

    Answer: (A) Fraction receiving care from a doctor . So more than half of all pregnant women received care at least once from a doctor.
  5. Question 5General Aptitudemcq1 mark
    Looking at the surface of a smooth 3-dimensional object from the outside, which one is TRUE?
    • A.
      The surface must be concave everywhere.
    • B.
      The surface must be convex everywhere.
    • C.
      The surface may be concave in some places and convex in other places.
      ✓
    • D.
      The object can have edges, but no corners.

    Answer: C

    Solution

    Answer: (C) A smooth 3D object can have both convex regions (e.g. a bump) and concave regions (e.g. a dent), so in general the surface may be concave in some places and convex in others.
  6. Question 6General Aptitudemcq2 marks
    Zombieland's government gives monetary incentives to those who ride bicycles to work, to address the health issues caused by lack of physical exercise. Which statement can be logically inferred with certainty?
    • A.
      All the working population will henceforth ride bicycles to work.
    • B.
      Riding bicycles will ensure all of the working population is free of health issues.
    • C.
      The health experts suggested declaring cycling mandatory.
    • D.
      The Government believes that riding bicycles is a form of physical exercise.
      ✓

    Answer: D

    Solution

    Answer: (D) The government incentivizes cycling specifically to counter the lack of physical exercise, which logically means it treats cycling as a form of physical exercise. The other options overreach beyond what the passage states.
  7. Question 7General Aptitudemcq2 marks
    Let and for . Statements: (i) For some , . (ii) There exists such that for all . Which is TRUE?
    • A.
      only (i) is correct
    • B.
      only (ii) is correct
    • C.
      both (i) and (ii) are correct
      ✓
    • D.
      neither (i) nor (ii) is correct

    Answer: C

    Solution

    Answer: (C) both (i) and (ii) are correct For small , exceeds (e.g. : ) -> (i) true. They cross at ; beyond that the quadratic dominates the linear, so for all -> (ii) true.
  8. Question 8General Aptitudemcq2 marks
    Which sentence sequence creates a coherent narrative? (i) Once on the terrace, on her way to her small room in the corner, she notices the man right away. (ii) She begins to pant by the time she has climbed all the stairs. (iii) Mina has bought vegetables and rice at the market, so her bags are heavy. (iv) He was leaning against the parapet, watching the traffic below.
    • A.
      (i), (ii), (iv), (iii)
    • B.
      (ii), (iii), (i), (iv)
    • C.
      (iv), (ii), (i), (iii)
    • D.
      (iii), (ii), (i), (iv)
      ✓

    Answer: D

    Solution

    Answer: (D) (iii), (ii), (i), (iv) (iii) sets up heavy bags, (ii) she pants climbing stairs, (i) reaching the terrace she notices the man, (iv) describes the man. Order: iii -> ii -> i -> iv.
  9. Question 9General Aptitudemcq2 marks
    and are functions of and respectively, and for all real and . Which one is necessarily TRUE for all and ?
    • A.
      and
    • B.
      constant
      ✓
    • C.
      constant and constant (possibly different)
    • D.

    Answer: B

    Solution

    Answer: (B) constant If for all independent and , vary with fixed: cannot change, so is a constant; likewise is a constant, and the two constants are equal. Hence both equal the same constant.
  10. Question 10General Aptitudemcq2 marks
    Which option best describes the transformation of the 2-D figure P to Q, and then to R, as shown?
    GATE CS 2023 Question 10 figure
    • A.
      Op1: Clockwise rotation by 90 deg (axis perpendicular to plane); Op2: reflection along a horizontal line
      ✓
    • B.
      Op1: Counter-clockwise rotation by 90 deg; Op2: reflection along a horizontal line
    • C.
      Op1: Clockwise rotation by 90 deg; Op2: reflection along a vertical line
    • D.
      Op1: Counter-clockwise rotation by 180 deg; Op2: reflection along a vertical line

    Answer: A

    Solution

    Answer: (A) Comparing P to Q, the star is rotated 90 degrees clockwise (about an axis perpendicular to the page). Comparing Q to R, the figure is reflected across a horizontal line. So Operation 1 is a clockwise 90-degree rotation and Operation 2 is a horizontal reflection.
  11. Question 11Compiler Designmcq1 mark
    Consider statements about a compiler. S1: The front-end includes phases independent of the target hardware. S2: The back-end includes phases specific to the target hardware. S3: The back-end includes phases specific to the programming language of the source code. Identify the CORRECT option.
    • A.
      Only S1 is TRUE.
    • B.
      Only S1 and S2 are TRUE.
      ✓
    • C.
      S1, S2, and S3 are all TRUE.
    • D.
      Only S1 and S3 are TRUE.

    Answer: B

    Solution

    Answer: (B) Only S1 and S2 are TRUE The front-end (lexical/syntax/semantic analysis, IR generation) is machine-independent -> S1 true. The back-end (code generation, machine-specific optimization) is target-hardware specific -> S2 true. The back-end is NOT source-language specific (it works on IR) -> S3 false.
  12. Question 12Programming & Data Structuresmcq1 mark
    Which sequence stored at forms a max-heap?
    • A.
      23, 17, 10, 6, 13, 14, 1, 5, 7, 12
    • B.
      23, 17, 14, 7, 13, 10, 1, 5, 6, 12
      ✓
    • C.
      23, 17, 14, 6, 13, 10, 1, 5, 7, 15
    • D.
      23, 14, 17, 1, 10, 13, 16, 12, 7, 5

    Answer: B

    Solution

    Answer: (B) 23, 17, 14, 7, 13, 10, 1, 5, 6, 12 A max-heap requires and . Checking (B):
    23>=17,14 | 17>=7,13 | 14>=10,1 | 7>=5,6 | 13>=12
    all hold. In (A) 13<14 (A[5]<A[6])? ok, but fails. (C) fails. (D) ? root ok but ... fails. Only (B) is a valid max-heap.
  13. Question 13Programming & Data Structuresmcq1 mark
    SLLdel deletes a node in a singly-linked list given a pointer to the node and to the head. DLLdel does the same for a doubly-linked list. With nodes, what is the worst-case time complexity?
    • A.
      SLLdel is O(1) and DLLdel is O(n)
    • B.
      Both are O(log n)
    • C.
      Both are O(1)
    • D.
      SLLdel is O(n) and DLLdel is O(1)
      ✓

    Answer: D

    Solution

    Answer: (D) SLLdel is O(n) and DLLdel is O(1) In a singly-linked list, deleting a given node needs its predecessor; the copy-next trick works except for the last node, so the worst case is (traverse from head). In a doubly-linked list, the node has a prev pointer, so deletion adjusts prev/next in .
  14. Question 14Theory of Computationmcq1 mark
    Consider the DFA shown over with states , start state , and the only final state. Which regular expression describes ?
    GATE CS 2023 Question 14 figure
    • A.
    • B.
    • C.
      ✓
    • D.

    Answer: C

    Solution

    Answer: (C) From , only a leading reaches the final state . From , reading a keeps you in the accepting cycle, and reading (via and back) returns to ; any other symbol goes to the dead state . So accepted strings are a followed by any sequence of 's and 's: .
  15. Question 15Discrete Mathematicsmcq1 mark
    The Lucas sequence for , with and . Which is TRUE?
    • A.
      ✓
    • B.
    • C.
    • D.

    Answer: A

    Solution

    Answer: (A) The characteristic equation has roots and . The Lucas numbers have the closed form . Checking: and . Matches option (A).
  16. Question 16Databasesmcq1 mark
    Which one refers to the degree (arity) of a relation in relational database systems?
    • A.
      Number of attributes of its relation schema.
      ✓
    • B.
      Number of tuples stored in the relation.
    • C.
      Number of entries in the relation.
    • D.
      Number of distinct domains of its relation schema.

    Answer: A

    Solution

    Answer: (A) Number of attributes of its relation schema The degree (arity) of a relation is the number of attributes (columns) in its schema. The number of tuples is the cardinality, not the degree.
  17. Question 17Computer Networksmcq1 mark
    Two hosts use Stop-and-Wait over a point-to-point link. In which scenario is link utilization the LOWEST?
    • A.
      Longer link length and lower transmission rate
    • B.
      Longer link length and higher transmission rate
      ✓
    • C.
      Shorter link length and lower transmission rate
    • D.
      Shorter link length and higher transmission rate

    Answer: B

    Solution

    Answer: (B) Longer link length and higher transmission rate Utilization . It is lowest when the transmission time is small relative to the propagation time . Higher transmission rate reduces , and longer link increases — together they minimize utilization.
  18. Question 18Engineering Mathematicsmcq1 mark
    and are matrices where is obtained from by a row rearrangement (A is the circulant with first row 1,2,3,4; B with first row 3,4,1,2). Which is TRUE?
    • A.
    • B.
      ✓
    • C.
    • D.

    Answer: B

    Solution

    Answer: (B) and are matrices whose rows are the vector arranged differently; is obtained from by swapping two rows (rows 1 and 3). A single row swap negates the determinant, so . is not (as a circulant with first row its eigenvalues multiply to ), so (C) is false; (A) and (D) are also false.
  19. Question 19Compiler Designmcq1 mark
    Given letter -> [A-Za-z], digit -> [0-9], id -> letter (letter | digit)*, which NFA with epsilon-transitions (shown as options A-D) accepts the set of valid identifiers?
    GATE CS 2023 Question 19 figure
    • A.
      (A)
    • B.
      (B)
    • C.
      (C)
      ✓
    • D.
      (D)

    Answer: C

    Solution

    Answer: (C) A valid identifier matches letter (letter | digit)*. The correct NFA reads exactly one letter to reach the accepting (double-circle) state, then has an epsilon-structured loop that consumes any number of further letters or digits and returns to the accepting state. Option (C) is the automaton whose epsilon-transitions correctly implement the (letter | digit)* loop after the first letter. The others either accept the empty string or wire the epsilon-loop so it does not faithfully realize (letter | digit)*.
  20. Question 20Algorithmsmcq1 mark
    An adversary generates keys to maximize collisions in a hash table ( keys, slots, ). Which is the best hashing strategy?
    • A.
      Division method h(k)=k mod m.
    • B.
      Multiplication method.
    • C.
      Universal hashing method.
      ✓
    • D.
      If k is prime use Division, else Multiplication.

    Answer: C

    Solution

    Answer: (C) Universal hashing method For any fixed hash function (division or multiplication), an adversary who knows it can choose keys that all collide. Universal hashing picks the hash function randomly from a family, so no adversary (choosing keys before the function is drawn) can force many collisions — the expected number of collisions is bounded.
  21. Question 21Digital Logicmcq1 mark
    The output of a 2-input multiplexer is connected back to one of its inputs (input 0), with the other input being data and S the select line, as shown. This circuit is functionally equivalent to a
    GATE CS 2023 Question 21 figure
    • A.
      D Flip-flop
    • B.
      D Latch
      ✓
    • C.
      Half-adder
    • D.
      Demultiplexer

    Answer: B

    Solution

    Answer: (B) D Latch When the mux passes the data input (transparent), and when it passes the fed-back output (holds the previous value). This level-sensitive "pass when enabled, hold otherwise" behaviour is exactly a D latch (not an edge-triggered flip-flop).
  22. Question 22Operating Systemsmsq1 mark
    Which need to be saved on a context switch from one thread T1 to another thread T2 of the SAME process?
    • A.
      Page table base register
    • B.
      Stack pointer
      ✓
    • C.
      Program counter
      ✓
    • D.
      General purpose registers
      ✓

    Answer: B, C, D

    Solution

    Answer: (B), (C) and (D) Threads of the same process share the address space, so the page-table base register does NOT change -> (A) not needed. Each thread has its own execution context: stack pointer (B), program counter (C), and general-purpose registers (D) must be saved and restored.
  23. Question 23Operating Systemsmsq1 mark
    Which guarantee a transition from user mode to kernel mode?
    • A.
      Function Call
    • B.
      malloc Call
    • C.
      Page Fault
      ✓
    • D.
      System Call
      ✓

    Answer: C, D

    Solution

    Answer: (C) and (D) A page fault is a trap handled by the kernel -> always enters kernel mode (C). A system call explicitly traps to the kernel (D). An ordinary function call stays in user mode (A); malloc is a library routine that usually runs in user space and only sometimes makes a system call, so it does not always transition (B).
  24. Question 24Theory of Computationmsq1 mark
    Which statements are CORRECT?
    • A.
      The intersection of two regular languages is regular.
      ✓
    • B.
      The intersection of two context-free languages is context-free.
    • C.
      The intersection of two recursive languages is recursive.
      ✓
    • D.
      The intersection of two recursively enumerable languages is recursively enumerable.
      ✓

    Answer: A, C, D

    Solution

    Answer: (A), (C) and (D) Regular, recursive, and recursively enumerable languages are all closed under intersection -> (A),(C),(D) true. Context-free languages are NOT closed under intersection (e.g. is the intersection of two CFLs but is not context-free) -> (B) false.
  25. Question 25Computer Networksmsq1 mark
    Which statements about OSPF are INCORRECT?
    • A.
      OSPF implements Bellman-Ford algorithm to find shortest paths.
      ✓
    • B.
      OSPF uses Dijkstra's shortest path algorithm.
    • C.
      OSPF is used as an inter-domain routing protocol.
      ✓
    • D.
      OSPF implements hierarchical routing.

    Answer: A, C

    Solution

    Answer: (A) and (C) OSPF is a link-state protocol that uses Dijkstra's algorithm (so B is correct, A is incorrect). OSPF is an INTRA-domain (interior gateway) protocol, not inter-domain (so C is incorrect; BGP is inter-domain). OSPF does support hierarchical routing via areas (D correct). The incorrect statements are A and C.
  26. Question 26Discrete Mathematicsmsq1 mark
    Geetha's conjecture is . Which option(s) would imply it?
    • A.
    • B.
      ✓
    • C.
      ✓
    • D.

    Answer: B, C

    Solution

    Answer: (B) and (C) - (B) makes true for every , hence the conjecture holds. Implies. - (C) : a single works for all , so in particular each has such a . Implies. - (A),(D) only assert something for SOME , which does not establish the universally-quantified conjecture.
  27. Question 27Operating Systemsmsq1 mark
    Which CPU scheduling algorithms can potentially cause starvation?
    • A.
      First-in First-Out
      ✓
    • B.
      Round Robin
    • C.
      Priority Scheduling
      ✓
    • D.
      Shortest Job First
      ✓

    Answer: A, C, D

    Solution

    Answer: (A), (C) and (D) (the official key accepted both {A,C,D} and {C,D}) Priority scheduling can indefinitely postpone low-priority processes (C), and Shortest Job First can starve long jobs when short jobs keep arriving (D). Round Robin is starvation-free (B). FIFO serves strictly in arrival order; GATE's key accepted answers both including and excluding (A), so the marked set is {A, C, D}.
  28. Question 28Engineering Mathematicsmsq1 mark
    Let . Which statements are TRUE?
    • A.
      f(x) does not have a local maximum.
    • B.
      f(x) has a local maximum.
      ✓
    • C.
      f(x) does not have a local minimum.
    • D.
      f(x) has a local minimum.
      ✓

    Answer: B, D

    Solution

    Answer: (B) and (D) , so critical points at . : -> local maximum at (B); -> local minimum at (D).
  29. Question 29Algorithmsmsq1 mark
    and . Which statements are TRUE?
    • A.
      ✓
    • B.
    • C.
      ✓
    • D.

    Answer: A, C

    Solution

    Answer: (A) and (C) so (A). so (C), which also rules out (B) and (D).
  30. Question 30Engineering Mathematicsnat1 mark
    Let be the adjacency matrix of the graph shown on vertices (note the self-loops). The value of is __________
    GATE CS 2023 Question 30 figure

    Answer: 2 to 4

    Solution

    Answer: 2 (GATE also accepted 4) The sum of all eigenvalues equals the trace of , i.e. the sum of its diagonal entries. The diagonal is nonzero only where a vertex has a self-loop — here vertices 3 and 4. Under the convention that a self-loop contributes to the diagonal, trace ; under the convention that an undirected self-loop contributes , trace . GATE accepted both and .
  31. Question 31Engineering Mathematicsnat1 mark
    The value of (rounded to nearest integer) is __________

    Answer: 0

    Solution

    Answer: 0 Integrate over : (the odd integrates to 0). Then (odd in over symmetric limits). So the whole integral is .
  32. Question 32Digital Logicnat1 mark
    A number is written as 132 in radix-4. The same number in radix-5 is __________

    Answer: 110

    Solution

    Answer: 110 . Convert to base 5: .
  33. Question 33Computer Organization & Architecturenat1 mark
    A 3-stage pipeline has stage delays 10 ns, 20 ns, 14 ns. No hazards, one instruction fetched per cycle. The total execution time for 100 instructions is __________ ns

    Answer: 2040

    Solution

    Answer: 2040 Clock period ns. Time for instructions in a -stage pipeline ns.
  34. Question 34Computer Organization & Architecturenat1 mark
    Keyboard: 1 keystroke/sec. Polling every 10 ms costs 100 us/poll; a detected key costs 200 us extra. = fraction of a second in polling+processing. Interrupts: 1 ms to service+process each keystroke; = fraction of a second. The ratio (one decimal) is __________

    Answer: 10.2

    Solution

    Answer: 10.2 Polling: 100 polls/sec , plus 1 keystroke . s. Interrupts: 1 keystroke ms . s. .
  35. Question 35Programming & Data Structuresnat1 mark
    The integer printed by the C program (funcp uses static int x=1; x++; return x;, called twice in main) is __________
    int funcp(){ static int x = 1; x++; return x; }
    int main(){
       int x,y;
       x = funcp();
       y = funcp()+x;
       printf("%d\n", (x+y));
    }

    Answer: 7

    Solution

    Answer: 7 x = funcp(): static x becomes 2, returns 2, so x=2. y = funcp()+x: static x becomes 3, returns 3, so y=3+2=5. Print x+y = 2+5 = 7.
  36. Question 36Compiler Designmcq2 marks
    For the given program (main calls f1(); f2(2); f3();, where f2 calls f3() then recurses), which option represents the activation tree of main?
    GATE CS 2023 Question 36 figure
    • A.
      (A)
      ✓
    • B.
      (B)
    • C.
      (C)
    • D.
      (D)

    Answer: A

    Solution

    Answer: (A) main calls f1, then f2(2), then f3. Inside f2(2): it first calls f3, then (since X!=1) calls f2(1); f2(1) calls f3 then f1. So under f2 the children are f3 and f2(1), and under f2(1) are f3 and f1. The activation tree with main's children {f1, f2, f3}, f2's children {f3, f2}, and the inner f2's children {f3, f1} matches option (A).
  37. Question 37Compiler Designmcq2 marks
    For the control flow graph shown (blocks B1-B4, with B1: i=m-1, j=n, a=10; B2: i=i+1, j=j-1; B3: a=20; B4: i=a+1), which choice lists the live variables at the EXIT of each basic block?
    GATE CS 2023 Question 37 figure
    • A.
      B1: {}, B2: {a}, B3: {a}, B4: {a}
    • B.
      B1: {i,j}, B2: {a}, B3: {a}, B4: {i}
    • C.
      B1: {a,i,j}, B2: {a,i,j}, B3: {a,i}, B4: {a}
    • D.
      B1: {a,i,j}, B2: {a,j}, B3: {a,j}, B4: {a,i,j}
      ✓

    Answer: D

    Solution

    Answer: (D) B1: {a,i,j}, B2: {a,j}, B3: {a,j}, B4: {a,i,j} Compute live variables backward (a variable is live at a point if it is used later before being redefined). Tracing the uses — B4 uses (and loops back using ), B2 uses , B3 defines used in B4 — gives the live-out sets B1:{a,i,j}, B2:{a,j}, B3:{a,j}, B4:{a,i,j}, matching option (D).
  38. Question 38Operating Systemsmcq2 marks
    incr/decr each do wait(s); X=X±1; signal(s). 5 threads call incr, 3 call decr, initial X=10. I-1: s binary semaphore =1. I-2: s counting semaphore =2. are final X values. Which gives the MINIMUM possible ?
    • A.
      15, 7
    • B.
      7, 7
    • C.
      12, 7
      ✓
    • D.
      12, 8

    Answer: C

    Solution

    Answer: (C) 12, 7 5 threads call incr (X+1), 3 call decr (X-1); initial X=10. - I-1 (binary semaphore = 1): mutual exclusion holds, so every update applies: (fixed; its minimum is 12). - I-2 (counting semaphore = 2): up to two threads are in the critical section at once, so increments can be lost through races. Minimizing by losing increments while keeping decrements, the smallest reachable value is . Hence .
  39. Question 39Theory of Computationmcq2 marks
    Consider : , . Which statement is CORRECT?
    • A.
    • B.
      ✓
    • C.
    • D.
      is not a regular language

    Answer: B

    Solution

    Answer: (B) generates (any number of leading 's, one middle symbol, any number of trailing 's — at least one symbol). The rule wraps matched 's and 's around, but these are absorbed into the form. So , which is regular.
  40. Question 40Theory of Computationmcq2 marks
    The PDA shown (states , start , accepts by empty stack) runs on . Which language does it accept?
    GATE CS 2023 Question 40 figure
    • A.
      ✓
    • B.
    • C.
    • D.

    Answer: A

    Solution

    Answer: (A) In state each 'a' pushes an (so at least one is needed, ). Reading 'b' moves to and pops one per . To empty the stack and accept, at least one must still be removed by an epsilon-transition after the 's - so there must be strictly more 's than 's, i.e. . Hence the language is .
  41. Question 41Computer Organization & Architecturemcq2 marks
    For a[i]=b[i]*8 (int = 32-bit, byte-addressable), the assembly uses shl r5,r5,U1, add r3,r3,U2, add r4,r4,U3, jmp U4. Which replaces (U1,U2,U3,U4)?
    • A.
      (8, 4, 1, L02)
    • B.
      (3, 4, 4, L01)
      ✓
    • C.
      (8, 1, 1, L02)
    • D.
      (3, 1, 1, L01)

    Answer: B

    Solution

    Answer: (B) (3, 4, 4, L01) Multiplying by 8 is a left shift by 3 -> U1=3. Arrays a and b hold 32-bit ints (4 bytes), so advancing to the next element adds 4 to each base pointer -> U2=4, U3=4. The loop jumps back to the comparison at the top -> U4=L01. So (3,4,4,L01).
  42. Question 42Computer Organization & Architecturemcq2 marks
    A 4 KB memory uses four 1 KB blocks. Address lines IA4, IA3 go to a decoder driving the chip-selects (active high); the remaining ten of IA11-IA0 go to the 10-bit address port. What are the starting addresses (IA11-IA0 in decimal) of blocks X1, X2, X3, X4?
    GATE CS 2023 Question 42 figure
    • A.
      (0, 1, 2, 3)
    • B.
      (0, 1024, 2048, 3072)
    • C.
      (0, 8, 16, 24)
      ✓
    • D.
      (0, 0, 0, 0)

    Answer: C

    Solution

    Answer: (C) (0, 8, 16, 24) A block is selected by the decoder from (IA4, IA3), while its internal start (Addr=0) sets the ten address-port bits to 0. So the starting address of each block is determined solely by its (IA4,IA3) code:
    X1: IA4IA3=00 -> 0
    X2: IA4IA3=01 -> 2^3 = 8
    X3: IA4IA3=10 -> 2^4 = 16
    X4: IA4IA3=11 -> 2^4+2^3 = 24
  43. Question 43Digital Logicmcq2 marks
    A circuit uses T, D, T flip-flops with outputs Q1, Q2, Q3 (initially 0,1,1). Which value of (Q1,Q2,Q3) can NEVER be obtained?
    GATE CS 2023 Question 43 figure
    • A.
      (0, 0, 1)
      ✓
    • B.
      (1, 0, 0)
    • C.
      (1, 0, 1)
    • D.
      (1, 1, 1)

    Answer: A

    Solution

    Answer: (A) (0, 0, 1) Deriving the next-state equations from the flip-flop connections and simulating the state sequence starting from shows the circuit cycles through a fixed set of states. The state never appears in that reachable sequence, so it can never be obtained.
  44. Question 44Digital Logicmcq2 marks
    Two 4-input MUXes (M1, M2) and one 2-input MUX (M3), with select lines A, B, C as shown, realize a function. Which set of inputs realises ?
    GATE CS 2023 Question 44 figure
    • A.
      (1, 1, 0, 0, 1, 1, 1, 0)
    • B.
      (1, 1, 0, 0, 1, 1, 0, 1)
    • C.
      (1, 1, 0, 1, 1, 1, 0, 0)
      ✓
    • D.
      (0, 0, 1, 1, 0, 1, 1, 1)

    Answer: C

    Solution

    Answer: (C) (1, 1, 0, 1, 1, 1, 0, 0) Simplify the target: . Building the truth table of over and mapping each minterm to the corresponding multiplexer data input (M3 selects between M1 and M2 via A, each selecting via B,C) assigns the input values , matching option (C).
  45. Question 45Computer Organization & Architecturemcq2 marks
    IEEE-754 single precision and . Which is in single precision?
    • A.
      0x404C2EF4
    • B.
      0x405C2EF4
    • C.
      0xC15C2EF4
      ✓
    • D.
      0xC14C2EF4

    Answer: C

    Solution

    Answer: (C) 0xC15C2EF4 decodes to (sign 1, exponent 131, mantissa 1.0). Multiplying by just flips the sign and adds 4 to 's exponent, leaving 's mantissa unchanged. 's exponent , sign , so the result is .
  46. Question 46Programming & Data Structuresmcq2 marks
    A priority queue is a max-heap. Extract-Max deletes the max; Insert adds a key; both preserve the heap. With elements, the worst-case running times are
    • A.
      Both O(1).
    • B.
      Both O(log n).
      ✓
    • C.
      Extract-Max O(1), Insert O(n).
    • D.
      Extract-Max O(1), Insert O(log n).

    Answer: B

    Solution

    Answer: (B) Both O(log n) Insert appends at the end and sifts up — . Extract-Max removes the root, moves the last element to the root, and sifts down — . Both are in the worst case.
  47. Question 47Programming & Data Structuresmcq2 marks
    foo(p) returns p->val + foo(p->left) + foo(p->right) and prints that sum. For the binary tree shown (root 10; left subtree root 5 with children 3,8; right subtree root 11 with right child 13), what does foo print when called on the root?
    GATE CS 2023 Question 47 figure
    • A.
      3 8 5 13 11 10
    • B.
      3 5 8 10 11 13
    • C.
      3 8 16 13 24 50
      ✓
    • D.
      3 16 8 50 24 13

    Answer: C

    Solution

    Answer: (C) 3 8 16 13 24 50 foo computes subtree sums and prints each AFTER recursing (post-order), printing the subtree sum:
    foo(3)=3        -> prints 3
    foo(8)=8        -> prints 8
    foo(5)=5+3+8=16 -> prints 16
    foo(13)=13      -> prints 13
    foo(11)=11+0+13=24 -> prints 24
    foo(10)=10+16+24=50 -> prints 50
    Output: 3 8 16 13 24 50.
  48. Question 48Discrete Mathematicsmcq2 marks
    , with , . A permutation separates A from B if all of A precede all of B, or all of B precede all of A. How many permutations of U separate A from B?
    • A.
    • B.
    • C.
    • D.
      ✓

    Answer: D

    Solution

    Answer: (D) Choose the positions for : ways; arrange the other elements in the rest: . Within the chosen ordered slots, put the -block before the -block (or vice versa): factor ; order the elements of () and of (). Total .
  49. Question 49Discrete Mathematicsmsq2 marks
    is onto. Define if , with equivalence classes . Define by . Which statements are TRUE?
    • A.
      F is NOT well-defined.
    • B.
      F is an onto (surjective) function.
      ✓
    • C.
      F is a one-to-one (injective) function.
      ✓
    • D.
      F is a bijective function.
      ✓

    Answer: B, C, D

    Solution

    Answer: (B), (C) and (D) is well-defined (any two representatives of a class map to the same -value) -> (A) false. is onto because is onto (B). is injective: distinct classes have distinct -values by construction (C). Being both injective and surjective, is a bijection (D).
  50. Question 50Computer Networksmsq2 marks
    myTCP runs over 100 Mbps with RTT 150 ms and maximum segment lifetime 2 minutes. Which are valid lengths of the Sequence Number field?
    • A.
      30 bits
    • B.
      32 bits
      ✓
    • C.
      34 bits
      ✓
    • D.
      36 bits
      ✓

    Answer: B, C, D

    Solution

    Answer: (B), (C) and (D) The sequence number must not wrap within the maximum segment lifetime (120 s). Bytes sent in 120 s bytes. We need , i.e. bits . So 32, 34, 36 bits are valid; 30 bits () is too small.
  51. Question 51Discrete Mathematicsmsq2 marks
    is a set, its powerset, with operation . . Which statements are correct?
    • A.
      H is a group.
      ✓
    • B.
      Every element has an inverse, but H is NOT a group.
    • C.
      For every A, the inverse of A is the complement of A.
    • D.
      For every A, the inverse of A is A.
      ✓

    Answer: A, D

    Solution

    Answer: (A) and (D) (symmetric difference) is associative and commutative, the identity is (), and each is its own inverse since . So is a group (A), and the inverse of is (D), not its complement (C).
  52. Question 52Computer Networksmsq2 marks
    Clicking www.gate-2023.in triggers an iterative DNS lookup over a 3-tier hierarchy (nothing cached). RTT is the same to DNS servers and to the web server. The HTML has negligible transmission/rendering time and references 10 small objects on the same server. Which are CORRECT about the minimum elapsed time to fully render?
    • A.
      7 RTTs, non-persistent HTTP with 5 parallel TCP connections.
    • B.
      5 RTTs, persistent HTTP with pipelining.
    • C.
      9 RTTs, non-persistent HTTP with 5 parallel TCP connections.
      ✓
    • D.
      6 RTTs, persistent HTTP with pipelining.
      ✓

    Answer: C, D

    Solution

    Answer: (C) and (D) DNS (iterative, 3-tier) takes 3 RTTs (local server queries root, TLD, authoritative). Then: - Persistent HTTP with pipelining: 1 RTT for TCP handshake + 1 RTT to fetch the HTML + 1 RTT to pipeline all 10 objects more RTTs. Total RTTs -> (D). - Non-persistent with 5 parallel connections: 1 RTT (connect) + 1 RTT (HTML), then 10 objects in 2 rounds of 5 parallel connections, each round costing 2 RTTs (connect + fetch) RTTs. Total RTTs -> (C).
  53. Question 53Engineering Mathematicsmsq2 marks
    Two fair coins are tossed. A = HEAD on both; B = HEAD on first; C = HEAD on second. Which statements are TRUE?
    • A.
      A and B are independent.
    • B.
      A and C are independent.
    • C.
      B and C are independent.
      ✓
    • D.
      Prob(B|C) = Prob(B)
      ✓

    Answer: C, D

    Solution

    Answer: (C) and (D) , -> B and C independent (C), and (D). But , so A,B not independent (A false); similarly A,C not independent (B false).
  54. Question 54Algorithmsmsq2 marks
    Function 1: while n>1: for i=1..n: x++; n=floor(n/2). Function 2: for i=1..100*n: x++. count the x++ executions. Which statements are TRUE?
    • A.
      ✓
    • B.
    • C.
    • D.
      ✓

    Answer: A, D

    Solution

    Answer: (A) and (D) . . Since both are : (A) and (D). They are the same order, so (B) and (C) are false.
  55. Question 55Discrete Mathematicsmsq2 marks
    Greedy coloring assigns each the smallest color not used by its already-colored neighbours. is the maximum degree. Which statements are TRUE?
    • A.
      This procedure results in a proper vertex coloring.
      ✓
    • B.
      The number of colors used is at most Delta(G)+1.
      ✓
    • C.
      The number of colors used is at most Delta(G).
    • D.
      The number of colors used equals the chromatic number.

    Answer: A, B

    Solution

    Answer: (A) and (B) Greedy coloring never gives two adjacent vertices the same color -> proper coloring (A). A vertex has at most neighbours, so among colors at least one is free -> at most colors (B). It may use more than and more than the chromatic number (greedy is not optimal), so (C),(D) false.
  56. Question 56Discrete Mathematicsnat2 marks
    , has vertex set ; is an edge iff and ( or ). is the set of BFS visit orderings from . The cardinality of is __________

    Answer: 5040

    Solution

    Answer: 5040 Starting BFS from (which is a subset of every other set, so is adjacent to all 7 other vertices), all 7 remaining vertices are at BFS level 1 and can be visited in any order. The number of orderings is .
  57. Question 57Operating Systemsnat2 marks
    int D[128][128] is row-major; each frame holds 512 elements; 30 frames; LRU. The code does for i: for j: D[j][i]*=10 (column-major access). The number of page faults is __________

    Answer: 4096

    Solution

    Answer: 4096 has elements, per frame, so pages; each page holds 4 full rows (since a row is 128 elements, rows per page). The access pattern D[j][i] sweeps a whole column (all 128 rows) for each , touching all 32 pages each time. With only 30 frames (LRU), every access to a page that was evicted faults. The total works out to page faults.
  58. Question 58Operating Systemsnat2 marks
    57-bit virtual addressing, multi-level page tables with L levels, page size 4 KB, each PTE 8 bytes. The value of L is __________

    Answer: 5

    Solution

    Answer: 5 Page offset bits, so the VPN is bits. One page holds entries, so each level indexes 9 bits. Levels .
  59. Question 59Programming & Data Structuresnat2 marks
    Sequence . Push into stack S; enqueue into queue Q; then: pop S, dequeue Q, pop S, dequeue Q; dequeue Q and push into S (repeat 3 times); pop S; pop S. The top element of S afterwards is __________

    Answer: 8

    Solution

    Answer: 8 After the pushes S (top->bottom) = 2,9,8,7,5,1 and Q (front->back)=1,5,7,8,9,2.
    pop S -> 2        (S: 9 8 7 5 1)
    dequeue Q -> 1    (Q: 5 7 8 9 2)
    pop S -> 9        (S: 8 7 5 1)
    dequeue Q -> 5    (Q: 7 8 9 2)
    dequeue+push x4: move 7,8,9,2 from Q onto S
      -> S: 2 9 8 7 8 7 5 1   (pushes 7, then 8, then 9, then 2 on top)
    pop S -> 2        (S: 9 8 7 8 7 5 1)
    pop S -> 9        (S: 8 7 8 7 5 1)
    Top of S is 8.
  60. Question 60Compiler Designnat2 marks
    For the SDT computing a signed binary value (N -> I # F), the value computed for input "10#011" (rounded to three decimals) is __________

    Answer: 2.374 to 2.376

    Solution

    Answer: 2.375 before # is the integer part "10" ; after # is the fraction ".011" . .
  61. Question 61Databasesnat2 marks
    For the Student table (rows: 1 Naman M 62, 2 Aliya F 70, 3 Aliya F 80, 4 James M 82, 5 Swati F 65), the query SELECT * FROM Student WHERE gender='F' AND marks>65 returns __________ rows

    Answer: 2

    Solution

    Answer: 2 Female students: Aliya(70), Aliya(80), Swati(65). Of these, marks : Aliya(70) and Aliya(80). Swati(65) is not . So 2 rows.
  62. Question 62Databasesnat2 marks
    A primary-indexed ordered file has 25,000 fixed-length records of 100 bytes (primary key 15 bytes). Block size 1024 bytes, block pointer 5 bytes. Binary search on the index takes ceil(log2 b) accesses for b index blocks. The worst-case block accesses to find the block possibly containing a key is __________
    GATE CS 2023 Question 62 figure

    Answer: 6

    Solution

    Answer: 6 Records per data block , so data blocks . A primary (sparse) index has one entry per data block; each index entry bytes, so entries per index block . Index blocks . Binary search block accesses.
  63. Question 63Theory of Computationnat2 marks
    The minimum number of states in a DFA for does not contain three or more consecutive 1's is __________

    Answer: 4

    Solution

    Answer: 4 Track the number of trailing 1's: state (0 trailing 1's / reset), (one trailing 1), (two trailing 1's) — all accepting — and a dead state reached on the third consecutive 1. That is 4 states, and they are pairwise distinguishable, so 4 is minimum.
  64. Question 64Computer Organization & Architecturenat2 marks
    An 8-way set associative cache of size 64 KB is used with a 32-bit address (TAG, INDEX, BLOCK OFFSET). The number of TAG bits is __________

    Answer: 19

    Solution

    Answer: 19 Cache size bytes, 8-way (). The sets-times-block portion is , so INDEX OFFSET bits. TAG bits (independent of the specific block size).
  65. Question 65Computer Networksnat2 marks
    The router's forwarding table: 200.150.0.0/16->1, 200.150.64.0/19->2, 200.150.68.0/24->3, 200.150.68.64/27->4, Default->0. A packet to 200.150.68.118 is forwarded to interface ID __________

    Answer: 3

    Solution

    Answer: 3 Check matches (longest prefix wins):
    /16  200.150.0.0      -> matches (iface 1)
    /19  200.150.64.0     -> 68 in 64..95? yes third-octet range -> matches (iface 2)
    /24  200.150.68.0     -> third octet 68 matches -> matches (iface 3)
    /27  200.150.68.64    -> host range 64..95; 118 > 95 -> NO match
    Longest matching prefix is /24 -> interface 3.

Practice the full paper with a timer

Attempt GATE CS 2023 in the exact GATE interface and get a detailed score and topic-wise analysis — free.

Create free account →