ClassScribeVol. 1August 2026

Q·Magazine

GATE DA — Subject-wise Special

Ten hand-picked questions from every core GATE Data Science & AI subject — with full solutions.

100Questions
10Subjects
GATE DAFocus

In this edition

01
GATE DA · Subject

Programming & DSA

Complexity analysis, data structures, and the algorithms that underpin every ML pipeline.

Q1.
HeapsHardMCQ
What is the tight worst-case time complexity of building a binary heap from an unsorted array of nn elements using bottom-up heapify?
  • A) O(nlogn)O(n \log n)
  • B) O(n)O(n)
  • C) O(logn)O(\log n)
  • D) O(n2)O(n^2)
Reveal solution
Answer
B
Solution

Although each of the O(n)O(n) heapify calls costs up to O(logn)O(\log n), most nodes are near the bottom where heapify does almost no work. Summing the cost over all levels gives h=0lognn2h+1h=O(n)\sum_{h=0}^{\log n} \frac{n}{2^{h+1}} \cdot h = O(n) — a tighter bound than the naive per-call estimate.

Q2.
HeapsHardNumerical
In a binary min-heap with n3n \ge 3 elements, the second-smallest element is guaranteed to be one of how many candidate nodes?
Reveal solution
Answer
2
Solution

In a min-heap every node is ≤ its children, so if the second-smallest value sat deeper than the root's children, its parent on the way up would itself have to be smaller — making the parent the second-smallest instead, a contradiction. So the second-smallest must be a direct child of the root, and a binary heap's root always has exactly 2 children (for n3n \ge 3).

Q3.
SortingMediumMCQ
Which sorting algorithm is NOT stable in its standard implementation?
  • A) Merge Sort
  • B) Insertion Sort
  • C) Quick Sort
  • D) Bubble Sort
Reveal solution
Answer
C
Solution

Quick Sort's partitioning swaps elements based on pivot position without regard to the relative order of equal keys, so equal elements can be reordered — it is not stable by default.

Q4.
Graph AlgorithmsMediumNumerical
What is the time complexity of Dijkstra's algorithm using a binary heap for a graph with VV vertices and EE edges? (write as an expression)
Reveal solution
Answer
O((V+E) log V)
Solution

Each of the VV extract-min operations costs O(logV)O(\log V), and each of the EE edge relaxations may trigger a decrease-key costing O(logV)O(\log V), giving O((V+E)logV)O((V+E)\log V) overall with a binary heap.

Q5.
Recurrences · Master TheoremHardMCQ
By the Master Theorem, the recurrence T(n)=3T(n/2)+O(n)T(n) = 3T(n/2) + O(n) solves to:
  • A) Θ(n)\Theta(n)
  • B) Θ(nlogn)\Theta(n \log n)
  • C) Θ(nlog23)\Theta(n^{\log_2 3})
  • D) Θ(n2)\Theta(n^2)
Reveal solution
Answer
C
Solution

Here a=3,b=2,f(n)=na=3, b=2, f(n)=n. Since nlogba=nlog23n1.58n^{\log_b a} = n^{\log_2 3} \approx n^{1.58} grows strictly faster than f(n)=nf(n)=n, this is Master Theorem Case 1, giving Θ(nlog23)\Theta(n^{\log_2 3}).

Q6.
Graph TheoryMediumNumerical
How many edges does a spanning tree of a connected, undirected graph with 12 vertices have?
Reveal solution
Answer
11
Solution

A spanning tree on nn vertices always has exactly n1n - 1 edges (enough to connect every vertex with no cycles). Here 121=1112 - 1 = 11.

Q7.
Data Structure DesignMediumMCQ
Which data structure combination supports both get and put in an LRU cache in O(1)O(1) time?
  • A) Array + linear scan
  • B) Doubly linked list + hash map
  • C) Binary search tree
  • D) Stack + queue
Reveal solution
Answer
B
Solution

The hash map gives O(1) lookup of a node by key; the doubly linked list lets you move that node to the front (most-recently-used) and evict the tail (least-recently-used) in O(1), since both operations only touch a constant number of pointers.

Q8.
HashingMediumNumerical
A hash table uses open addressing and currently stores 50 keys at load factor α=0.5\alpha = 0.5. What is the table size?
Reveal solution
Answer
100
Solution

Load factor α=n/m\alpha = n/m, where nn is the number of keys and mm is the table size. So m=n/α=50/0.5=100m = n/\alpha = 50/0.5 = 100.

Q9.
Trees · BSTMediumMCQ
Which traversal of a Binary Search Tree visits nodes in ascending sorted order?
  • A) Preorder
  • B) Inorder
  • C) Postorder
  • D) Level-order
Reveal solution
Answer
B
Solution

Inorder traversal (left → node → right) visits a BST's nodes in ascending order precisely because of the BST invariant: everything in the left subtree is smaller, everything in the right subtree is larger.

Q10.
TreesMediumNumerical
A complete binary tree has 100 nodes (root at height 0). What is its height?
Reveal solution
Answer
6
Solution

A complete binary tree of height hh holds between 2h2^h and 2h+112^{h+1}-1 nodes. For h=6h=6: range is [64,127][64, 127], and 100100 falls inside it, so the height is 6.

02
GATE DA · Subject

Probability & Statistics

Distributions, expectation, Bayesian inference, and hypothesis testing — the backbone of every model's uncertainty.

Q1.
Basic ProbabilityMediumNumerical
A fair coin is tossed 3 times. What is the probability of getting exactly 2 heads? (as a fraction)
Reveal solution
Answer
3/8
Solution

Number of ways to get exactly 2 heads out of 3 tosses = (32)=3\binom{3}{2} = 3. Total outcomes = 23=82^3 = 8. Probability = 3/83/8.

Q2.
Continuous Random VariablesMediumMCQ
For a continuous random variable XX, the probability that XX equals any exact single value is:
  • A) 1
  • B) 0
  • C) 0.5
  • D) Undefined
