Previous Year Questions Compilation

How to Use This Compilation

Purpose: This page compiles representative GATE DA AI questions organized by topic with full solutions. Each question includes the type (MCQ/MSQ/NAT), marks, difficulty rating, and a step-by-step solution to help you understand the approach.

For each question, try to solve it on your own first using a timer (2 min for 1-mark, 4 min for 2-mark), then check the solution. This simulates real exam conditions and builds time awareness.

Difficulty Scale: ★ Easy (should solve in <1 min)  |  ★★ Medium (typical GATE level)  |  ★★★ Hard (top-difficulty, time-consuming)

Search Algorithms

Q1. [NAT, 2 marks, ★★]
Consider the following graph where S is the start state and G is the goal state. Each edge is labelled with its cost. Using Uniform Cost Search, what is the cost of the optimal path from S to G?
    S --2-- A --3-- G
    |               |
    4               1
    |               |
    B ------2------ C
              

Graph edges: S→A (cost 2), A→G (cost 3), S→B (cost 4), B→C (cost 2), C→G (cost 1).

Solution:
UCS expands nodes in order of cumulative path cost:
1. Start: {S: 0}
2. Expand S: {A: 2, B: 4}
3. Expand A (cost 2): {B: 4, G: 5}
4. Expand B (cost 4): {G: 5, C: 6}
5. Expand G (cost 5): Goal reached!

But wait — we should also check path S→B→C→G = 4 + 2 + 1 = 7. Since 5 < 7, the optimal path is S→A→G with cost 5.

Answer: 5
Q2. [MCQ, 1 mark, ★]
Which of the following search strategies is guaranteed to find the optimal solution when all step costs are equal?
(A) Depth-First Search
(B) Breadth-First Search
(C) Depth-Limited Search
(D) Greedy Best-First Search
Solution:
When all step costs are equal, BFS expands nodes level by level, guaranteeing that the shallowest (and therefore cheapest) goal is found first. DFS can get stuck in deep branches, DLS may miss solutions beyond the limit, and Greedy Best-First is not optimal.

Answer: (B)
Q3. [NAT, 2 marks, ★★★]
A* search is run on a graph with 8 nodes. The heuristic function h(n) is admissible but not consistent. In the worst case, how many times can a node be expanded by A* with graph search (without re-expansion)?
Solution:
With an admissible but inconsistent heuristic in graph search (without re-expansion), A* may not find the optimal solution. However, the question asks about the number of expansions per node. In standard graph search, each node is expanded at most once because expanded nodes are added to the closed set.

If the A* variant allows re-expansion (as needed for admissible-but-inconsistent heuristics), a node can be expanded up to exponentially many times in the worst case. But for standard graph search: 1.

Answer: 1

Machine Learning

Q4. [NAT, 2 marks, ★★]
A decision tree is being built using the ID3 algorithm. A dataset has 10 samples: 6 positive (+) and 4 negative (−). An attribute A splits the data into two subsets: Left (4+, 1−) and Right (2+, 3−). Calculate the Information Gain of attribute A. Give your answer rounded to 3 decimal places. Use log base 2.
Solution:
Step 1: Entropy of parent:
H(S) = −(6/10)log₂(6/10) − (4/10)log₂(4/10)
= −0.6 × (−0.737) − 0.4 × (−1.322)
= 0.442 + 0.529 = 0.971

Step 2: Entropy of Left (4+, 1−):
H(L) = −(4/5)log₂(4/5) − (1/5)log₂(1/5)
= −0.8 × (−0.322) − 0.2 × (−2.322)
= 0.258 + 0.464 = 0.722

Step 3: Entropy of Right (2+, 3−):
H(R) = −(2/5)log₂(2/5) − (3/5)log₂(3/5)
= −0.4 × (−1.322) − 0.6 × (−0.737)
= 0.529 + 0.442 = 0.971

Step 4: Weighted entropy after split:
H(S|A) = (5/10) × 0.722 + (5/10) × 0.971 = 0.361 + 0.486 = 0.847

Step 5: Information Gain:
IG = 0.971 − 0.847 = 0.124

Answer: 0.124
Q5. [MCQ, 2 marks, ★★]
In ridge regression (L2 regularization), increasing the regularization parameter λ will:
(A) Increase bias and decrease variance
(B) Decrease bias and increase variance
(C) Increase both bias and variance
(D) Decrease both bias and variance
Solution:
Ridge regression adds a penalty term λ||w||² to the loss function. As λ increases:
• The model is forced to keep weights small, reducing model complexity
• Simpler models have higher bias (less flexible, may underfit)
• But they have lower variance (more stable across different training sets)

This is the classic bias-variance tradeoff. Increasing regularization pushes towards simpler models.

