GATE CSE · Previous year papers · 2024
GATE CSE 2024 previous year paper · official paper and PYQ-pattern practice
12 PYQ-pattern questions modelled on the 2024 paper (which had 65) · 180 min
Every question here is freshly worded in the pattern of the 2024 paper — same topics, style and difficulty — not the original questions, which Shishya does not reproduce.
The original 2024 paper, as GATE 2024 (organised by IISc Bengaluru); file on the GATE 2026 site's previous-years page published it
- GATE 2024 CS-1 master question paper ↗ · Question paper · English · PDF · 835 KB
- GATE 2024 CS-2 master question paper ↗ · Question paper · English · PDF · 886 KB
- GATE 2024 CS-1 final answer key ↗ · Answer key · English · PDF · 313 KB
- GATE 2024 CS-2 final answer key ↗ · Answer key · English · PDF · 313 KB
Shishya's own practice questions, set out subject by subject like the real paper — not the original paper.
Solve these 12 2024-pattern questions as a timed mock — free
12 PYQ-pattern questions modelled on the 2024 paper (which had 65) · instant scoring · topic-wise analysis. Sign up with Google, free, to attempt and track your progress.
Stuck on a question from this set?
Ask Shishya — your free AI tutor — to explain any GATE CSE 2024-pattern question, concept, or shortcut, step by step, in your language.
Ask Shishya about this set →GATE CSE 2024 PYQ-pattern questions
Showing 10 of the 12 PYQ-pattern questions in this set — freshly worded in that year's pattern, not the original questions. Answers and solutions open under each question.
Q1 · Theory of Computation
Let L be a regular language over the alphabet {0, 1}. Which of the following languages is guaranteed to be regular?
- A. L² = {xy | x ∈ L and y ∈ L}
- B. {ww | w ∈ L}
- C. {w | w has equal number of 0s and 1s and w ∈ L}
- D. {0ⁿ1ⁿ | n ≥ 0 and 0ⁿ ∈ L}
Answer and solution
Answer: A
Regular languages are closed under concatenation. L² is the concatenation of L with itself, hence it is regular. Options B, C, and D are not guaranteed to produce regular languages.
Q2 · Operating System
Three processes P1, P2, and P3 require resources R1, R2, and R3. The allocation matrix is [[1,0,1], [1,1,0], [0,0,1]] and the maximum need matrix is [[2,1,2], [3,2,1], [1,1,2]]. Available resources are [1,1,0]. Which of the following sequences is a safe sequence?
- A. P1, P2, P3
- B. P3, P1, P2
- C. P2, P3, P1
- D. No safe sequence exists
Answer and solution
Answer: D
Need = Max - Allocation: P1[1,1,1], P2[2,1,1], P3[1,1,1]. Available=[1,1,0]. Each process needs 1 unit of R3, but R3 available is 0, and no process can complete to release R3 (P1 and P3 hold 1 R3 each but can't finish without acquiring R3). Thus none can proceed; no safe sequence exists.
Q3 · Databases
Consider a relation Student(ID, Name, Dept) with 500 tuples and Department(Dept, Building) with 20 tuples. If a natural join is performed on Dept attribute and every student belongs to exactly one department that exists in Department relation, what is the minimum possible number of tuples in the result?
- A. 20
- B. 100
- C. 500
- D. 10000
Answer and solution
Answer: C
Since every student belongs to exactly one department that exists in the Department relation, the natural join will preserve all 500 student tuples. Each student tuple will be joined with exactly one matching department tuple, resulting in exactly 500 tuples in the output.
Q4 · Digital Logic
A combinational circuit is designed using four 2-to-1 multiplexers. What is the maximum number of input variables (excluding control/select inputs of the multiplexers) that such a circuit can have?
- A. 4
- B. 6
- C. 8
- D. 12
Answer and solution
Answer: C
Each 2-to-1 multiplexer has 2 data inputs and 1 select input. Four such multiplexers can have at most 4×2 = 8 distinct input variables.
Q5 · Compiler Design
In a compiler, which phase is responsible for eliminating common sub-expressions from the intermediate code?
- A. Lexical Analysis
- B. Syntax Analysis
- C. Code Optimization
- D. Code Generation
Answer and solution
Answer: C
Code Optimization phase eliminates redundant computations including common sub-expressions to improve efficiency of generated code.
Q6 · Computer Networks
In a Go-Back-N ARQ protocol with a window size of 7, if frame 4 is lost during transmission, which frames will the sender retransmit after detecting the loss?
- A. Only frame 4
- B. Frames 4, 5, 6, 7
- C. Frames 4 through 10
- D. All frames from 4 onward sent so far
Answer and solution
Answer: D
In Go-Back-N, when a frame is lost, the sender retransmits that frame and all subsequent frames that were sent within the window, ensuring sequential delivery.
Q7 · Programming and Data Structures
What is the output of the following C code snippet? int arr[5] = {10, 20, 30, 40, 50}; int *ptr = arr + 2; printf("%d", *(ptr + 1));
- A. 20
- B. 30
- C. 40
- D. 50
Answer and solution
Answer: C
ptr points to arr[2] (which is 30). *(ptr+1) accesses the element one position ahead, which is arr[3] = 40.
Q8 · Databases
Consider a relation R(A, B, C, D) with functional dependencies: {A → B, B → C, C → D}. What is the highest normal form that R satisfies?
- A. 1NF
- B. 2NF
- C. 3NF
- D. BCNF
Answer and solution
Answer: B
The only candidate key is A (since A→B→C→D determines all). All determinants (A, B, C) are not superkeys except A, so BCNF fails (B→C and C→D violate BCNF). For 3NF: transitive dependencies B→C and C→D have non-prime attributes on RHS (C, D are non-prime), violating 3NF. However, 2NF is satisfied because there are no partial dependencies (key A is single attribute, so no partial dependency possible). Thus highest normal form is 2NF.
Q9 · Quantitative Aptitude
A shopkeeper marks an article 40% above its cost price. He then offers a discount of 25% on the marked price. If the cost price is ₹500, what is the percentage profit or loss?
- A. 5% profit
- B. 5% loss
- C. 10% profit
- D. 15% profit
Answer and solution
Answer: A
Marked price = 500 + 40% of 500 = ₹700. Selling price after 25% discount = 700 - 25% of 700 = ₹525. Profit = 525 - 500 = ₹25, which is 5% of cost price.
Q10 · Computer Organization and Architecture
A CPU has a 5-stage pipeline with stages: Fetch (F), Decode (D), Execute (E), Memory (M), and Write-back (W). Each stage takes 2 ns. If there are no hazards and 100 instructions are executed, what is the total execution time in nanoseconds?
- A. 200
- B. 208
- C. 210
- D. 1000
Answer and solution
Answer: B
For a 5-stage pipeline, the first instruction takes 5×2 = 10 ns. Each subsequent instruction takes 2 ns. Total = 10 + (99×2) = 208 ns.
Breakdown by subject
Computer Science and Information Technology
10 questions
General Aptitude
2 questions