Reveal solution
Answer
B
Solution

For continuous distributions, probability is defined by area under the density curve over an interval. A single point has zero width, hence zero area, so P(X=x)=0P(X=x)=0 for any specific xx.

Q3.
Binomial DistributionMediumNumerical
If XBinomial(n=10,p=0.3)X \sim \text{Binomial}(n=10, p=0.3), what is E[X]E[X]?
Reveal solution
Answer
3
Solution

For a Binomial distribution, E[X]=np=10×0.3=3E[X] = np = 10 \times 0.3 = 3.

Q4.
Binomial DistributionMediumNumerical
For the same XBinomial(n=10,p=0.3)X \sim \text{Binomial}(n=10, p=0.3), what is Var(X)\text{Var}(X)?
Reveal solution
Answer
2.1
Solution

For a Binomial distribution, Var(X)=np(1p)=10×0.3×0.7=2.1\text{Var}(X) = np(1-p) = 10 \times 0.3 \times 0.7 = 2.1.

Q5.
Bayes' TheoremHardMCQ
A disease affects 1% of a population. A test is 99% sensitive (true positive rate) and 95% specific (true negative rate). If a random person tests positive, what is the approximate probability they actually have the disease?
  • A) ~2%
  • B) ~17%
  • C) ~50%
  • D) ~83%
Reveal solution
Answer
B
Solution

By Bayes' theorem: P(D+)=P(+D)P(D)P(+D)P(D)+P(+¬D)P(¬D)=0.99×0.010.99×0.01+0.05×0.99=0.00990.05940.167P(D|+) = \dfrac{P(+|D)P(D)}{P(+|D)P(D) + P(+|\lnot D)P(\lnot D)} = \dfrac{0.99 \times 0.01}{0.99\times 0.01 + 0.05\times 0.99} = \dfrac{0.0099}{0.0594} \approx 0.167, or about 17%. Low base-rate diseases stay unlikely even after a positive test.

Q6.
Basic ProbabilityMediumNumerical
Two fair dice are rolled. What is the probability that the sum equals 7? (as a fraction)
Reveal solution
Answer
1/6
Solution

Six of the 36 equally likely outcomes sum to 7: (1,6),(2,5),(3,4),(4,3),(5,2),(6,1). Probability = 6/36=1/66/36 = 1/6.

Q7.
Poisson DistributionMediumMCQ
Which distribution models the number of independent events occurring in a fixed interval, given a known constant average rate?
  • A) Binomial
  • B) Poisson
  • C) Normal
  • D) Uniform
Reveal solution
Answer
B
Solution

The Poisson distribution is the standard model for counting rare, independent events over a fixed interval of time or space at a known average rate λ\lambda.

Q8.
CorrelationHardNumerical
If corr(X,Y)=0.8\text{corr}(X, Y) = -0.8, what is corr(2X+5,Y)\text{corr}(-2X + 5, Y)?
Reveal solution
Answer
0.8
Solution

Correlation is invariant to linear transformations of either variable, except that scaling by a negative constant flips the sign: corr(aX+b,Y)=sign(a)corr(X,Y)\text{corr}(aX+b, Y) = \text{sign}(a)\cdot\text{corr}(X,Y). Here a=2a=-2, so the sign flips: (0.8)=0.8-(-0.8) = 0.8.

Q9.
Maximum Likelihood EstimationMediumMCQ
For iid samples from a Normal distribution, the Maximum Likelihood Estimate (MLE) of the mean μ\mu equals the:
  • A) Median of the sample
  • B) Sample mean
  • C) Mode of the sample
  • D) Sample variance
Reveal solution
Answer
B
Solution

Maximizing the Normal log-likelihood with respect to μ\mu gives μ^MLE=xˉ\hat\mu_{MLE} = \bar{x}, the sample mean — the same as the method-of-moments estimator here.

Q10.
Hypothesis TestingMediumMCQ
A hypothesis test yields a p-value of 0.03. At significance level α=0.05\alpha = 0.05, what is the decision?
  • A) Reject H0H_0
  • B) Fail to reject H0H_0
  • C) Accept H1H_1 is impossible
  • D) The test is inconclusive
Reveal solution
Answer
A
Solution

Since p=0.03<α=0.05p = 0.03 < \alpha = 0.05, the result is statistically significant at this level, so we reject the null hypothesis H0H_0.

03
GATE DA · Subject

Linear Algebra

Eigenvalues, rank, SVD and the geometry underneath every ML algorithm you will ever write.

Q1.
EigenvaluesEasyNumerical
What are the eigenvalues of A=[2003]A = \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix}? (list both, comma-separated)
Reveal solution
Answer
2, 3
Solution

For a diagonal matrix, the eigenvalues are simply the diagonal entries themselves, since Av=λvAv = \lambda v holds trivially for each standard basis vector.

Q2.
Matrix RankMediumNumerical
What is the rank of A=[1224]A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}?
Reveal solution
Answer
1
Solution

Row 2 is exactly 2×2\times Row 1 — the rows are linearly dependent. Only one independent row remains, so rank(A)=1\text{rank}(A) = 1.

Q3.
Orthogonal MatricesMediumMCQ
If AA is an orthogonal matrix, then ATAA^T A equals:
  • A) AA
  • B) A1A^{-1}
  • C) II (the identity)
  • D) The zero matrix
Reveal solution
Answer
C
Solution

Orthogonal matrices are defined by the property ATA=AAT=IA^T A = A A^T = I — their columns (and rows) form an orthonormal basis.

Q4.
DeterminantsEasyNumerical
Compute the determinant of A=[4213]A = \begin{bmatrix} 4 & 2 \\ 1 & 3 \end{bmatrix}.
Reveal solution
Answer
10
Solution

For a 2×22\times2 matrix, det(A)=adbc=(4)(3)(2)(1)=122=10\det(A) = ad - bc = (4)(3) - (2)(1) = 12 - 2 = 10.

