chapter
    Logic PYQs for GATE CS

    GATE CS Logic: 4 chapters, 21 previous year questions (100% of Analytical Aptitude), 355 practice questions and one solved question from each chapter.

    A question from this chapter

    Question 1
    2026 Slot Set2 PYQ
    Level 3: Exam Standard
    ‘When it is raining, peacocks dance.’

    Based only on this sentence, which one of the following options is necessarily true?
    Question 2
    2026 Slot Set2 PYQ
    Level 3: Exam Standard
    The figure in Panel I below is a grid of cells with four rows and four columns. The numbers on the top and on the left represent the number of cells that are to be shaded in that column and row, respectively. Which one of the options shown in Panel II below represents the grid shaded correctly?
    Panel I Panel II 2 2 2 2 3 1 2 2 (i) (ii) (iii) (iv)
    Question 3
    2025 Slot Set2 PYQ
    Level 3: Exam Standard

    If IMAGE and FIELD are coded as FHBNJ and EMFJG respectively then, which one among the given options is the most appropriate code for BEACH ?

    Question 4
    2026 Slot Set2 PYQ
    Level 3: Exam Standard
    Figures (i) and (ii) represent intercity highway systems. The black dots represent cities and the line segments between them represent intercity highways.
    A salesperson needs to make a trip. She needs to start from a city, visit each of the remaining cities exactly once, and finally return to the same city from which she started.

    Which one of the following options is then true?
    (i) (ii)
    Free preview ends here

    Login to view the complete previous-year questions 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.

    Logic PYQs for GATE CS

    GATE CS Logic: 4 chapters, 21 previous year questions (100% of Analytical Aptitude), 355 practice questions and one solved question from each chapter.

    About Logic Previous Year Questions (PYQs)

    21 previous year questions from Logic in GATE CS, grouped by chapter with the exam year, answer key and step-by-step solution for each.

    Logic Weightage in GATE CS

    Logic accounts for 21 of 21 Analytical Aptitude previous year questions in our bank (100%), about 2.3 per paper across 9 papers.

    Logic Chapter Matrix

    ChapterTopicsPYQsShare of unit PYQsPractice questions
    Deductive Reasoning, Statements and SyllogismsPassage-Based Deductive Inference, Categorical Statements and Syllogisms, Conditional Logic and Contraposition838%125
    Relationships, Ordering and Arrangement PuzzlesFamily and Blood Relationships, Spatial Placement and Geometric Arrangements, Ordering, Ranking and Sequential Events, Grid Shading and Constraint Puzzles524%104
    Patterns, Series, Coding and AnalogiesLetter Coding and Decoding, Number Series and Array Patterns, Word and Functional Analogies524%78
    Graph, Route and Tournament ReasoningGraph Connectivity and Minimum Bridges, Knockout Tournament Elimination, Hamiltonian Routes and Round Trips314%48

    More from Analytical Aptitude

    One Solved Question from Each Logic Chapter

    Question 1 · Deductive Reasoning, Statements and Syllogisms · 2026_Set2 MCQ
    ‘When it is raining, peacocks dance.’

    Based only on this sentence, which one of the following options is necessarily true?
    1. A.

      Peacocks dance only when it is raining.

    2. B.

      When peacocks dance, it is raining.

    3. C.

      When peacocks are not dancing, it is not raining.

    4. D.

      When it is not raining, peacocks do not dance.

    Correct Answer:

    C

    Step-by-Step Solution

    Insight: "When P, Q" translates to . The contrapositive is logically equivalent and must be true.

    Exam route: Identify (raining) and (peacocks dance). The contrapositive is "If peacocks are not dancing, it is not raining." Match with Option C.

    Learning route:

    1. Translate the statement: "When it is raining (), peacocks dance ()" means .
    2. Recall logical equivalences: The contrapositive is always true if is true.
    3. Form the contrapositive: "When peacocks are not dancing (), it is not raining ()."
    4. Evaluate options:
    • Option A & B represent the converse (), which is not necessarily true.
    • Option D represents the inverse (), which is not necessarily true.
    • Option C represents the contrapositive (), which must be true.

    Answer is C.

    Question 2 · Relationships, Ordering and Arrangement Puzzles · 2026_Set2 MCQ
    The figure in Panel I below is a grid of cells with four rows and four columns. The numbers on the top and on the left represent the number of cells that are to be shaded in that column and row, respectively. Which one of the options shown in Panel II below represents the grid shaded correctly?
    Panel I Panel II 2 2 2 2 3 1 2 2 (i) (ii) (iii) (iv)
    1. A.

      (i)

    2. B.

      (ii)

    3. C.

      (iii)

    4. D.

      (iv)

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: Verify total row and column sums first, then use forced moves starting with the most constrained row or column.

    Exam route: Row sums = 3 + 1 + 2 + 2 = 8. Column sums = 2 + 2 + 2 + 2 = 8. Consistency check passed. Row 2 requires exactly 1 shaded cell. Inspecting the options: Option (i) has 2 shaded in Row 2 (invalid). Option (iii) has 2 shaded in Row 2 (invalid). Option (ii) has 1 shaded in Row 2. Verify Option (ii) columns: Col 1 has 2, Col 2 has 2, Col 3 has 2, Col 4 has 2. All constraints satisfied. Option (ii) is correct.

    Learning route:

    Step 1: Consistency Check. Sum of row requirements (3+1+2+2 = 8) must equal sum of column requirements (2+2+2+2 = 8). They match.

    Step 2: Identify Extremes. Row 2 requires only 1 shaded cell out of 4. This is the tightest constraint.

    Step 3: Option Elimination. Instead of solving the grid from scratch (which is time-consuming), evaluate the given options against the tightest constraint.

    Step 4: Check Row 2 in all options. Option (i) shows 2 shaded cells. Option (iii) shows 2 shaded cells. Both are immediately discarded.

    Step 5: Verify the survivor. Option (ii) has exactly 1 shaded cell in Row 2. Now verify its columns: Col 1 (Rows 1, 4) = 2. Col 2 (Rows 2, 4) = 2. Col 3 (Rows 1, 3) = 2. Col 4 (Rows 1, 3) = 2. All column sums are exactly 2. Option (ii) is the unique valid configuration.

    Question 3 · Patterns, Series, Coding and Analogies · 2025_Set2 MCQ

    If IMAGE and FIELD are coded as FHBNJ and EMFJG respectively then, which one among the given options is the most appropriate code for BEACH ?

    1. A.

      CEADP

    2. B.

      IDBFC

    3. C.

      JGIBC

    4. D.

      IBCEC

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: The coding rule involves reversing the original word and then applying a uniform forward shift of +1 to each letter.

    Exam route: Reverse BEACH to get HCAEB. Shift each letter forward by 1: H→I, C→D, A→B, E→F, B→C. Result is IDBFC.

    Learning route:

    Step 1: Test direct left-to-right shift for IMAGE → FHBNJ. I(9) to F(6) is -3, M(13) to H(8) is -5. Inconsistent.

    Step 2: Apply the Reverse Test. Reverse IMAGE to get EGAMI.

    Step 3: Calculate shift: E(5)→F(6) [+1], G(7)→H(8) [+1], A(1)→B(2) [+1], M(13)→N(14) [+1], I(9)→J(10) [+1]. The rule is confirmed: Reverse +1.

    Step 4: Verify with FIELD. Reverse to DLEIF. Shift +1: D→E, L→M, E→F, I→J, F→G. Result EMFJG. Matches perfectly.

    Step 5: Apply to BEACH. Reverse to HCAEB. Shift +1: H→I, C→D, A→B, E→F, B→C. Final code is IDBFC.

    Question 4 · Graph, Route and Tournament Reasoning · 2026_Set2 MCQ
    Figures (i) and (ii) represent intercity highway systems. The black dots represent cities and the line segments between them represent intercity highways.
    A salesperson needs to make a trip. She needs to start from a city, visit each of the remaining cities exactly once, and finally return to the same city from which she started.

    Which one of the following options is then true?
    (i) (ii)
    1. A.

      Such a trip is possible for (i), but not for (ii).

    2. B.

      Such a trip is possible for (ii), but not for (i).

    3. C.

      Such a trip is possible for both (i) and (ii).

    4. D.

      Such a trip is possible neither for (i) nor for (ii).

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: A Hamiltonian cycle requires every vertex to have a degree of exactly 2 within the cycle. Graph (ii) has three vertices of degree 2, which forces a contradiction at the central vertex. Graph (i) is a 4x4 grid, which is bipartite with equal partitions, allowing a valid cycle.

    Exam route: For (ii), identify vertices with degree 2. Their incident edges must be in the cycle. This forces the central vertex to have degree 3 in the cycle, which is impossible. Thus, (ii) has no Hamiltonian cycle. For (i), a 4x4 grid has a known Hamiltonian cycle (e.g., a snake pattern that closes). Thus, (i) is possible, (ii) is not.

    Learning route:

    1. Understand the goal: A trip visiting every city exactly once and returning to the start is a Hamiltonian cycle.
    2. Analyze Graph (ii): It has 5 vertices. The top-left, bottom, and top-right vertices each have exactly 2 connections (degree 2).
    3. Apply the Degree-Two Vertex Rule: In any Hamiltonian cycle, if a vertex has degree 2, both of its edges must be part of the cycle.
    4. Trace the forced edges in (ii): The three degree-2 vertices force 6 edges. However, these edges all converge on the central vertex, giving it a degree of 3 in the supposed cycle. A cycle can only have degree 2 for every vertex. This is a contradiction, so (ii) is impossible.
    5. Analyze Graph (i): It is a 4x4 grid graph. It is bipartite with 8 black and 8 white vertices. Since the partitions are equal, a Hamiltonian cycle is possible. We can explicitly construct one by tracing the perimeter and weaving through the center without repeating vertices.
    6. Conclusion: Possible for (i), not for (ii).