GATE CS
    Previous Year Papers
    Verified Solutions Included
    GATE CS 2024_Set2 Question Paper with Solutions: 65 Questions, Answer Key & Section-wise Analysis

    GATE CS 2024_Set2 previous year paper: 65 questions with answer key and detailed solutions, section-wise breakdown and free sample questions.

    65 Qs

    Total Questions

    100 Marks

    Total Marks

    0 Mins

    Duration

    +3 / -1 / 0

    Marking Scheme

    Section-wise Paper Structure

    Engineering Mathematics

    10 Qs

    15% of total marks

    Computer Organization and Architecture

    7 Qs

    11% of total marks

    Programming and Data Structures

    6 Qs

    9% of total marks

    Databases

    6 Qs

    9% of total marks

    Computer Networks

    6 Qs

    9% of total marks

    Quantitative Aptitude

    5 Qs

    8% of total marks

    Operating System

    5 Qs

    8% of total marks

    Compiler Design

    5 Qs

    8% of total marks

    Theory of Computation

    4 Qs

    6% of total marks

    Digital Logic

    3 Qs

    5% of total marks

    Algorithms

    3 Qs

    5% of total marks

    Verbal Aptitude

    2 Qs

    3% of total marks

    Analytical Aptitude

    2 Qs

    3% of total marks

    Spatial Aptitude

    1 Qs

    2% of total marks

    Free Solved Questions with Step-by-Step Solutions

    Authentic examination problems with detailed derivations and answer keys.

    Question 1
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    Let and be the following propositions:

    : Fail grade can be given.
    : Student scores more than 50% marks.

    Consider the statement: “Fail grade cannot be given when student scores more than 50% marks.”

    Which one of the following is the CORRECT representation of the above statement in propositional logic?
    Question 2
    2024 Slot Set2 PYQ
    Level 3: Exam Standard

    Let be a continuous function from to such that

    Which one of the following options is the CORRECT value of ?

    Question 3
    2024 Slot Set2 PYQ
    Level 3: Exam Standard

    Let be the adjacency matrix of a simple undirected graph . Suppose is its own inverse. Which one of the following statements is always TRUE?

    Question 4
    2024 Slot Set2 PYQ
    Level 3: Exam Standard

    Consider a computer with a 4 MHz processor. Its DMA controller can transfer 8 bytes in 1 cycle from a device to main memory through cycle stealing at regular intervals. Which one of the following is the data transfer rate (in bits per second) of the DMA controller if 1% of the processor cycles are used for DMA?

    Question 5
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    The format of a single-precision floating-point number as per the IEEE 754 standard is:

    Sign(1bit)Exponent(8 bits)Mantissa(23 bits)

    Choose the largest floating-point number among the following options.
    Question 6
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    An instruction format has the following structure:

    Instruction Number: Opcode destination reg, source reg-1, source reg-2

    Consider the following sequence of instructions to be executed in a pipelined processor:

    I1: DIV R3, R1, R2
    I2: SUB R5, R3, R4
    I3: ADD R3, R5, R6
    I4: MUL R7, R3, R8

    Which of the following statements is/are TRUE?
    Question 7
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    Consider the following C program. Assume parameters to a function are evaluated from right to left.

    #include <stdio.h>

    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));
    }

    Which one of the following options is the CORRECT output of the above C program?
    Question 8
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    Consider the following C function definition.

    int fX(char *a){
     char *b = a;
     while(*b)
      b++;
     return b - a;}

    Which of the following statements is/are TRUE?
    Question 9
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    What is the output of the following C program?

    #include <stdio.h>

    int main() {
      double a[2]={20.0, 25.0}, *p, *q;
      p = a;
      q = p + 1;
      printf(”%d,%d”, (int)(q – p), (int)(*q – *p));
      return 0;}
    Question 10
    2024 Slot Set2 PYQ

    Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called

    Question 11
    2024 Slot Set2 PYQ

    In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?

    Question 12
    2024 Slot Set2 PYQ

    Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?

    Question 13
    2024 Slot Set2 PYQ
    Node X has a TCP connection open to node Y. The packets from X to Y go through an intermediate IP router R. Ethernet switch S is the first switch on the network path between X and R. Consider a packet sent from X to Y over this connection.

    Which of the following statements is/are TRUE about the destination IP and MAC addresses on this packet at the time it leaves X?
    Question 14
    2024 Slot Set2 PYQ

    Which of the following statements about IPv4 fragmentation is/are TRUE?

    Question 15
    2024 Slot Set2 PYQ

    Which of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?

    Question 16
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    Two wizards try to create a spell using all the four elements, water, air, fire, and earth. For this, they decide to mix all these elements in all possible orders. They also decide to work independently. After trying all possible combination of elements, they conclude that the spell does not work.

    How many attempts does each wizard make before coming to this conclusion, independently?
    Question 17
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    In an engineering college of 10,000 students, 1,500 like neither their core branches nor other branches. The number of students who like their core branches is of the number of students who like other branches. The number of students who like both their core and other branches is 500.

    The number of students who like their core branches is
    Question 18
    2024 Slot Set2 PYQ
    Level 3: Exam Standard

    For positive non-zero real variables and , if

    then, the value of

    is

    Question 19
    2024 Slot Set2 PYQ

    Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory management?

    Question 20
    2024 Slot Set2 PYQ

    Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running state (e.g., ready, blocked)?

    Question 21
    2024 Slot Set2 PYQ
    Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU burst time.

    A (0, 10), B (2, 6), C (4, 3), and D (6, 7).

    Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?
    Question 22
    2024 Slot Set2 PYQ
    Level 2: Moderate
    Consider the following two sets:

    Set XSet YP.Lexical Analyzer1.Abstract Syntax TreeQ.Syntax Analyzer2.TokenR.Intermediate Code Generator3.Parse TreeS.Code Optimizer4.Constant Folding

    Which one of the following options is the CORRECT match from Set X to Set Y ?
    Question 23
    2024 Slot Set2 PYQ

    Which of the following statements is/are FALSE?

    Question 24
    2024 Slot Set2 PYQ
    Consider the following context-free grammar where the start symbol is and the set of terminals is . The following is a partially-filled LL(1) parsing table.

    abcd$SS → AaAbS → BbBa(1)(2)AA → ε(3)A → cSB(4)B → εB → dS

    Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table?

    Note: In the options, “blank” denotes that the corresponding cell is empty.
    Question 25
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    Which one of the following regular expressions is equivalent to the language accepted by the DFA given below?

    0011
    Question 26
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    Let be the 5-state NFA with -transitions shown in the diagram below.

    12345εε00ε11

    Which one of the following regular expressions represents the language accepted by ?
    Question 27
    2024 Slot Set2 PYQ

    Consider a context-free grammar with the following 3 rules.

    Let . Let , , denote the number of times occur in , respectively. Which of the following statements is/are TRUE?

    Question 28
    2024 Slot Set2 PYQ
    Level 1: Warm-up

    For a Boolean variable , which of the following statements is/are FALSE?

    Question 29
    2024 Slot Set2 PYQ
    Level 3: Exam Standard

    Which of the following is/are EQUAL to 224 in radix-5 (i.e., base-5) notation?

    Question 30
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    Consider 4-variable functions , , , expressed in sum-of-minterms form as given below. f1f2f3f4ANDORXORY

    With respect to the circuit given above, which of the following options is/are CORRECT?
    Question 31
    2024 Slot Set2 PYQ

    Let be the recurrence relation defined as follows:

    Which one of the following statements is TRUE?

    Question 32
    2024 Slot Set2 PYQ

    Let be an array containing integer values. The distance of is defined as the minimum number of elements in that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array is ___________

    Question 33
    2024 Slot Set2 PYQ
    Level 4: Challenger
    The number of distinct minimum-weight spanning trees of the following graph is __________

    abfgced121332222211
    Question 34
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    If ‘’ denotes increasing order of intensity, then the meaning of the words
    [walk jog sprint] is analogous to [bothered ________ daunted].

    Which one of the given options is appropriate to fill the blank?
    Question 35
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    Sequence the following sentences in 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.
    Question 36
    2024 Slot Set2 PYQ
    Level 3: Exam Standard

    In the sequence , a possible value of is

    Question 37
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    In the array shown below, each cell of the first three rows has either a cross (X) or a number.

    1X43X5543X6X

    The number in a cell represents the count of the immediate neighboring cells (left, right, top, bottom, diagonals) NOT having a cross (X). Given that the last row has no crosses (X), the sum of the four numbers to be filled in the last row is
    Question 38
    2024 Slot Set2 PYQ
    Level 3: Exam Standard
    A cube is to be cut into 8 pieces of equal size and shape. Here, each cut should be straight and it should not stop till it reaches the other end of the cube.

    The minimum number of such cuts required is

    Unlock All 65 Questions in Real Examination Mode

    Practice with the authentic timer, on-screen calculator, instant percentile ranking, and section-wise analytics.

    More GATE CS Previous Year Papers

    Free preview ends here

    Login to view the complete paper and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    GATE CS 2024_Set2 Question Paper with Solutions: 65 Questions, Answer Key & Section-wise Analysis

    GATE CS 2024_Set2 previous year paper: 65 questions with answer key and detailed solutions, section-wise breakdown and free sample questions.

    Paper breakdown

    65 questions · 100 marks. Engineering Mathematics: 10 · Computer Organization and Architecture: 7 · Programming and Data Structures: 6 · Databases: 6 · Computer Networks: 6 · Quantitative Aptitude: 5 · Operating System: 5 · Compiler Design: 5 · Theory of Computation: 4 · Digital Logic: 3 · Algorithms: 3 · Verbal Aptitude: 2 · Analytical Aptitude: 2 · Spatial Aptitude: 1

    Free sample questions from GATE CS 2024_Set2 Question Paper

    Question 1 · Engineering Mathematics · 2024_Set2 MCQ
    Let and be the following propositions:

    : Fail grade can be given.
    : Student scores more than 50% marks.

    Consider the statement: “Fail grade cannot be given when student scores more than 50% marks.”

    Which one of the following is the CORRECT representation of the above statement in propositional logic?
    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is a propositional translation question, recognizable because it asks to convert an English sentence with conditional keywords into a logical formula.

    Step 1: Identify the atomic propositions.

    : Fail grade can be given.

    : Student scores more than 50% marks.

    Step 2: Translate the conditional statement.

    The statement is: "Fail grade cannot be given when student scores more than 50% marks."

    The word "when" acts as "if". So, "If student scores more than 50% marks, then fail grade cannot be given."

    This translates to: If , then .

    In propositional logic, this is written as .

    Step 3: Match with the options.

    Option A matches .

    Answer: A

    Question 2 · Engineering Mathematics · 2024_Set2 MCQ

    Let be a continuous function from to such that

    Which one of the following options is the CORRECT value of ?

    1. A.

      0

    2. B.

      1

    3. C.

      2

    4. D.

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: Use the Reflection Property (King's Rule) of definite integrals to create a solvable algebraic equation for the unknown integral.

    Step 1: Let the required integral be .

    Step 2: Apply King's Rule, which states . For , this gives .

    Step 3: Use the given functional equation . Rearranging this yields .

    Step 4: Substitute this expression into the integral from Step 2:

    .

    Step 5: Use linearity to split the integral:

    .

    Step 6: Evaluate the first part and substitute for the second part:

    .

    Step 7: Solve the algebraic equation for :

    .

    Answer: 1 (Option B)

    Question 3 · Engineering Mathematics · 2024_Set2 MCQ

    Let be the adjacency matrix of a simple undirected graph . Suppose is its own inverse. Which one of the following statements is always TRUE?

    1. A.

      is a cycle

    2. B.

      is a perfect matching

    3. C.

      is a complete graph

    4. D.

      There is no such graph

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: implies . The diagonal entries of represent the degrees of the vertices, so every vertex must have a degree of exactly 1.

    Exam route: means for all . Since is the degree of vertex , every vertex has degree 1. This uniquely defines a perfect matching.

    Learning route:

    1. The condition is equivalent to , where is the identity matrix.
    2. This means that for every vertex , the diagonal entry .
    3. From the properties of adjacency matrices, equals the number of walks of length 2 from vertex to itself, which is exactly the degree of vertex in a simple graph.
    4. Therefore, every vertex in the graph must have a degree of exactly 1.
    5. A simple undirected graph where every vertex has degree exactly 1 is, by definition, a perfect matching (a disjoint union of components).
    6. Checking the options: A cycle has degree 2. A complete graph has degree . A perfect matching has degree 1.
    Question 4 · Computer Organization and Architecture · 2024_Set2 MCQ

    Consider a computer with a 4 MHz processor. Its DMA controller can transfer 8 bytes in 1 cycle from a device to main memory through cycle stealing at regular intervals. Which one of the following is the data transfer rate (in bits per second) of the DMA controller if 1% of the processor cycles are used for DMA?

    1. A.

      2,56,000

    2. B.

      3,200

    3. C.

      25,60,000

    4. D.

      32,000

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a DMA throughput calculation question, similar to P1 but with different units and a larger transfer size per cycle.

    Step 1: Calculate total CPU cycles per second. The processor is 4 MHz, which is cycles/second.

    Step 2: Calculate DMA cycles per second. 1% of total cycles: cycles/second.

    Step 3: Relate cycles to data. Each cycle transfers 8 bytes.

    Step 4: Calculate total bytes per second: bytes/second.

    Step 5: Convert to bits per second (since the question asks for bits per second). bits/second.

    Step 6: Match with the Indian numbering system format in the options. 2,560,000 is written as 25,60,000.

    Answer: C

    Question 5 · Computer Organization and Architecture · 2024_Set2 MCQ
    The format of a single-precision floating-point number as per the IEEE 754 standard is:

    Sign(1bit)Exponent(8 bits)Mantissa(23 bits)

    Choose the largest floating-point number among the following options.
    1. A. SignExponentMantissa00111 11111111 1111 1111 1111 1111 111
    2. B. SignExponentMantissa01111 11101111 1111 1111 1111 1111 111
    3. C. SignExponentMantissa01111 11111111 1111 1111 1111 1111 111
    4. D. SignExponentMantissa00111 11110000 0000 0000 0000 0000 000
    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is an IEEE 754 decoding and comparison problem. You must interpret the sign, exponent, and mantissa fields of each option to determine which represents the largest finite positive number.

    Step 1: Recall the IEEE 754 single-precision format.

    • Sign (1 bit): 0 for positive, 1 for negative.
    • Exponent (8 bits): Biased by 127. Range 1 to 254 for normalized numbers. 255 is reserved for Infinity/NaN.
    • Mantissa (23 bits): Fractional part. Normalized numbers have an implicit leading 1.

    Step 2: Analyze each option.

    • Option A: Sign=0, Exp=01111111 (127), Mantissa=all 1s.

    Value = .

    • Option B: Sign=0, Exp=11111110 (254), Mantissa=all 1s.

    Value = . This is the largest possible normalized positive number.

    • Option C: Sign=0, Exp=11111111 (255), Mantissa=all 1s.

    Value = NaN (Not a Number), because the exponent is all 1s and the mantissa is non-zero. NaN is not a valid numerical value and cannot be "largest".

    • Option D: Sign=0, Exp=01111111 (127), Mantissa=all 0s.

    Value = .

    Step 3: Compare the valid numerical values.

    Option B () is vastly larger than Option A () and Option D (). Option C is NaN.

    Answer: Option B

    Question 6 · Computer Organization and Architecture · 2024_Set2 MSQ
    An instruction format has the following structure:

    Instruction Number: Opcode destination reg, source reg-1, source reg-2

    Consider the following sequence of instructions to be executed in a pipelined processor:

    I1: DIV R3, R1, R2
    I2: SUB R5, R3, R4
    I3: ADD R3, R5, R6
    I4: MUL R7, R3, R8

    Which of the following statements is/are TRUE?
    1. A.

      There is a RAW dependency on R3 between I1 and I2

    2. B.

      There is a WAR dependency on R3 between I1 and I3

    3. C.

      There is a RAW dependency on R3 between I2 and I3

    4. D.

      There is a WAW dependency on R3 between I3 and I4

    Correct Answer:

    ["A"]

    Step-by-Step Solution

    Key idea: This is an instruction-level dependency analysis MSQ, recognisable because it gives a sequence of instructions with a specific format and asks which dependency statements are true.

    Step 1: Parse the instruction format carefully. The format is: Opcode destination, source-1, source-2. So the first register after the opcode is the destination (written), and the next two are sources (read).

    Step 2: List reads and writes for each instruction:

    • I1: DIV R3, R1, R2 W: R3; R: R1, R2
    • I2: SUB R5, R3, R4 W: R5; R: R3, R4
    • I3: ADD R3, R5, R6 W: R3; R: R5, R6
    • I4: MUL R7, R3, R8 W: R7; R: R3, R8

    Step 3: Evaluate option A: RAW on R3 between I1 and I2. I1 writes R3, I2 reads R3. This is Read After Write on R3. TRUE.

    Step 4: Evaluate option B: WAR on R3 between I1 and I3. For WAR, the earlier instruction must read R3 and the later one must write R3. I1 writes R3 (does not read it), I3 writes R3. Both write R3, so this is WAW, not WAR. FALSE.

    Step 5: Evaluate option C: RAW on R3 between I2 and I3. For RAW, I2 must write R3 and I3 must read R3. I2 writes R5 (not R3), and I3 writes R3 (does not read it). I2 reads R3 and I3 writes R3, which is WAR, not RAW. FALSE.

    Step 6: Evaluate option D: WAW on R3 between I3 and I4. For WAW, both must write R3. I3 writes R3, but I4 writes R7 (and reads R3). I3 writes R3 and I4 reads R3, which is RAW, not WAW. FALSE.

    Answer: A

    Question 7 · Programming and Data Structures · 2024_Set2 MCQ
    Consider the following C program. Assume parameters to a function are evaluated from right to left.

    #include <stdio.h>

    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));
    }

    Which one of the following options is the CORRECT output of the above C program?
    1. A.

      20101020

    2. B.

      10202010

    3. C.

      20102010

    4. D.

      10201020

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: Right-to-left evaluation means the rightmost argument is fully evaluated (including side effects like prints) before the left argument.

    Exam route: Evaluate h(20) first (prints 20), then g(10) (prints 10). Then execute f(10, 20), which prints 10 then 20. Total output: 20101020.

    Learning route:

    1. The call is f(g(10), h(20)). The problem explicitly states parameters are evaluated right-to-left.
    2. Rightmost argument: h(20) is evaluated first. It prints 20 and returns 20.
    3. Leftmost argument: g(10) is evaluated next. It prints 10 and returns 10.
    4. Now the function f is called with the evaluated arguments: f(10, 20).
    5. Inside f(int x, int y):
    • g(x) is called g(10). It prints 10.
    • h(y) is called h(20). It prints 20.
    1. Concatenating the prints in order: 20 (from arg eval), 10 (from arg eval), 10 (from f body), 20 (from f body).
    2. Final output string: 20101020.

    Trap: Assuming left-to-right evaluation (which yields 10201020) or assuming the function body executes before arguments are evaluated.

    Verification: Right-to-left argument evaluation is a standard GCC behavior and explicitly mandated by the problem statement.

    Question 8 · Programming and Data Structures · 2024_Set2 MSQ
    Consider the following C function definition.

    int fX(char *a){
     char *b = a;
     while(*b)
      b++;
     return b - a;}

    Which of the following statements is/are TRUE?
    1. A.

      The function call fX(”abcd”) will always return a value

    2. B.

      Assuming a character array c is declared as char c[] = ”abcd” in main(), the function call fX(c)will always return a value

    3. C.

      The code of the function will not compile

    4. D.

      Assuming a character pointer c is declared as char *c = ”abcd” in main(), the function call fX(c)will always return a value

    Correct Answer:

    ["A","B","D"]

    Step-by-Step Solution

    Insight: This tests string length calculation via pointer subtraction and the validity of passing different string representations to a char * parameter in C.

    Exam route: The function correctly computes length by advancing b until \0 and returning b - a. In C, string literals ("abcd"), character arrays (char c[]), and character pointers (char c) all decay to or are char , making all calls valid and returning 4.

    Learning route:

    1. The function fX takes a char a. It sets b = a and increments b until b is '\0' (false).
    2. It returns b - a, which is the number of characters traversed (the string length).
    3. Option A: fX("abcd"). In C, a string literal is of type char[] (not const char[] as in C++), so it decays to char *. The function reads it safely and returns 4. TRUE.
    4. Option B: char c[] = "abcd"; fX(c);. The array c decays to char * pointing to its first element. The function reads it safely and returns 4. TRUE.
    5. Option C: The code uses standard C pointer arithmetic and dereferencing. It compiles without error. FALSE.
    6. Option D: char c = "abcd"; fX(c);. c is already a char pointing to the string literal. The function reads it safely and returns 4. TRUE.
    Question 9 · Programming and Data Structures · 2024_Set2 MCQ
    What is the output of the following C program?

    #include <stdio.h>

    int main() {
      double a[2]={20.0, 25.0}, *p, *q;
      p = a;
      q = p + 1;
      printf(”%d,%d”, (int)(q – p), (int)(*q – *p));
      return 0;}
    1. A.

      4,8

    2. B.

      1,5

    3. C.

      8,5

    4. D.

      1,8

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: This tests pointer arithmetic rules, specifically that pointer subtraction yields the element count, while dereferenced subtraction yields the value difference.

    Exam route: q - p is the difference between &a[1] and &a[0], which is 1 element. q - p is 25.0 - 20.0 = 5.0, cast to int is 5. Output is 1,5.

    Learning route:

    1. p = a assigns p to the base address of the array, so p points to a[0] (value 20.0).
    2. q = p + 1 advances the pointer by one double element, so q points to a[1] (value 25.0).
    3. q - p: Pointer subtraction automatically divides the byte difference by sizeof(double), yielding the number of elements between them. Since they are adjacent, this is 1.
    4. q - p: Dereferences both pointers to get their values: 25.0 - 20.0 = 5.0.
    5. The (int) cast truncates 5.0 to 5.
    6. The printf outputs 1,5.
    Question 10 · Databases · 2024_Set2 MCQ

    Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called

    1. A.

      durability

    2. B.

      atomicity

    3. C.

      consistency

    4. D.

      isolation

    Question 11 · Databases · 2024_Set2 MCQ

    In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?

    1. A.

      The weak entity set MUST have total participation in the identifying relationship

    2. B.

      The owner entity set MUST have total participation in the identifying relationship

    3. C.

      Both weak and owner entity sets MUST have total participation in the identifying relationship

    4. D.

      Neither weak entity set nor owner entity set MUST have total participation in the identifying relationship

    Question 12 · Databases · 2024_Set2 MSQ

    Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?

    1. A.

      Sorted

    2. B.

      Heap

    3. C.

      Unclustered tree index

    4. D.

      Unclustered hash index

    Question 13 · Computer Networks · 2024_Set2 MSQ
    Node X has a TCP connection open to node Y. The packets from X to Y go through an intermediate IP router R. Ethernet switch S is the first switch on the network path between X and R. Consider a packet sent from X to Y over this connection.

    Which of the following statements is/are TRUE about the destination IP and MAC addresses on this packet at the time it leaves X?
    1. A.

      The destination IP address is the IP address of R

    2. B.

      The destination IP address is the IP address of Y

    3. C.

      The destination MAC address is the MAC address of S

    4. D.

      The destination MAC address is the MAC address of Y

    Question 14 · Computer Networks · 2024_Set2 MSQ

    Which of the following statements about IPv4 fragmentation is/are TRUE?

    1. A.

      The fragmentation of an IP datagram is performed only at the source of the datagram

    2. B.

      The fragmentation of an IP datagram is performed at any IP router which finds that the size of the datagram to be transmitted exceeds the MTU

    3. C.

      The reassembly of fragments is performed only at the destination of the datagram

    4. D.

      The reassembly of fragments is performed at all intermediate routers along the path from the source to the destination

    Question 15 · Computer Networks · 2024_Set2 MSQ

    Which of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?

    1. A.

      Source IP Address

    2. B.

      Protocol

    3. C.

      Time to Live (TTL)

    4. D.

      Header Checksum

    Question 16 · Quantitative Aptitude · 2024_Set2 MCQ
    Two wizards try to create a spell using all the four elements, water, air, fire, and earth. For this, they decide to mix all these elements in all possible orders. They also decide to work independently. After trying all possible combination of elements, they conclude that the spell does not work.

    How many attempts does each wizard make before coming to this conclusion, independently?
    1. A.

      24

    2. B.

      48

    3. C.

      16

    4. D.

      12

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: "all possible orders of all four elements" is the textbook trigger for ; "each wizard independently" does not multiply the per-wizard count.

    Exam route:

    • Four distinct elements, all used, order matters arrangements.
    • Each wizard works independently and tries all of them, so each wizard makes attempts.

    Learning route:

    The problem asks for the number of attempts <i>each</i> wizard makes. The two wizards are independent actors; the question is not asking for the total across both wizards.

    Step 1 — identify the counting task. We are arranging all four distinct elements (water, air, fire, earth) in a sequence. Order matters because "water, air, fire, earth" is a different mix from "air, water, fire, earth".

    Step 2 — apply the permutation-of-all formula. Arranging distinct objects in order gives outcomes. Here , so

    Step 3 — read the question carefully. "How many attempts does each wizard make, independently?" Each wizard runs through all arrangements on their own. The presence of a second wizard does not change the count per wizard.

    Verification: listing a few arrangements confirms the scale — starting with water there are arrangements, and there are choices for the first element, giving .

    Wrong-path autopsy:

    • (B) multiplies , confusing "each wizard" with "both wizards together".
    • (C) uses or , mixing up permutations with independent binary choices.
    • (D) uses or , either halving for a non-existent symmetry or stopping one step early.

    Generalisation: whenever a problem says "arrange all distinct objects in all possible orders", the answer is ; extra actors working independently do not change the per-actor count unless the question explicitly asks for a total.

    Question 17 · Quantitative Aptitude · 2024_Set2 MCQ
    In an engineering college of 10,000 students, 1,500 like neither their core branches nor other branches. The number of students who like their core branches is of the number of students who like other branches. The number of students who like both their core and other branches is 500.

    The number of students who like their core branches is
    1. A.

      1,800

    2. B.

      3,500

    3. C.

      1,600

    4. D.

      1,500

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: "Neither" tells you the union immediately; the ratio then collapses to one unknown.

    Exam route:

    • Total , neither .
    • Given , so .
    • Inclusion-exclusion: .
    • .
    • .

    Learning route:

    Let be the set of students who like their core branch and the set who like other branches. The universal set has .

    Step 1 — use "neither" to get the union. Students who like neither are outside , so

    Step 2 — translate the ratio. means .

    Step 3 — apply inclusion-exclusion for two sets:

    Substituting and :

    Step 4 — solve: , so .

    Verification: . Then , and . All constraints satisfied.

    Wrong-path autopsy:

    • Choosing (B) comes from computing or mixing up which set is of which; it breaks the ratio .
    • Choosing (C) comes from using instead of (forgetting to add the intersection back); this violates the union equation.
    • Choosing (D) is just echoing the "neither" count — a comprehension slip, not a calculation.

    Generalisation: whenever a problem gives a total, a "neither" count, and a ratio between two sets, convert "neither" to the union first, then substitute the ratio into inclusion-exclusion.

    Question 18 · Quantitative Aptitude · 2024_Set2 MCQ

    For positive non-zero real variables and , if

    then, the value of

    is

    1. A.

      1

    2. B.

    3. C.

      2

    4. D.

      4

    Correct Answer:

    C

    Step-by-Step Solution

    Insight: The equation is the logarithmic form of the AM-GM equality condition.

    Exam route: Simplify the RHS to . Equate arguments: . This implies . Thus, .

    Learning route:

    Step 1: Use logarithm properties on the right side: .

    Step 2: The equation becomes .

    Step 3: Since the natural logarithm is a one-to-one function, we can equate the arguments: .

    Step 4: Recognize this as the condition where the Arithmetic Mean (AM) equals the Geometric Mean (GM).

    Step 5: AM = GM holds for positive real numbers if and only if the variables are equal, so .

    Step 6: Substitute into the target expression: .

    Question 19 · Operating System · 2024_Set2 MSQ

    Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory management?

    1. A.

      Allocate a new page table for a newly created process

    2. B.

      Translate a virtual address to a physical address using the page table

    3. C.

      Raise a trap when a virtual address is not found in the page table

    4. D.

      Raise a trap when a process tries to write to a page marked with read-only permission in the page table

    Question 20 · Operating System · 2024_Set2 MSQ

    Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running state (e.g., ready, blocked)?

    1. A.

      P makes a blocking system call to read a block of data from the disk

    2. B.

      P tries to access a page that is in the swap space, triggering a page fault

    3. C.

      An interrupt is raised by the disk to deliver data requested by some other process

    4. D.

      A timer interrupt is raised by the hardware

    Question 21 · Operating System · 2024_Set2 MCQ
    Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU burst time.

    A (0, 10), B (2, 6), C (4, 3), and D (6, 7).

    Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?
    1. A.

      SRTF = 6, NP-SJF = 7

    2. B.

      SRTF = 6, NP-SJF = 7.5

    3. C.

      SRTF = 7, NP-SJF = 7.5

    4. D.

      SRTF = 7, NP-SJF = 8.5

    Question 22 · Compiler Design · 2024_Set2 MCQ
    Consider the following two sets:

    Set XSet YP.Lexical Analyzer1.Abstract Syntax TreeQ.Syntax Analyzer2.TokenR.Intermediate Code Generator3.Parse TreeS.Code Optimizer4.Constant Folding

    Which one of the following options is the CORRECT match from Set X to Set Y ?
    1. A.

      P – 4; Q – 1; R – 3; S – 2

    2. B.

      P – 2; Q – 3; R – 1; S – 4

    3. C.

      P – 2; Q – 1; R – 3; S – 4

    4. D.

      P – 4; Q – 3; R – 2; S – 1

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a Compiler Phases matching question. We must map each compiler phase to its primary output or associated optimization technique.

    Step 1: Analyze P (Lexical Analyzer).

    The lexical analyzer reads the source code character stream and groups it into meaningful units called Tokens (e.g., keywords, identifiers, operators).

    Match: P 2.

    Step 2: Analyze Q (Syntax Analyzer).

    The syntax analyzer (parser) takes the token stream and checks it against the grammar rules to build a hierarchical structure, specifically the Parse Tree (or concrete syntax tree).

    Match: Q 3.

    Step 3: Analyze R (Intermediate Code Generator).

    The intermediate code generator takes the syntax tree (often after semantic analysis converts it to an AST) and produces an intermediate representation. In many textbook classifications, it produces the Abstract Syntax Tree (AST) or three-address code. Here, AST is the best fit among the choices.

    Match: R 1.

    Step 4: Analyze S (Code Optimizer).

    The code optimizer improves the intermediate code to make it faster or smaller. Constant Folding (evaluating constant expressions at compile time, like replacing 3 + 4 with 7) is a classic machine-independent optimization technique.

    Match: S 4.

    Step 5: Combine the matches.

    P-2, Q-3, R-1, S-4.

    Answer: B

    Question 23 · Compiler Design · 2024_Set2 MSQ

    Which of the following statements is/are FALSE?

    1. A.

      An attribute grammar is a syntax-directed definition (SDD) in which the functions in the semantic rules have no side effects

    2. B.

      The attributes in a L-attributed definition cannot always be evaluated in a depth-first order

    3. C.

      Synthesized attributes can be evaluated by a bottom-up parser as the input is parsed

    4. D.

      All L-attributed definitions based on LR(1) grammar can be evaluated using a bottom-up parsing strategy

    Question 24 · Compiler Design · 2024_Set2 MCQ
    Consider the following context-free grammar where the start symbol is and the set of terminals is . The following is a partially-filled LL(1) parsing table.

    abcd$SS → AaAbS → BbBa(1)(2)AA → ε(3)A → cSB(4)B → εB → dS

    Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table?

    Note: In the options, “blank” denotes that the corresponding cell is empty.
    1. A.

    2. B.

    3. C.

    4. D.

    Question 25 · Theory of Computation · 2024_Set2 MCQ
    Which one of the following regular expressions is equivalent to the language accepted by the DFA given below?

    0011
    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is an FA to Regex conversion question. The DFA has a simple symmetric structure that tracks the parity of a specific character.

    Step 1: Analyze the DFA states and transitions.

    Let the start state be and the final state be .

    • State loops on '0'.
    • State loops on '0'.
    • Transition from to on '1'.
    • Transition from to on '1'.

    Step 2: Interpret the machine's behavior.

    The '0' loops mean that '0's can appear anywhere in the string without changing the state. They act as "padding".

    The '1' transitions toggle the state between and .

    Since is the start state (representing an even count of '1's, specifically 0) and is the final state (representing an odd count of '1's), the DFA accepts exactly those strings that contain an odd number of '1's.

    Step 3: Construct the regular expression for "odd number of 1s, any number of 0s".

    • We can start with any number of '0's: .
    • We must have at least one '1' to reach the final state : .
    • After reaching , we can either read '0's (loop at ) or read pairs of '1's to leave and return to (e.g., ).
    • A pair of '1's can have any number of '0's between them and after them: .
    • Thus, the repeating block at state is .

    Step 4: Combine the parts.

    Regex = .

    Step 5: Match with the given options. Option A matches this derived expression perfectly.

    Answer: A

    Question 26 · Theory of Computation · 2024_Set2 MCQ
    Let be the 5-state NFA with -transitions shown in the diagram below.

    12345εε00ε11

    Which one of the following regular expressions represents the language accepted by ?
    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is an NFA-to-Regex conversion problem, recognizable by the presence of epsilon transitions and multiple paths. We can use State Elimination or Arden's Theorem.

    Step 1: Analyze the NFA structure.

    States: 1 (Start), 2 (Final), 3, 4, 5 (Final).

    Transitions:

    Step 2: Simplify the NFA.

    Since and , we can consider 2 and 4 as effective start states (or merge them).

    Let's analyze the two branches separately.

    Branch 1 (via State 2):

    Cycle between 2 and 3: . This generates .

    From 3, we can go to 5 via .

    So, from 2, we can generate and end up at 3, then jump to 5.

    Effectively, this branch allows reaching 5 with strings in ? No.

    Path: . String "0". At 3.

    From 3, loop adds "00".

    So at 3, we have strings .

    Then .

    So this branch contributes to reach 5 from start (via 1->2).

    Wait, 2 is also a final state.

    So Branch 1 accepts:

    • Empty string (via ).
    • Strings that loop at 2: . This is .

    So Branch 1 accepts .

    Does it accept anything else?

    From 3, we can go to 5. But 5 is in Branch 2.

    Branch 2 (via State 4):

    .

    Cycle between 4 and 5: . This generates .

    State 5 is final.

    Path to 5: . String "1".

    Loop at 4: .

    So from 4, we can reach 5 with ?

    Let's trace:

    Start at 4.

    Accepts ? No, 4 is not final.

    (Final). String "1".

    . String "111".

    So Branch 2 accepts .

    Interaction:

    From Branch 1 (State 3), we can go to Branch 2 (State 5) via .

    So, we can take the Branch 1 path to 3, then jump to 5.

    Path to 3 from 1: . String "0".

    Loops at 2-3: .

    So we can reach 3 with .

    Then to 5.

    From 5, we can loop in Branch 2: . This is .

    Note: 5 is final. So just arriving at 5 is enough.

    So this mixed path accepts: ?

    Wait, once at 5, we can loop. The loop is (label 1,1). So .

    So the mixed part is .

    Total Language:

    1. Branch 1 alone (ending at 2): .
    2. Branch 2 alone (starting at 4): .
    3. Mixed (Branch 1 to Branch 2): .

    Union: .

    Factor out from last two terms?

    .

    So Total = .

    Let's check Option B: .

    My derived first term is . Option B has .

    Is equivalent to in this context? No.

    However, look at the diagram again.

    Is there a transition ? No.

    Is there a transition ? No.

    Let's re-evaluate Branch 1.

    (Final). Accepts .

    . Accepts .

    So Branch 1 accepts .

    Why does Option B have ?

    Maybe I missed a transition.

    Diagram:

    1->2 (epsilon)

    1->4 (epsilon)

    2->3 (0)

    3->2 (0)

    3->5 (epsilon)

    4->5 (1)

    5->4 (1)

    There is no way to generate a single '0' and stop at a final state in Branch 1.

    Path for '0': . State 3 is NOT final.

    So '0' is rejected by Branch 1.

    Path for '00': . State 2 IS final.

    So '00' is accepted.

    So Branch 1 is indeed .

    Let's look at Option B again: .

    This option accepts '0'. My analysis says '0' is rejected.

    Let's check if '0' is accepted by the mixed path.

    Mixed: .

    String so far: "0".

    State 5 is Final.

    So "0" IS accepted via the mixed path!

    Ah, I missed that 5 is final.

    So, reaching 5 via Branch 1 is valid.

    Path: .

    String: "0".

    From 5, we can loop .

    So this path generates .

    Wait, can we loop in Branch 1 before jumping?

    .

    String: .

    Generally: .

    So the prefix from Branch 1 to 5 is ?

    . (String 0).

    . (String 000).

    Yes, the set of strings reaching 3 from 2 is .

    So the mixed path generates .

    So the total language is:

    1. End at 2: .
    2. End at 5 (via 4): .
    3. End at 5 (via 2): .

    Union: .

    Combine 2 and 3: .

    Total: .

    Now compare with Option B: .

    Is equal to ? No.

    But look at Option C: .

    My term is . Option C has .

    is odd zeros. is even zeros.

    Let's re-read the options.

    A: -- Missing mixed path.

    B: -- First term is suspicious.

    C: -- Second term has instead of .

    D: -- Incorrect.

    Let's check if in B is a typo for or if my analysis of Branch 1 is wrong.

    Branch 1: (Final). via 0.

    Strings accepted at 2: .

    Is it possible that in Option B is actually correct because of some other path?

    No other path generates 0s.

    Let's look at Option B closely: .

    If we assume the question implies is a superset, it's wrong.

    However, often in these questions, is written as part of a larger expression.

    Let's check Option C again: .

    Term 2: .

    This generates AND .

    My mixed term is .

    starts with (even). starts with 0 (odd).

    They are disjoint.

    There seems to be no perfect match. Let's re-read the diagram for any missed epsilon.

    .

    .

    .

    Is it possible that ? No.

    Let's reconsider Option B.

    Maybe the first term is not but ?

    If Option B was , it would be perfect.

    Given the choices, B is the closest if we assume a typo in the first term or if I am missing a self-loop at 1? No.

    Actually, look at Option B's second part: . This matches my mixed/branch2 analysis perfectly.

    Option C's second part: . This fails to capture the leading 0 for the mixed path.

    Therefore, B is the intended answer, likely with a typo in the first term ( instead of ) or implying that the union covers all cases.

    Answer: B

    Question 27 · Theory of Computation · 2024_Set2 MSQ

    Consider a context-free grammar with the following 3 rules.

    Let . Let , , denote the number of times occur in , respectively. Which of the following statements is/are TRUE?

    1. A.

    2. B.

    3. C.

    4. D.

    Question 28 · Digital Logic · 2024_Set2 MSQ

    For a Boolean variable , which of the following statements is/are FALSE?

    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    ["B","C"]

    Step-by-Step Solution

    Insight: This is a single-variable Boolean-law check. The four statements are judged as identities, so each must hold for both and .

    Exam route: Recall the basic laws directly:

    Comparing with the given statements, and are false. Hence the false statements are B and C.

    Learning route:

    1. A Boolean variable can only be or . An identity is true only if it is true for both values.
    2. Option A: . This is the identity law for AND. If , ; if , . True.
    3. Option B: . This is not the identity law for OR. The null law says

    Counterexample: if , then . False.

    1. Option C: . This is not the complement law. The idempotent law says

    Counterexample: if , then . False.

    1. Option D: . This is the complement law for OR. If , ; if , . True.

    Tempting wrong path: a student may transfer ordinary algebra intuition and treat as an identity element for OR, concluding . That mistake makes the student miss statement B. It breaks exactly at the null law: , not . Another wrong path is confusing with ; , but . That mistake makes the student miss statement C.

    Generalization: For one-variable Boolean identities, either name the standard law or test both values and . A single counterexample is enough to mark a statement false.

    Verification: Substitute and into the selected false statements. For B: . For C: . The unselected statements A and D hold for both values.

    Question 29 · Digital Logic · 2024_Set2 MSQ

    Which of the following is/are EQUAL to 224 in radix-5 (i.e., base-5) notation?

    1. A.

      64 in radix-10

    2. B.

      100 in radix-8

    3. C.

      50 in radix-16

    4. D.

      121 in radix-7

    Correct Answer:

    ["A","B","D"]

    Step-by-Step Solution

    Insight: Convert the given Base 5 number to Base 10, then convert each option to Base 10 to check for equality.

    Exam route:

    1. .
    2. Check options in Base 10:

    A) . (Match)

    B) . (Match)

    C) . (No match)

    D) . (Match)

    Learning route:

    This is a multiple-select question testing base equivalence. The most efficient strategy is to anchor everything to Base 10.

    Step 1: Convert the target number to Base 10.

    .

    Step 2: Evaluate each option in Base 10.

    Option A: is already in Base 10. Value is 64. (Equal)

    Option B: . (Equal)

    Option C: . (Not equal)

    Option D: . (Equal)

    The correct options are A, B, and D.

    Question 30 · Digital Logic · 2024_Set2 MSQ
    Consider 4-variable functions , , , expressed in sum-of-minterms form as given below. f1f2f3f4ANDORXORY

    With respect to the circuit given above, which of the following options is/are CORRECT?
    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    ["C","D"]

    Step-by-Step Solution

    Insight: The circuit computes the XOR (symmetric difference) of an AND operation and an OR operation on four given minterm sets.

    Exam route:

    1. Compute AND (intersection): .
    2. Compute OR (union): .
    3. Compute XOR (symmetric difference): Elements in either set but not both.

    Intersection of the two results: .

    Union of the two results: .

    Symmetric difference: .

    1. Thus, .
    2. The maxterm representation is the exact complement: .
    3. Options C and D are correct.

    Learning route: Set operations on minterm lists are faster than drawing 4-variable K-maps for this specific gate topology. AND is intersection, OR is union, XOR is symmetric difference.

    Question 31 · Algorithms · 2024_Set2 MCQ

    Let be the recurrence relation defined as follows:

    Which one of the following statements is TRUE?

    1. A.

    2. B.

    3. C.

    4. D.

    Question 32 · Algorithms · 2024_Set2 NAT

    Let be an array containing integer values. The distance of is defined as the minimum number of elements in that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array is ___________

    Question 33 · Algorithms · 2024_Set2 NAT
    The number of distinct minimum-weight spanning trees of the following graph is __________

    abfgced121332222211
    Correct Answer:

    9

    Step-by-Step Solution

    Key idea: Use Kruskal's algorithm to group edges by weight and count the number of valid ways to connect the resulting components.

    Step 1: List all edges grouped by weight.

    Weight 1: (a,b), (a,f), (c,d), (e,d) 4 edges.

    Weight 2: (a,g), (b,g), (f,g), (g,c), (g,e), (g,d) 6 edges.

    Weight 3: (b,c), (f,e) 2 edges.

    Step 2: Process weight 1 edges. They form two disjoint tree components without cycles:

    • Component 1: {a, b, f} (using edges a-b, a-f)
    • Component 2: {c, d, e} (using edges c-d, e-d)

    Vertex {g} is isolated. Total components = 3.

    Step 3: A spanning tree for 7 vertices requires exactly edges. We already have 4 edges of weight 1. We need exactly 2 more edges to connect the 3 components.

    Step 4: Look at weight 2 edges. They connect {g} to Component 1 via 3 edges: (a,g), (b,g), (f,g). They connect {g} to Component 2 via 3 edges: (g,c), (g,e), (g,d).

    There are no weight 2 edges directly between Component 1 and Component 2.

    Step 5: To connect all 3 components, we must choose exactly one edge from the first group (3 choices) and exactly one edge from the second group (3 choices).

    Step 6: Total distinct MSTs = . (Weight 3 edges are not needed as the graph is already connected with weight 1 and 2 edges).

    Answer: 9

    Question 34 · Verbal Aptitude · 2024_Set2 MCQ
    If ‘’ denotes increasing order of intensity, then the meaning of the words
    [walk jog sprint] is analogous to [bothered ________ daunted].

    Which one of the given options is appropriate to fill the blank?
    1. A.

      phased

    2. B.

      phrased

    3. C.

      fazed

    4. D.

      fused

    Correct Answer:

    C

    Step-by-Step Solution

    Insight: The arrow denotes a strict, unidirectional escalation in intensity. "Bothered" is mild distress, "daunted" is severe distress, so the missing word must represent medium distress.

    Exam route: Walk -> jog -> sprint is increasing physical effort. Bothered -> ? -> daunted is increasing emotional distress. "Fazed" means disconcerted, fitting perfectly between bothered and daunted. The others are homophone traps.

    Learning route:

    Step 1: Analyze the reference sequence. "walk -> jog -> sprint" shows a linear escalation of physical speed and exertion.

    Step 2: Identify the dimension of the target sequence. "bothered -> ? -> daunted" tests the dimension of emotional distress or being unsettled.

    Step 3: Define the endpoints. "Bothered" means mildly annoyed or concerned. "Daunted" means feeling intimidated, overwhelmed, or severely discouraged.

    Step 4: Evaluate options for the middle step.

    • "Phased": done in gradual stages. (Unrelated meaning)
    • "Phrased": expressed in particular words. (Unrelated meaning)
    • "Fazed": disconcerted, perturbed, or unsettled. This represents a medium level of emotional distress, stronger than "bothered" but weaker than "daunted".
    • "Fused": joined or blended together. (Unrelated meaning)

    Step 5: Conclude that "fazed" is the correct word to complete the intensity sequence, while the others are homophone distractors.

    Question 35 · Verbal Aptitude · 2024_Set2 MCQ
    Sequence the following sentences in 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.
    1. A.

      QPSR

    2. B.

      QSPR

    3. C.

      SPRQ

    4. D.

      SRPQ

    Correct Answer:

    C

    Step-by-Step Solution

    Insight: The passage describes a geological sequence; the opening must introduce the event, followed by immediate effects, subsequent processes, and a concluding inference.

    Exam route: Sentence S introduces the collision. Sentence P refers to "This... event", locking S→P. Sentence R discusses "cooling of this massive edifice", which must follow the "rocks rising" in P. Sentence Q starts with "Thus", making it the conclusion. Sequence SPRQ is the only match.

    Learning route:

    Step 1: Identify the opener. Sentence S introduces the specific historical event ("Many millennia ago... collided"). Sentences P, R, and Q contain dependent references ("This... event", "this massive edifice", "Thus") and cannot open the passage.

    Step 2: Link cause and effect. Sentence P explicitly refers to "This fortuitous geological event", which must immediately follow the collision described in S. This forms the mandatory pair S→P.

    Step 3: Follow the physical timeline. Sentence P describes the generation of heat and rocks rising. Sentence R describes the "cooling of this massive edifice". Cooling must chronologically follow the generation of heat and rising, forming the pair P→R.

    Step 4: Identify the conclusion. Sentence Q begins with "Thus", signaling a summary or inference drawn from the preceding active geological processes, making it the natural closing sentence.

    The sequence S→P→R→Q is logically and chronologically sound.

    Question 36 · Analytical Aptitude · 2024_Set2 MCQ

    In the sequence , a possible value of is

    1. A.

      25

    2. B.

      21

    3. C.

      18

    4. D.

      20

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: This is a second-order difference sequence where the first differences form a progression of consecutive odd numbers.

    Exam route: Calculate first differences: , , and . The missing differences between 5 and 11 in an odd number sequence are 7 and 9. Thus, . Verify: .

    Learning route:

    Step 1: Calculate the first differences () between consecutive terms:

    Step 2: Analyze the known differences: . This strongly suggests a sequence of consecutive odd numbers: .

    Step 3: Solve for the missing terms using this pattern. Assume the next difference is :

    Step 4: Verify with the next term. If , then the next difference is . This perfectly matches the expected odd number .

    Conclusion: .

    Question 37 · Analytical Aptitude · 2024_Set2 MCQ
    In the array shown below, each cell of the first three rows has either a cross (X) or a number.

    1X43X5543X6X

    The number in a cell represents the count of the immediate neighboring cells (left, right, top, bottom, diagonals) NOT having a cross (X). Given that the last row has no crosses (X), the sum of the four numbers to be filled in the last row is
    1. A.

      11

    2. B.

      10

    3. C.

      12

    4. D.

      9

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: This is an array/grid logic problem where a cell's value equals the count of its immediate neighbors (including diagonals) that do NOT contain an 'X'.

    Exam route: The last row has no 'X's. Evaluate each bottom-row cell's non-'X' neighbors:

    • Cell (4,1): Neighbors are (3,1)=3, (3,2)=X, (4,2)=B. Non-X count = 2. So A = 2.
    • Cell (4,2): Neighbors are (3,1)=3, (3,2)=X, (3,3)=6, (4,1)=A, (4,3)=C. Non-X count = 4. So B = 4.
    • Cell (4,3): Neighbors are (3,2)=X, (3,3)=6, (3,4)=X, (4,2)=B, (4,4)=D. Non-X count = 3. So C = 3.
    • Cell (4,4): Neighbors are (3,3)=6, (3,4)=X, (4,3)=C. Non-X count = 2. So D = 2.

    Sum = 2 + 4 + 3 + 2 = 11.

    Learning route:

    Step 1: Verify the rule with a known cell. Take Row 3, Col 1 (value 3). Its neighbors are (2,1)=X, (2,2)=5, (3,2)=X, (4,1), (4,2). Since the last row has no X, (4,1) and (4,2) are not X. The non-X neighbors are (2,2), (4,1), and (4,2). Count = 3. This matches the given value, confirming our understanding.

    Step 2: Apply the rule to Row 4, Col 1 (let's call it A). Neighbors: (3,1)=3, (3,2)=X, (4,2)=B. Non-X neighbors: (3,1) and (4,2). Total = 2. Thus, A = 2.

    Step 3: Apply to Row 4, Col 2 (B). Neighbors: (3,1)=3, (3,2)=X, (3,3)=6, (4,1)=A, (4,3)=C. Non-X neighbors: (3,1), (3,3), (4,1), (4,3). Total = 4. Thus, B = 4.

    Step 4: Apply to Row 4, Col 3 (C). Neighbors: (3,2)=X, (3,3)=6, (3,4)=X, (4,2)=B, (4,4)=D. Non-X neighbors: (3,3), (4,2), (4,4). Total = 3. Thus, C = 3.

    Step 5: Apply to Row 4, Col 4 (D). Neighbors: (3,3)=6, (3,4)=X, (4,3)=C. Non-X neighbors: (3,3), (4,3). Total = 2. Thus, D = 2.

    Step 6: Sum the last row: A + B + C + D = 2 + 4 + 3 + 2 = 11.

    Question 38 · Spatial Aptitude · 2024_Set2 MCQ
    A cube is to be cut into 8 pieces of equal size and shape. Here, each cut should be straight and it should not stop till it reaches the other end of the cube.

    The minimum number of such cuts required is
    1. A.

      3

    2. B.

      4

    3. C.

      7

    4. D.

      8

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is a <optimization> question about minimizing cuts to subdivide a cube into equal pieces. The key is understanding how orthogonal cuts multiply the number of pieces.

    Step 1: Understand the cutting constraint.

    • Each cut must be straight
    • Each cut goes completely through the cube
    • Cuts are parallel to faces (to get equal pieces)

    Step 2: Understand how cuts create pieces.

    When cutting a cube with planes parallel to faces:

    • n cuts parallel to one face create (n+1) pieces along that dimension
    • Total pieces = (cuts_x + 1) × (cuts_y + 1) × (cuts_z + 1)

    Step 3: Find the factorization of 8.

    We need 8 equal pieces.

    8 = 2 × 2 × 2

    This means we need:

    • 2 pieces along x-axis → 1 cut
    • 2 pieces along y-axis → 1 cut
    • 2 pieces along z-axis → 1 cut

    Step 4: Calculate minimum cuts.

    Total cuts = 1 + 1 + 1 = 3 cuts

    Step 5: Verify this is minimum.

    Alternative: Could we use fewer cuts?

    • With 2 cuts maximum: Best case is 2 cuts in different directions
    • This gives at most 2 × 2 × 1 = 4 pieces (not enough)
    • With 3 cuts in 3 orthogonal directions: 2 × 2 × 2 = 8 pieces ✓

    Therefore, 3 cuts is the minimum.

    Step 6: Visualize the solution.

    • Cut 1: Slice horizontally through middle → 2 pieces
    • Cut 2: Slice vertically (front-to-back) through middle → 4 pieces
    • Cut 3: Slice vertically (left-to-right) through middle → 8 pieces

    Answer: A (3 cuts)

    Other GATE CS papers