Q5.
Singular Value DecompositionHardMCQ
In the Singular Value Decomposition A=UΣVTA = U\Sigma V^T, the columns of UU are:
  • A) Eigenvectors of ATAA^TA
  • B) Eigenvectors of AATAA^T
  • C) The eigenvalues of AA
  • D) A random orthonormal basis
Reveal solution
Answer
B
Solution

UU's columns are the eigenvectors of AATAA^T (the "left singular vectors"), while VV's columns are the eigenvectors of ATAA^TA (the "right singular vectors").

Q6.
Eigenvalues · TraceMediumNumerical
For A=[5412]A = \begin{bmatrix} 5 & 4 \\ 1 & 2 \end{bmatrix}, one eigenvalue is 6. What is the other?
Reveal solution
Answer
1
Solution

The trace equals the sum of the eigenvalues: tr(A)=5+2=7\text{tr}(A) = 5+2 = 7. If one eigenvalue is 6, the other is 76=17 - 6 = 1. (Check: det(A)=5241=6=6×1\det(A)=5\cdot2-4\cdot1=6=6\times1 ✓.)

Q7.
Vector SpacesEasyMCQ
Two vectors uu and vv are orthogonal if and only if:
  • A) uv=1u \cdot v = 1
  • B) uv=0u \cdot v = 0
  • C) u=v|u| = |v|
  • D) u=vu = v
Reveal solution
Answer
B
Solution

Orthogonality (a 90° angle between vectors) is exactly the condition that their dot product vanishes: uv=uvcosθ=0u \cdot v = |u||v|\cos\theta = 0 when θ=90°\theta = 90°.

Q8.
Rank-Nullity TheoremMediumNumerical
A 4×64 \times 6 matrix has rank 3. What is the dimension of its null space?
Reveal solution
Answer
3
Solution

By the Rank-Nullity Theorem, for an m×nm \times n matrix, rank+nullity=n\text{rank} + \text{nullity} = n (number of columns). Here n=6n=6, rank=3=3, so nullity =63=3= 6-3 = 3.

Q9.
DiagonalizationMediumMCQ
A square matrix AA of size n×nn \times n is diagonalizable if:
  • A) It is symmetric
  • B) It has nn linearly independent eigenvectors
  • C) It is invertible
  • D) Its determinant is nonzero
Reveal solution
Answer
B
Solution

Diagonalizability requires a full set of nn linearly independent eigenvectors so they can form the columns of an invertible matrix PP with A=PDP1A = PDP^{-1}. (Symmetric real matrices always satisfy this, but that is a sufficient, not necessary, condition in general.)

Q10.
Matrix BasicsEasyNumerical
What is the trace of a 3×33\times3 identity matrix?
Reveal solution
Answer
3
Solution

The trace is the sum of the diagonal entries. For I3I_3, all three diagonal entries are 1, so the trace is 3.

04
GATE DA · Subject

Calculus & Optimization

Gradient descent is calculus with a job — derivatives, convexity, and the machinery that trains a model.

Q1.
DerivativesEasyNumerical
Find dfdx\dfrac{df}{dx} for f(x)=3x2+5x7f(x) = 3x^2 + 5x - 7 at x=2x=2.
Reveal solution
Answer
17
Solution

f(x)=6x+5f'(x) = 6x + 5. At x=2x=2: f(2)=12+5=17f'(2) = 12 + 5 = 17.

Q2.
ConvexityMediumMCQ
A twice-differentiable function ff is convex on an interval if:
  • A) f(x)<0f''(x) < 0 everywhere on it
  • B) f(x)0f''(x) \ge 0 everywhere on it
  • C) f(x)=0f''(x) = 0 everywhere on it
  • D) f(x)f'(x) is undefined on it
Reveal solution
Answer
B
Solution

A function is convex on an interval exactly when its second derivative is non-negative throughout — the slope never decreases, so the curve bends upward or stays flat.

Q3.
Gradient DescentMediumNumerical
In gradient descent with learning rate η=0.1\eta = 0.1, the gradient at the current point is 4. What is the parameter update Δx\Delta x?
Reveal solution
Answer
-0.4
Solution

The gradient descent update rule is Δx=ηf=0.1×4=0.4\Delta x = -\eta \cdot \nabla f = -0.1 \times 4 = -0.4 — a step in the direction opposite the gradient.

Q4.
Hessian MatrixMediumMCQ
The Hessian matrix of a multivariable function contains:
  • A) First partial derivatives
  • B) Second partial derivatives
  • C) Only the diagonal terms
  • D) The eigenvalues of the gradient
Reveal solution
Answer
B
Solution

The Hessian is the square matrix of all second-order partial derivatives, Hij=2fxixjH_{ij} = \dfrac{\partial^2 f}{\partial x_i \partial x_j}, and its definiteness tells you whether a critical point is a min, max, or saddle.

Q5.
Unconstrained OptimizationMediumNumerical
Minimize f(x)=x24x+7f(x) = x^2 - 4x + 7. At what value of xx does the minimum occur?
Reveal solution
Answer
2
Solution

Set f(x)=2x4=0x=2f'(x) = 2x - 4 = 0 \Rightarrow x = 2. Since f(x)=2>0f''(x)=2>0, this critical point is indeed a minimum.

Q6.
Lagrange MultipliersMediumMCQ
Lagrange multipliers are the standard technique for optimization problems with:
  • A) No constraints at all
  • B) Equality constraints
  • C) Discrete-only variables
  • D) Constraints that cannot be expressed as equations
Reveal solution
Answer
B
Solution

The method of Lagrange multipliers finds the extrema of f(x)f(x) subject to one or more equality constraints g(x)=0g(x) = 0 by solving f=λg\nabla f = \lambda \nabla g.

Q7.
Chain RuleMediumNumerical
Using the chain rule, find ddx[sin(x2)]\dfrac{d}{dx}\left[\sin(x^2)\right] evaluated at x=0x = 0.
Reveal solution
Answer
0
Solution