Answer: (A)
Q6. [NAT, 1 mark, ★]
A binary classifier has the following confusion matrix:
Predicted +Predicted −
Actual +4010
Actual −545
What is the precision of the positive class? Give your answer rounded to 2 decimal places.
Solution:
Precision = TP / (TP + FP) = 40 / (40 + 5) = 40 / 45 = 0.8889

Answer: 0.89

Probabilistic Reasoning

Q7. [NAT, 2 marks, ★★]
A medical test for a disease has a sensitivity (true positive rate) of 0.95 and a specificity (true negative rate) of 0.90. The prevalence of the disease in the population is 0.01 (1%). If a randomly selected person tests positive, what is the probability that they actually have the disease? Round to 3 decimal places.
Solution:
This is a classic Bayes’ Theorem problem.

Let D = has disease, T+ = tests positive.
Given: P(T+|D) = 0.95, P(T−|¬D) = 0.90, P(D) = 0.01
So: P(T+|¬D) = 1 − 0.90 = 0.10, P(¬D) = 0.99

P(T+) = P(T+|D)×P(D) + P(T+|¬D)×P(¬D)
= 0.95 × 0.01 + 0.10 × 0.99
= 0.0095 + 0.099 = 0.1085

P(D|T+) = P(T+|D)×P(D) / P(T+)
= 0.0095 / 0.1085 = 0.088

Answer: 0.088
Q8. [MCQ, 1 mark, ★★]
In a Bayesian Network, if X and Y are d-separated given Z, which of the following is true?
(A) X and Y are marginally independent
(B) X and Y are conditionally independent given Z
(C) Z is a descendant of both X and Y
(D) X causes Y through Z
Solution:
D-separation is the graphical criterion for conditional independence in Bayesian Networks. If X and Y are d-separated given Z, then X and Y are conditionally independent given Z. This does not imply marginal independence, nor does it specify any particular structural relationship.

Answer: (B)

Neural Networks & Deep Learning

Q9. [NAT, 2 marks, ★★]
A single-layer perceptron has 3 inputs (x₁, x₂, x₃), weights (0.5, −0.3, 0.8), and bias b = −0.2. Using the sigmoid activation function σ(z) = 1/(1 + e⁻ᶻ), compute the output for input (1, 0, 1). Round to 3 decimal places.
Solution:
Step 1: Compute weighted sum:
z = w₁x₁ + w₂x₂ + w₃x₃ + b
z = 0.5(1) + (−0.3)(0) + 0.8(1) + (−0.2)
z = 0.5 + 0 + 0.8 − 0.2 = 1.1

Step 2: Apply sigmoid:
σ(1.1) = 1 / (1 + e⁻¹·¹) = 1 / (1 + 0.3329) = 1 / 1.3329 = 0.750

Answer: 0.750
Q10. [MCQ, 2 marks, ★★]
A convolutional layer has an input of size 32×32×3. It uses 16 filters of size 5×5 with stride 1 and no padding. What is the size of the output feature map?
(A) 28×28×16
(B) 32×32×16
(C) 28×28×3
(D) 27×27×16
Solution:
Output size formula: O = (I − F + 2P) / S + 1
Where I = 32, F = 5, P = 0, S = 1
O = (32 − 5 + 0) / 1 + 1 = 27 + 1 = 28

The depth of the output equals the number of filters = 16.
Output: 28 × 28 × 16

Answer: (A)
Q11. [NAT, 2 marks, ★★★]
A fully connected neural network has the following architecture: Input layer (4 neurons) → Hidden Layer 1 (8 neurons) → Hidden Layer 2 (6 neurons) → Output Layer (2 neurons). Each layer uses a bias term. How many total trainable parameters does this network have?
Solution:
Count weights + biases for each connection:
• Input → Hidden 1: 4 × 8 weights + 8 biases = 32 + 8 = 40
• Hidden 1 → Hidden 2: 8 × 6 weights + 6 biases = 48 + 6 = 54
• Hidden 2 → Output: 6 × 2 weights + 2 biases = 12 + 2 = 14

Total = 40 + 54 + 14 = 108

Answer: 108

Logic

Q12. [MCQ, 1 mark, ★]
Which of the following is logically equivalent to ¬(P → Q)?
(A) ¬P ∧ Q
(B) P ∧ ¬Q
(C) ¬P ∨ Q
(D) P ∨ ¬Q
Solution:
P → Q ≡ ¬P ∨ Q (material implication)
¬(P → Q) ≡ ¬(¬P ∨ Q) ≡ P ∧ ¬Q (De Morgan’s Law)