By the chain rule, ddxsin(x2)=cos(x2)2x\dfrac{d}{dx}\sin(x^2) = \cos(x^2)\cdot 2x. At x=0x=0: cos(0)×0=1×0=0\cos(0)\times 0 = 1 \times 0 = 0.

Q8.
Stochastic Gradient DescentMediumMCQ
Compared to batch gradient descent, Stochastic Gradient Descent (SGD) computes each update using:
  • A) The entire dataset every step
  • B) A single (or small batch of) randomly sampled example(s)
  • C) Second-order derivatives of the loss
  • D) No gradient information at all
Reveal solution
Answer
B
Solution

SGD approximates the true gradient using one example (or a small mini-batch) per step, trading some noise in each update for dramatically faster, more scalable iterations.

Q9.
Partial DerivativesMediumNumerical
Find fy\dfrac{\partial f}{\partial y} for f(x,y)=x2y+3y2f(x,y) = x^2y + 3y^2 at the point (x,y)=(1,2)(x,y) = (1,2).
Reveal solution
Answer
13
Solution

fy=x2+6y\dfrac{\partial f}{\partial y} = x^2 + 6y. At (1,2)(1,2): 1+12=131 + 12 = 13.

Q10.
Saddle PointsHardMCQ
A saddle point in optimization is a point where:
  • A) The function achieves a global minimum
  • B) The gradient is zero, but it is neither a local minimum nor a local maximum
  • C) The function is undefined
  • D) The second derivative is always positive
Reveal solution
Answer
B
Solution

At a saddle point f=0\nabla f = 0 (it is a critical point), but the function curves upward in some directions and downward in others — the Hessian is indefinite, so it is neither a max nor a min.

05
GATE DA · Subject

Machine Learning

The gap between a model that merely fits and one that actually works — bias, variance, regularization, and evaluation.

Q1.
Bias-Variance TradeoffMediumMCQ
Increasing model complexity (e.g., a higher-degree polynomial fit) typically:
  • A) Increases bias and decreases variance
  • B) Decreases bias and increases variance
  • C) Decreases both bias and variance
  • D) Increases both bias and variance
Reveal solution
Answer
B
Solution

More complex models fit the training data more closely (lower bias) but become more sensitive to the specific training sample (higher variance) — the classic bias-variance tradeoff.

Q2.
RegularizationMediumMCQ
L1 regularization (Lasso) on a linear model's weights tends to produce:
  • A) Dense weight vectors with all weights nonzero
  • B) Sparse weight vectors with many weights exactly zero
  • C) Only positive weights
  • D) No change to the weights
Reveal solution
Answer
B
Solution

L1's penalty w|w| has a non-differentiable kink at zero that pushes many coefficients to exactly zero, performing implicit feature selection — unlike L2, whose smooth penalty shrinks weights but rarely zeroes them out.

Q3.
Cross-ValidationEasyNumerical
In 5-fold cross-validation on a dataset of 1,000 samples, how many samples are in each validation fold (assuming an equal split)?
Reveal solution
Answer
200
Solution

With k=5k=5 folds on 1,000 samples, each fold gets 1000/5=2001000/5 = 200 samples for validation while the rest train the model.

Q4.
SVM · KernelsHardMCQ
The "kernel trick" in Support Vector Machines allows:
  • A) Reducing the size of the training dataset
  • B) Implicitly computing inner products in a higher-dimensional feature space, without ever forming that space explicitly
  • C) Removing outliers automatically
  • D) Faster training only, with no effect on decision boundaries
Reveal solution
Answer
B
Solution

A kernel function K(x,y)=ϕ(x)ϕ(y)K(x,y) = \phi(x)\cdot\phi(y) computes the inner product as if the data had been mapped to a (possibly infinite-dimensional) space ϕ\phi, without ever computing ϕ(x)\phi(x) directly — making nonlinear boundaries tractable.

Q5.
k-Nearest NeighboursMediumNumerical
A kk-NN classifier with k=1k=1 is evaluated on its own training set (no duplicate points with conflicting labels). What is its training accuracy (as a %)?
Reveal solution
Answer
100
Solution

With k=1k=1, each training point's nearest neighbor is itself (distance 0), so it always predicts its own true label — giving 100% training accuracy, though this says nothing about generalization.

Q6.
Ensemble MethodsMediumMCQ
Which ensemble method builds trees sequentially, with each new tree focused on correcting the errors of the previous ones?
  • A) Bagging
  • B) Random Forest
  • C) Boosting
  • D) Simple majority voting
Reveal solution
Answer
C
Solution

Boosting (e.g., AdaBoost, Gradient Boosting) trains weak learners sequentially, reweighting or refitting on the residual errors of prior learners — unlike bagging/Random Forest, which train independent trees in parallel.

Q7.
Decision Trees · Gini ImpurityMediumNumerical
A node with Gini impurity 0.5 is split into two equal-size children with Gini impurities 0.3 and 0.4. What is the weighted-average Gini impurity after the split?
Reveal solution
Answer
0.35
Solution

With equal-size children, the weighted average is simply the mean: (0.3+0.4)/2=0.35(0.3 + 0.4)/2 = 0.35 — a decrease from the parent's 0.5, indicating a useful split.

Q8.
Principal Component AnalysisMediumMCQ
Principal Component Analysis (PCA) finds new axes (principal components) that:
  • A) Maximize the variance of the projected data
  • B) Minimize the variance of the projected data
  • C) Maximize class separation between labels
  • D) Are chosen at random
Reveal solution
Answer
A
Solution

PCA finds orthogonal directions ordered by how much variance of the (unlabeled) data they capture — the first principal component is the direction of maximum variance.

Q9.
Evaluation MetricsMediumNumerical
A binary classifier has confusion matrix TP=40, FP=10, FN=5, TN=45. What is its precision (as a decimal)?
Reveal solution
Answer
0.8
Solution

Precision =TPTP+FP=4040+10=4050=0.8= \dfrac{TP}{TP+FP} = \dfrac{40}{40+10} = \dfrac{40}{50} = 0.8.

Q10.
Model SelectionMediumMCQ
In practice, the bias-variance tradeoff is best managed by:
  • A) Increasing model complexity indefinitely
  • B) Using cross-validation to tune model complexity/regularization
  • C) Relying only on training error
  • D) Ignoring validation performance entirely
Reveal solution
Answer
B
Solution

Cross-validation estimates out-of-sample performance across complexity/regularization settings, letting you pick the sweet spot where bias and variance together minimize validation error.

06
GATE DA · Subject

Deep Learning

Backprop, gates, kernels, attention — the vocabulary of modern AI, tested precisely.

Q1.
BackpropagationMediumMCQ
Backpropagation computes gradients of the loss with respect to each weight using:
  • A) Only the forward pass
  • B) The chain rule of calculus, propagated backward through the network
  • C) Random search over weight values
  • D) Genetic algorithms
Reveal solution
Answer
B
Solution

Backpropagation is a systematic application of the multivariable chain rule, computing L/w\partial L/\partial w layer by layer from the output back to the input, reusing intermediate gradients.

Q2.
Vanishing GradientsMediumMCQ
The vanishing gradient problem in deep networks is most strongly associated with which activation choice in hidden layers?
  • A) ReLU
  • B) Sigmoid/Tanh
  • C) Batch normalization
  • D) Dropout
Reveal solution
Answer
B
Solution

Sigmoid and tanh saturate for large-magnitude inputs, driving their derivatives toward 0. Multiplying many such small derivatives during backprop through deep networks shrinks the gradient toward zero at earlier layers.

Q3.
Activation FunctionsEasyNumerical
For ReLU f(x)=max(0,x)f(x) = \max(0,x), compute f(3)+f(5)f(-3) + f(5).
Reveal solution
Answer
5
Solution

f(3)=max(0,3)=0f(-3) = \max(0,-3) = 0 and f(5)=max(0,5)=5f(5) = \max(0,5) = 5. Sum =0+5=5= 0 + 5 = 5.

Q4.
DropoutMediumMCQ
Dropout regularization during training works by:
  • A) Permanently removing entire layers
  • B) Randomly deactivating a fraction of neurons on each training iteration
  • C) Reducing the learning rate over time
  • D) Adding an L2 penalty to the weights
Reveal solution
Answer
B
Solution

Dropout randomly zeroes a fraction of a layer's activations on each forward pass during training, forcing the network to avoid over-relying on any single neuron and reducing overfitting.

Q5.
CNN · PoolingMediumMCQ
In a CNN, the primary purpose of a pooling (e.g., max-pooling) layer is to:
  • A) Increase spatial resolution
  • B) Reduce spatial dimensions and add a degree of translation invariance
  • C) Add more learnable parameters
  • D) Normalize the input pixel values
Reveal solution
Answer
B
Solution

Pooling downsamples feature maps (reducing computation and overfitting) while making the representation more robust to small shifts in where a feature appears.

Q6.
CNN · ConvolutionsMediumNumerical
A 2D convolution uses a 3×33\times3 kernel with stride 1 and no padding on a 7×77\times7 input. What is the output size (per dimension)?
Reveal solution
Answer
5
Solution

Output size =WKS+1=731+1=5= \dfrac{W - K}{S} + 1 = \dfrac{7-3}{1} + 1 = 5, so the output is 5×55\times5.

Q7.
LSTMHardMCQ
LSTMs address the vanishing gradient problem of vanilla RNNs primarily through:
  • A) Simply stacking more recurrent layers
  • B) Gated memory cells (forget, input, output gates) that regulate information flow
  • C) Using a much larger learning rate
  • D) Dropout applied only at the output layer
Reveal solution
Answer
B
Solution

LSTM's gating mechanism lets gradients flow through the cell state largely unimpeded across many time steps, avoiding the repeated multiplicative shrinkage that plagues vanilla RNNs.

Q8.
Transformers · AttentionHardMCQ
The self-attention mechanism in Transformers computes relevance between tokens using:
  • A) Convolutional filters sliding over the sequence
  • B) Query–Key–Value dot products, scaled and softmax-normalized
  • C) Recurrent hidden states passed step by step
  • D) Max-pooling over the sequence
Reveal solution
Answer
B
Solution

Self-attention projects each token into Query, Key and Value vectors; attention weights come from scaled dot products of Queries and Keys (softmax-normalized), then weight the Values — letting every token attend directly to every other token.

Q9.
Neural Network BasicsEasyNumerical
A fully connected layer has 100 input neurons and 50 output neurons (no bias terms). How many weight parameters does it have?
Reveal solution
Answer
5000
Solution

A dense layer connects every input neuron to every output neuron: 100×50=5,000100 \times 50 = 5{,}000 weights.

Q10.
Batch NormalizationMediumMCQ
Batch normalization primarily helps training by:
  • A) Increasing the total number of model parameters substantially
  • B) Normalizing layer inputs (mean 0, variance 1) to stabilize and speed up training
  • C) Removing the need for any activation function
  • D) Guaranteeing zero overfitting
Reveal solution
Answer
B
Solution

Batch norm re-centers and re-scales each layer's inputs using batch statistics, reducing internal covariate shift and allowing higher learning rates and faster, more stable convergence.

07
GATE DA · Subject

Artificial Intelligence

Before AI could learn, it had to search and reason — the logic and search foundations every data scientist still leans on.

Q1.
A* SearchMediumMCQ
The A* search algorithm selects the next node to expand using the evaluation function:
  • A) f(n)=g(n)f(n) = g(n)
  • B) f(n)=h(n)f(n) = h(n)
  • C) f(n)=g(n)+h(n)f(n) = g(n) + h(n)
  • D) f(n)=g(n)h(n)f(n) = g(n) - h(n)
Reveal solution
Answer
C
Solution

A* combines g(n)g(n), the actual cost from the start to nn, with h(n)h(n), the heuristic estimate of remaining cost to the goal, expanding the node with the lowest total estimated cost f(n)=g(n)+h(n)f(n) = g(n) + h(n).

Q2.
A* Search · AdmissibilityHardMCQ
For A* to guarantee an optimal solution (with tree search), the heuristic h(n)h(n) must be:
  • A) Always exactly zero
  • B) Admissible — it never overestimates the true remaining cost
  • C) As large as possible regardless of accuracy
  • D) Randomly generated
Reveal solution
Answer
B
Solution

An admissible heuristic never overestimates the true cost-to-goal, which guarantees A* will never miss an optimal path in favor of a suboptimal one it wrongly believes is cheaper.

Q3.
BFS ComplexityMediumNumerical
Using the standard worst-case bound O(bd)O(b^d) for BFS, compute bdb^d for branching factor b=3b=3 and solution depth d=4d=4.
Reveal solution
Answer
81
Solution

34=3×3×3×3=813^4 = 3 \times 3 \times 3 \times 3 = 81.

Q4.
Alpha-Beta PruningHardMCQ
Alpha-beta pruning applied to the minimax algorithm:
  • A) Explores fewer or equal nodes than plain minimax, while returning the identical final decision
  • B) Can return a different (possibly worse) decision than plain minimax
  • C) Only works in games with more than two players
  • D) Removes the need for any heuristic evaluation function
Reveal solution
Answer
A
Solution

Alpha-beta pruning is a pure optimization: it safely skips branches that cannot possibly influence the final decision, so it always returns the same result as plain minimax while visiting fewer nodes.

Q5.
Propositional LogicMediumMCQ
In propositional logic, (PQ)(P \rightarrow Q) is logically equivalent to:
  • A) PQP \land Q
  • B) ¬PQ\lnot P \lor Q
  • C) P¬QP \lor \lnot Q
  • D) ¬P¬Q\lnot P \land \lnot Q
Reveal solution
Answer
B
Solution

The implication PQP \rightarrow Q is true whenever PP is false or QQ is true, which is exactly the truth condition of ¬PQ\lnot P \lor Q — a standard logical equivalence.

Q6.
DFS ComplexityMediumNumerical
DFS has worst-case space complexity O(bm)O(bm), where bb is the branching factor and mm is the maximum depth. For b=2b=2 and m=5m=5, what is bmbm?
Reveal solution
Answer
10
Solution

Simply bm=2×5=10bm = 2 \times 5 = 10 — DFS only needs to store one path from root to leaf plus the unexplored siblings along it, which is linear rather than exponential in depth.

Q7.
First-Order LogicMediumMCQ
The first-order logic statement x(Bird(x)CanFly(x))\forall x\, (\text{Bird}(x) \rightarrow \text{CanFly}(x)) is an example of:
  • A) Existential quantification
  • B) Universal quantification
  • C) A propositional (not first-order) statement
  • D) A logical contradiction
Reveal solution
Answer
B
Solution

The \forall symbol is the universal quantifier — the statement asserts the implication holds for every xx, not just some particular one.

Q8.
Uninformed SearchMediumMCQ
Setting the heuristic h(n)=0h(n) = 0 for every node in A* search reduces it to:
  • A) Depth-first search
  • B) Uniform-cost search (Dijkstra-like)
  • C) Greedy best-first search
  • D) Random search
Reveal solution
Answer
B
Solution

With h(n)=0h(n)=0, A*'s evaluation function becomes f(n)=g(n)f(n)=g(n) alone — expanding nodes purely by accumulated path cost, which is exactly uniform-cost search.

Q9.
Constraint Satisfaction ProblemsMediumNumerical
A Constraint Satisfaction Problem has 4 variables, each with a domain of size 3. What is the size of the unconstrained search space?
Reveal solution
Answer
81
Solution

Each of the 4 variables independently picks one of 3 values, so the total number of assignments is 34=813^4 = 81.

Q10.
Rule-Based SystemsMediumMCQ
Forward chaining in a rule-based expert system starts from:
  • A) The goal, and works backward to find supporting facts
  • B) Known facts, and derives new facts by firing applicable rules
  • C) A randomly chosen rule
  • D) Only negated facts
Reveal solution
Answer
B
Solution

Forward chaining is data-driven: it starts from the known facts in the knowledge base and repeatedly fires rules whose conditions are satisfied, deriving new facts until the goal is reached (or no more rules apply).

08
GATE DA · Subject

DBMS & Warehousing

Normalization, transactions, and the warehouse architecture behind every dashboard.

Q1.
Normalization · 2NFMediumMCQ
A relation is in Second Normal Form (2NF) if it is in 1NF and additionally:
  • A) It has no transitive dependencies at all
  • B) Every non-prime attribute is fully functionally dependent on the whole of every candidate key
  • C) It has exactly one candidate key
  • D) It is already in BCNF
Reveal solution
Answer
B
Solution

2NF eliminates partial dependency: no non-prime attribute may depend on only part of a composite candidate key — every non-prime attribute must depend on the entire key.

Q2.
ACID PropertiesEasyMCQ
In the ACID properties of database transactions, "A" stands for:
  • A) Availability
  • B) Atomicity
  • C) Accuracy
  • D) Aggregation
Reveal solution
Answer
B
Solution

Atomicity guarantees a transaction executes as a single indivisible unit — either all of its operations commit, or none do.

Q3.
Functional DependenciesMediumNumerical
Relation R(A,B,C,D)R(A,B,C,D) has functional dependencies ABA\to B, BCB\to C, CDC\to D. How many attributes are in the closure A+A^+?
Reveal solution
Answer
4
Solution

Starting from {A}\{A\}: ABA\to B adds BB; BCB\to C adds CC; CDC\to D adds DD. So A+={A,B,C,D}A^+ = \{A,B,C,D\} — all 4 attributes, meaning AA alone is a candidate key.

Q4.
Star SchemaEasyMCQ
In a data warehouse star schema, the central table holding numeric measures (e.g., sales amount) is the:
  • A) Dimension table
  • B) Fact table
  • C) Lookup table
  • D) Bridge table
Reveal solution
Answer
B
Solution

The fact table sits at the center of the star, storing measurable, quantitative facts along with foreign keys to the surrounding dimension tables (time, product, customer, etc.).

Q5.
OLAP vs OLTPMediumMCQ
OLAP (Online Analytical Processing) systems are primarily optimized for:
  • A) High-throughput single-row transactional inserts/updates
  • B) Complex, multidimensional analytical queries and aggregations
  • C) Real-time single-record lookups only
  • D) Bulk deletion operations
Reveal solution
Answer
B
Solution

OLAP systems are built for analytical workloads — slicing, dicing, and aggregating large historical datasets — unlike OLTP systems, which are tuned for fast, frequent, small transactions.

Q6.
B+ TreesMediumNumerical
A B+ tree has order p=4p=4, meaning each leaf node can hold at most p1p-1 keys. What is the maximum number of keys a leaf node can hold?
Reveal solution
Answer
3
Solution

By the standard B+ tree convention, a leaf node of order pp holds at most p1p-1 keys: 41=34-1=3.

Q7.
Normalization · BCNFHardMCQ
A relation is in Boyce-Codd Normal Form (BCNF) if, for every non-trivial functional dependency XYX \to Y:
  • A) YY must be a prime attribute
  • B) XX must be a superkey
  • C) XX must be a candidate key strictly smaller than a superkey
  • D) YY must itself be a candidate key
Reveal solution
Answer
B
Solution

BCNF is a stricter version of 3NF: for every non-trivial FD XYX\to Y, the determinant XX must be a superkey of the relation — no exceptions for prime attributes.

Q8.
SQL AggregationEasyMCQ
The SQL query SELECT COUNT(*) FROM Employees WHERE Salary > 50000; performs:
  • A) A join operation
  • B) An aggregation combined with a row-selection filter
  • C) A correlated subquery
  • D) A view creation
Reveal solution
Answer
B
Solution

The WHERE clause filters rows (selection), and COUNT(*) then aggregates the filtered rows into a single count — a filter followed by an aggregate.

Q9.
Candidate KeysMediumNumerical
A relation has attributes A, B, C, D, E with candidate keys {A,B}\{A,B\} and {C}\{C\}. How many prime attributes does the relation have?
Reveal solution
Answer
3
Solution

A prime attribute is any attribute that belongs to at least one candidate key. Here that set is {A,B,C}\{A, B, C\} (D and E belong to no candidate key), giving 3 prime attributes.

Q10.
ETLEasyMCQ
In data warehousing, the abbreviation "ETL" stands for:
  • A) Extract, Transform, Load
  • B) Evaluate, Test, Launch
  • C) Encode, Transmit, Log
  • D) Extract, Transmit, Load
Reveal solution
Answer
A
Solution

ETL — Extract (pull data from sources), Transform (clean/reshape it), Load (write it into the warehouse) — is the standard pipeline pattern for populating a data warehouse.

09
GATE DA · Subject

Data Science & Big Data

The unglamorous 80% of the job — cleaning, scaling, splitting, and moving data at scale.

Q1.
PandasEasyMCQ
In Pandas, which method removes rows containing any NaN values from a DataFrame df?
  • A) df.fillna()
  • B) df.dropna()
  • C) df.drop_duplicates()
  • D) df.isnull()
Reveal solution
Answer
B
Solution

df.dropna() removes rows (by default) that contain any missing (NaN) values; fillna() instead imputes a value, and isnull() only flags them without removing anything.

Q2.
Descriptive StatisticsEasyNumerical
A dataset has the values [10, 12, 23, 23, 16, 23, 21, 16]. What is the mode?
Reveal solution
Answer
23
Solution

23 appears 3 times, more than any other value (16 appears twice, all others once), making it the mode.

Q3.
Feature ScalingEasyMCQ
Min-max normalization rescales a feature's values to lie within:
  • A) [1,1][-1, 1] always
  • B) [0,1][0, 1] (by the standard definition)
  • C) An unbounded range
  • D) The range [mean,std][\text{mean}, \text{std}]
Reveal solution
Answer
B
Solution

Min-max scaling maps xxxminxmaxxminx \to \dfrac{x - x_{min}}{x_{max}-x_{min}}, which by construction lands every value in [0,1][0,1].

Q4.
MapReduceMediumMCQ
In the MapReduce paradigm, the "Reduce" phase primarily performs:
  • A) Splitting the raw input into chunks
  • B) Aggregating/combining all values that share the same key
  • C) Sorting only the raw input files
  • D) Transferring files across the network with no computation
Reveal solution
Answer
B
Solution

After the Map phase emits key-value pairs and the framework groups/shuffles them by key, the Reduce phase aggregates all values sharing each key (e.g., summing counts) into the final output.

Q5.
Train-Test SplitEasyNumerical
A dataset of 10,000 records is split 80-20 into train and test sets. How many records are in the test set?
Reveal solution
Answer
2000
Solution

20% of 10,000 is 0.20×10000=2,0000.20 \times 10000 = 2{,}000 records.

Q6.
StandardizationEasyMCQ
Z-score standardization transforms a feature so that it has:
  • A) Mean 0 and standard deviation 1
  • B) Mean 1 and standard deviation 0
  • C) A guaranteed range of [0,1][0,1]
  • D) Only positive values
Reveal solution
Answer
A
Solution

The z-score transform z=xμσz = \dfrac{x - \mu}{\sigma} centers the data at mean 0 with unit standard deviation, by construction.

Q7.
Z-ScoreEasyNumerical
Compute the z-score of x=85x=85, given mean μ=70\mu=70 and standard deviation σ=10\sigma=10.
Reveal solution
Answer
1.5
Solution

z=xμσ=857010=1510=1.5z = \dfrac{x-\mu}{\sigma} = \dfrac{85-70}{10} = \dfrac{15}{10} = 1.5.

Q8.
NumPy BroadcastingMediumMCQ
In NumPy, "broadcasting" refers to:
  • A) Performing element-wise operations between arrays of different but compatible shapes, without writing explicit loops
  • B) Operations restricted only to 1D arrays
  • C) Automatic parallelization across multiple GPUs
  • D) Converting between data types only
Reveal solution
Answer
A
Solution

Broadcasting is NumPy's rule set for implicitly expanding smaller arrays to match the shape of larger ones during arithmetic, avoiding explicit Python loops and copies where possible.

Q9.
Sampling MethodsMediumMCQ
Which sampling method deliberately ensures every subgroup of a population is proportionally represented in the sample?
  • A) Simple random sampling
  • B) Stratified sampling
  • C) Convenience sampling
  • D) Snowball sampling
Reveal solution
Answer
B
Solution

Stratified sampling divides the population into subgroups (strata) and samples proportionally from each, guaranteeing representation that simple random sampling cannot guarantee by chance alone.

Q10.
Big Data ScaleEasyNumerical
A pipeline processes 1 TB of data per day. Over a 30-day month, approximately how much data (in TB) is processed in total?
Reveal solution
Answer
30
Solution

1 TB/day×30 days=30 TB1\ \text{TB/day} \times 30\ \text{days} = 30\ \text{TB}.

10
GATE DA · Subject

General Aptitude

GATE never lets you forget the basics — quantitative and verbal reasoning to close out the paper.

Q1.
Ratio & ProportionEasyNumerical
The ratio of two numbers is 3 : 5 and their sum is 96. What is the larger number?
Reveal solution
Answer
60
Solution

Let the numbers be 3x3x and 5x5x: 3x+5x=968x=96x=123x+5x=96 \Rightarrow 8x=96 \Rightarrow x=12. The larger number is 5x=605x = 60.

Q2.
Verbal · AntonymsEasyMCQ
Choose the word most nearly OPPOSITE in meaning to "TRANSIENT":
  • A) Fleeting
  • B) Permanent
  • C) Brief
  • D) Temporary
Reveal solution
Answer
B
Solution

"Transient" means lasting only a short time. Its opposite is "permanent" (lasting indefinitely); the other three options are near-synonyms of "transient" itself.

Q3.
Time-Speed-DistanceEasyNumerical
A train travels 300 km in 5 hours. At the same speed, how long (in hours) will it take to travel 480 km?
Reveal solution
Answer
8
Solution

Speed =300/5=60= 300/5 = 60 km/h. Time for 480 km =480/60=8= 480/60 = 8 hours.

Q4.
Verbal · AnalogyEasyMCQ
Complete the analogy: Doctor : Hospital :: Judge : ?
  • A) Court
  • B) Law
  • C) Jail
  • D) Police
Reveal solution
Answer
A
Solution

A doctor practices in a hospital; analogously, a judge presides in a court — the relationship is "professional : primary workplace".

Q5.
Number SeriesMediumNumerical
Find the next number in the series: 5, 11, 23, 47, ?
Reveal solution
Answer
95
Solution

Each term follows tn+1=2tn+1t_{n+1} = 2t_n + 1: 5115\to11, 112311\to23, 234723\to47, and 47×2+1=9547\times2+1=95.

Q6.
Logical ReasoningHardMCQ
Statement: "All engineers are punctual. Some punctual people are managers." Which conclusion necessarily follows?
  • A) All engineers are managers
  • B) Some managers are definitely engineers
  • C) No engineers are managers
  • D) It cannot be determined whether any engineers are managers
Reveal solution
Answer
D
Solution

The premises only place engineers inside the "punctual" group and managers inside a possibly different, overlapping part of the "punctual" group — the two groups (engineers, managers) may or may not intersect, so no definite conclusion follows.

Q7.
Simple InterestEasyNumerical
A sum of ₹12,000 becomes ₹13,200 in 2 years at simple interest. What is the rate of interest (% per annum)?
Reveal solution
Answer
5
Solution

SI =1320012000=1200= 13200-12000 = 1200. Using SI=PRT100SI = \dfrac{P \cdot R \cdot T}{100}: 1200=12000×R×2100R=12000024000=5%1200 = \dfrac{12000 \times R \times 2}{100} \Rightarrow R = \dfrac{120000}{24000} = 5\%.

Q8.
Verbal · IdiomsEasyMCQ
Which of the following best expresses the meaning of the idiom "to bite the bullet"?
  • A) To avoid a difficult situation entirely
  • B) To face a difficult or unpleasant situation with courage
  • C) To eat something quickly
  • D) To argue aggressively with someone
Reveal solution
Answer
B
Solution

"To bite the bullet" means to accept and endure something unpleasant or difficult because it is unavoidable.

Q9.
Sets · Venn DiagramsMediumNumerical
In a class of 50 students, 30 play cricket, 25 play football, and 10 play both. How many play neither sport?
Reveal solution
Answer
5
Solution

By inclusion-exclusion, students playing at least one sport =30+2510=45= 30+25-10=45. Those playing neither =5045=5= 50-45=5.

Q10.
Verbal · GrammarEasyMCQ
Choose the correctly punctuated sentence:
  • A) "Its a great day, isnt it?"
  • B) "It's a great day, isn't it?"
  • C) "Its' a great day, isnt' it?"
  • D) "It is a great day, isn,t it?"
Reveal solution
Answer
B
Solution

"It's" (contraction of "it is") and "isn't" (contraction of "is not") both require apostrophes exactly where option B places them.

Want the full GATE DA grind?

Generate unlimited subject-wise mock tests with AI, or work through our free exam question banks.