Answer: (B)
Q13. [MSQ, 2 marks, ★★]
Consider the following propositional logic statements. Which of the following are tautologies? (Select ALL correct answers)
(A) P ∨ ¬P
(B) P ∧ ¬P
(C) (P → Q) ∨ (Q → P)
(D) (P ∧ Q) → P
Solution:
(A) P ∨ ¬P: Law of excluded middle — always true. Tautology ✓
(B) P ∧ ¬P: Contradiction — always false. Not a tautology ✗
(C) (P → Q) ∨ (Q → P): Expand to (¬P ∨ Q) ∨ (¬Q ∨ P) = (¬P ∨ P) ∨ (¬Q ∨ Q) = T ∨ T = T. Tautology ✓
(D) (P ∧ Q) → P: If both P and Q are true, then P is true. For all other cases, the implication holds vacuously. Tautology ✓

Answer: (A), (C), (D)

Adversarial Search

Q14. [NAT, 2 marks, ★★]
Consider the following game tree where MAX moves first. The leaf node values (left to right) are: 3, 12, 8, 2, 4, 6, 14, 5, 2. The tree has a root (MAX), two children (MIN), and each MIN node has three children (leaf nodes). Apply the Minimax algorithm. What is the value at the root?
Solution:
Step 1: Group leaves under MIN nodes:
• Left MIN node: leaves = {3, 12, 8} → MIN picks 3
• Middle MIN node: leaves = {2, 4, 6} → MIN picks 2
• Right MIN node: leaves = {14, 5, 2} → MIN picks 2

Wait — the root MAX has two children (MIN nodes), but we have 9 leaves and 3 leaves per MIN, suggesting 3 MIN children. Let me re-read: “two children (MIN)” with 3 children each = 6 leaves. But 9 leaves are given, so there must be 3 MIN nodes.

Let’s assume 3 MIN children of MAX, each with 3 leaves:
• Left MIN: min(3, 12, 8) = 3
• Middle MIN: min(2, 4, 6) = 2
• Right MIN: min(14, 5, 2) = 2

Step 2: MAX at root: max(3, 2, 2) = 3

Answer: 3
Q15. [MCQ, 1 mark, ★★]
In alpha-beta pruning applied to a minimax tree, what condition causes a prune at a MIN node?
(A) α ≥ β at the MIN node
(B) α ≤ β at the MIN node
(C) The MIN node’s value exceeds its parent’s α
(D) The MIN node’s value equals its parent’s β
Solution:
Alpha-beta pruning prunes a subtree when it is certain that the subtree cannot influence the final decision. At a MIN node, pruning occurs when α ≥ β, meaning the MAX ancestor already has a guaranteed value (α) that is at least as good as what MIN can force (β). There is no point exploring further.

Answer: (A)

Common Question Patterns

Analysing previous year papers reveals recurring question formats that you should be prepared for:

Pattern 1: Algorithm Tracing

You are given a graph/tree and asked to trace an algorithm (BFS, DFS, A*, Minimax). The answer is typically the order of node expansions, the optimal path cost, or the value at the root. Practice: trace algorithms by hand on paper until it becomes second nature.

Pattern 2: Formula Application

Compute entropy, information gain, Gini index, precision/recall, Bayes’ theorem, gradient descent step, etc. These are pure numerical computation. Practice: memorize all formulas and solve 20+ numerical problems per topic.

Pattern 3: Property Verification

Which algorithm is complete? Which is optimal? Is this heuristic admissible? Is this sentence a tautology? These test deep conceptual understanding. Practice: create comparison tables of algorithm properties.

Pattern 4: Architecture Computation

Count parameters in a neural network, compute output dimensions of a convolutional layer, determine the number of weights in a specific layer. Practice: work through several architectures of varying depth.

Pattern 5: Counter-example / Edge Case

“Which of the following statements is FALSE?” or “Give a counter-example.” These require careful, precise knowledge. Practice: for each concept, know at least one common misconception or edge case.

Difficulty Analysis

Based on previous GATE DA papers, the AI section typically follows this difficulty distribution:

Difficulty Approx. Questions Approx. Marks Strategy
★ Easy5–77–10Must score — these are free marks
★★ Medium6–810–14Target 80%+ accuracy here
★★★ Hard2–44–8Attempt only if time permits or NAT/MSQ
Score Target: Scoring 22+ out of 30 in the AI section requires getting all Easy questions right, most Medium ones right, and at least 1–2 Hard questions. This is achievable with thorough preparation of high-priority topics.

Practice Recommendations

Recommended Practice Plan:
  1. Topic-wise PYQs first: After studying each chapter, immediately solve all related previous year questions from this compilation.
  2. Timed practice: Set a timer for each question. 1-mark: 2 minutes max. 2-mark: 4 minutes max.
  3. Error journal: Maintain a log of every wrong answer with the reason (conceptual gap, calculation error, misread question, time pressure).
  4. Revisit errors: Re-attempt all wrong questions after 1 week without looking at the solution.
  5. Mock tests: After completing all topics, take the Mock Tests under full exam conditions (3 hours, 65 questions).
Additional Resources: For topic-specific previous year questions, also check the dedicated PYQ pages in each chapter: