01GATE DA · Subject
Programming & DSA
Complexity analysis, data structures, and the algorithms that underpin every ML pipeline.
Q1.Heaps—Hard—MCQ
What is the tight worst-case time complexity of building a binary heap from an unsorted array of n elements using bottom-up heapify? - A) O(nlogn)
- B) O(n)
- C) O(logn)
- D) O(n2)
Reveal solution
AnswerB
SolutionAlthough each of the O(n) heapify calls costs up to O(logn), most nodes are near the bottom where heapify does almost no work. Summing the cost over all levels gives ∑h=0logn2h+1n⋅h=O(n) — a tighter bound than the naive per-call estimate.
Q2.Heaps—Hard—Numerical
In a binary min-heap with n≥3 elements, the second-smallest element is guaranteed to be one of how many candidate nodes? Reveal solution
Answer2
SolutionIn 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 n≥3).
Q3.Sorting—Medium—MCQ
Which sorting algorithm is NOT stable in its standard implementation?
- A) Merge Sort
- B) Insertion Sort
- C) Quick Sort
- D) Bubble Sort
Reveal solution
AnswerC
SolutionQuick 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 Algorithms—Medium—Numerical
What is the time complexity of Dijkstra's algorithm using a binary heap for a graph with V vertices and E edges? (write as an expression) Reveal solution
AnswerO((V+E) log V)
SolutionEach of the V extract-min operations costs O(logV), and each of the E edge relaxations may trigger a decrease-key costing O(logV), giving O((V+E)logV) overall with a binary heap.
Q5.Recurrences · Master Theorem—Hard—MCQ
By the Master Theorem, the recurrence T(n)=3T(n/2)+O(n) solves to: - A) Θ(n)
- B) Θ(nlogn)
- C) Θ(nlog23)
- D) Θ(n2)
Reveal solution
AnswerC
SolutionHere a=3,b=2,f(n)=n. Since nlogba=nlog23≈n1.58 grows strictly faster than f(n)=n, this is Master Theorem Case 1, giving Θ(nlog23).
Q6.Graph Theory—Medium—Numerical
How many edges does a spanning tree of a connected, undirected graph with 12 vertices have?
Reveal solution
Answer11
SolutionA spanning tree on n vertices always has exactly n−1 edges (enough to connect every vertex with no cycles). Here 12−1=11.
Q7.Data Structure Design—Medium—MCQ
Which data structure combination supports both get and put in an LRU cache in O(1) time? - A) Array + linear scan
- B) Doubly linked list + hash map
- C) Binary search tree
- D) Stack + queue
Reveal solution
AnswerB
SolutionThe 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.Hashing—Medium—Numerical
A hash table uses open addressing and currently stores 50 keys at load factor α=0.5. What is the table size? Reveal solution
Answer100
SolutionLoad factor α=n/m, where n is the number of keys and m is the table size. So m=n/α=50/0.5=100.
Q9.Trees · BST—Medium—MCQ
Which traversal of a Binary Search Tree visits nodes in ascending sorted order?
- A) Preorder
- B) Inorder
- C) Postorder
- D) Level-order
Reveal solution
AnswerB
SolutionInorder 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.Trees—Medium—Numerical
A complete binary tree has 100 nodes (root at height 0). What is its height?
Reveal solution
Answer6
SolutionA complete binary tree of height h holds between 2h and 2h+1−1 nodes. For h=6: range is [64,127], and 100 falls inside it, so the height is 6.
02GATE DA · Subject
Probability & Statistics
Distributions, expectation, Bayesian inference, and hypothesis testing — the backbone of every model's uncertainty.
Q1.Basic Probability—Medium—Numerical
A fair coin is tossed 3 times. What is the probability of getting exactly 2 heads? (as a fraction)
Reveal solution
Answer3/8
SolutionNumber of ways to get exactly 2 heads out of 3 tosses = (23)=3. Total outcomes = 23=8. Probability = 3/8.
Q2.Continuous Random Variables—Medium—MCQ
For a continuous random variable X, the probability that X equals any exact single value is: - A) 1
- B) 0
- C) 0.5
- D) Undefined
Reveal solution
AnswerB
SolutionFor 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)=0 for any specific x.
Q3.Binomial Distribution—Medium—Numerical
If X∼Binomial(n=10,p=0.3), what is E[X]? Reveal solution
Answer3
SolutionFor a Binomial distribution, E[X]=np=10×0.3=3.
Q4.Binomial Distribution—Medium—Numerical
For the same X∼Binomial(n=10,p=0.3), what is Var(X)? Reveal solution
Answer2.1
SolutionFor a Binomial distribution, Var(X)=np(1−p)=10×0.3×0.7=2.1.
Q5.Bayes' Theorem—Hard—MCQ
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
AnswerB
SolutionBy Bayes' theorem: P(D∣+)=P(+∣D)P(D)+P(+∣¬D)P(¬D)P(+∣D)P(D)=0.99×0.01+0.05×0.990.99×0.01=0.05940.0099≈0.167, or about 17%. Low base-rate diseases stay unlikely even after a positive test.
Q6.Basic Probability—Medium—Numerical
Two fair dice are rolled. What is the probability that the sum equals 7? (as a fraction)
Reveal solution
Answer1/6
SolutionSix 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/6.
Q7.Poisson Distribution—Medium—MCQ
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
AnswerB
SolutionThe Poisson distribution is the standard model for counting rare, independent events over a fixed interval of time or space at a known average rate λ.
Q8.Correlation—Hard—Numerical
If corr(X,Y)=−0.8, what is corr(−2X+5,Y)? Reveal solution
Answer0.8
SolutionCorrelation 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). Here a=−2, so the sign flips: −(−0.8)=0.8.
Q9.Maximum Likelihood Estimation—Medium—MCQ
For iid samples from a Normal distribution, the Maximum Likelihood Estimate (MLE) of the mean μ equals the: - A) Median of the sample
- B) Sample mean
- C) Mode of the sample
- D) Sample variance
Reveal solution
AnswerB
SolutionMaximizing the Normal log-likelihood with respect to μ gives μ^MLE=xˉ, the sample mean — the same as the method-of-moments estimator here.
Q10.Hypothesis Testing—Medium—MCQ
A hypothesis test yields a p-value of 0.03. At significance level α=0.05, what is the decision? - A) Reject H0
- B) Fail to reject H0
- C) Accept H1 is impossible
- D) The test is inconclusive
Reveal solution
AnswerA
SolutionSince p=0.03<α=0.05, the result is statistically significant at this level, so we reject the null hypothesis H0.
03GATE DA · Subject
Linear Algebra
Eigenvalues, rank, SVD and the geometry underneath every ML algorithm you will ever write.
Q1.Eigenvalues—Easy—Numerical
What are the eigenvalues of A=[2003]? (list both, comma-separated) Reveal solution
Answer2, 3
SolutionFor a diagonal matrix, the eigenvalues are simply the diagonal entries themselves, since Av=λv holds trivially for each standard basis vector.
Q2.Matrix Rank—Medium—Numerical
What is the rank of A=[1224]? Reveal solution
Answer1
SolutionRow 2 is exactly 2× Row 1 — the rows are linearly dependent. Only one independent row remains, so rank(A)=1.
Q3.Orthogonal Matrices—Medium—MCQ
If A is an orthogonal matrix, then ATA equals: - A) A
- B) A−1
- C) I (the identity)
- D) The zero matrix
Reveal solution
AnswerC
SolutionOrthogonal matrices are defined by the property ATA=AAT=I — their columns (and rows) form an orthonormal basis.
Q4.Determinants—Easy—Numerical
Compute the determinant of A=[4123]. Reveal solution
Answer10
SolutionFor a 2×2 matrix, det(A)=ad−bc=(4)(3)−(2)(1)=12−2=10.
Q5.Singular Value Decomposition—Hard—MCQ
In the Singular Value Decomposition A=UΣVT, the columns of U are: - A) Eigenvectors of ATA
- B) Eigenvectors of AAT
- C) The eigenvalues of A
- D) A random orthonormal basis
Reveal solution
AnswerB
SolutionU's columns are the eigenvectors of AAT (the "left singular vectors"), while V's columns are the eigenvectors of ATA (the "right singular vectors").
Q6.Eigenvalues · Trace—Medium—Numerical
For A=[5142], one eigenvalue is 6. What is the other? Reveal solution
Answer1
SolutionThe trace equals the sum of the eigenvalues: tr(A)=5+2=7. If one eigenvalue is 6, the other is 7−6=1. (Check: det(A)=5⋅2−4⋅1=6=6×1 ✓.)
Q7.Vector Spaces—Easy—MCQ
Two vectors u and v are orthogonal if and only if: - A) u⋅v=1
- B) u⋅v=0
- C) ∣u∣=∣v∣
- D) u=v
Reveal solution
AnswerB
SolutionOrthogonality (a 90° angle between vectors) is exactly the condition that their dot product vanishes: u⋅v=∣u∣∣v∣cosθ=0 when θ=90°.
Q8.Rank-Nullity Theorem—Medium—Numerical
A 4×6 matrix has rank 3. What is the dimension of its null space? Reveal solution
Answer3
SolutionBy the Rank-Nullity Theorem, for an m×n matrix, rank+nullity=n (number of columns). Here n=6, rank=3, so nullity =6−3=3.
Q9.Diagonalization—Medium—MCQ
A square matrix A of size n×n is diagonalizable if: - A) It is symmetric
- B) It has n linearly independent eigenvectors
- C) It is invertible
- D) Its determinant is nonzero
Reveal solution
AnswerB
SolutionDiagonalizability requires a full set of n linearly independent eigenvectors so they can form the columns of an invertible matrix P with A=PDP−1. (Symmetric real matrices always satisfy this, but that is a sufficient, not necessary, condition in general.)
Q10.Matrix Basics—Easy—Numerical
What is the trace of a 3×3 identity matrix? Reveal solution
Answer3
SolutionThe trace is the sum of the diagonal entries. For I3, all three diagonal entries are 1, so the trace is 3.
04GATE DA · Subject
Calculus & Optimization
Gradient descent is calculus with a job — derivatives, convexity, and the machinery that trains a model.
Q1.Derivatives—Easy—Numerical
Find dxdf for f(x)=3x2+5x−7 at x=2. Reveal solution
Answer17
Solutionf′(x)=6x+5. At x=2: f′(2)=12+5=17.
Q2.Convexity—Medium—MCQ
A twice-differentiable function f is convex on an interval if: - A) f′′(x)<0 everywhere on it
- B) f′′(x)≥0 everywhere on it
- C) f′′(x)=0 everywhere on it
- D) f′(x) is undefined on it
Reveal solution
AnswerB
SolutionA 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 Descent—Medium—Numerical
In gradient descent with learning rate η=0.1, the gradient at the current point is 4. What is the parameter update Δx? Reveal solution
Answer-0.4
SolutionThe gradient descent update rule is Δx=−η⋅∇f=−0.1×4=−0.4 — a step in the direction opposite the gradient.
Q4.Hessian Matrix—Medium—MCQ
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
AnswerB
SolutionThe Hessian is the square matrix of all second-order partial derivatives, Hij=∂xi∂xj∂2f, and its definiteness tells you whether a critical point is a min, max, or saddle.
Q5.Unconstrained Optimization—Medium—Numerical
Minimize f(x)=x2−4x+7. At what value of x does the minimum occur? Reveal solution
Answer2
SolutionSet f′(x)=2x−4=0⇒x=2. Since f′′(x)=2>0, this critical point is indeed a minimum.
Q6.Lagrange Multipliers—Medium—MCQ
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
AnswerB
SolutionThe method of Lagrange multipliers finds the extrema of f(x) subject to one or more equality constraints g(x)=0 by solving ∇f=λ∇g.
Q7.Chain Rule—Medium—Numerical
Using the chain rule, find dxd[sin(x2)] evaluated at x=0. Reveal solution
Answer0
SolutionBy the chain rule, dxdsin(x2)=cos(x2)⋅2x. At x=0: cos(0)×0=1×0=0.
Q8.Stochastic Gradient Descent—Medium—MCQ
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
AnswerB
SolutionSGD 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 Derivatives—Medium—Numerical
Find ∂y∂f for f(x,y)=x2y+3y2 at the point (x,y)=(1,2). Reveal solution
Answer13
Solution∂y∂f=x2+6y. At (1,2): 1+12=13.
Q10.Saddle Points—Hard—MCQ
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
AnswerB
SolutionAt a saddle point ∇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.
05GATE 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 Tradeoff—Medium—MCQ
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
AnswerB
SolutionMore 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.Regularization—Medium—MCQ
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
AnswerB
SolutionL1's penalty ∣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-Validation—Easy—Numerical
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
Answer200
SolutionWith k=5 folds on 1,000 samples, each fold gets 1000/5=200 samples for validation while the rest train the model.
Q4.SVM · Kernels—Hard—MCQ
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
AnswerB
SolutionA kernel function K(x,y)=ϕ(x)⋅ϕ(y) computes the inner product as if the data had been mapped to a (possibly infinite-dimensional) space ϕ, without ever computing ϕ(x) directly — making nonlinear boundaries tractable.
Q5.k-Nearest Neighbours—Medium—Numerical
A k-NN classifier with k=1 is evaluated on its own training set (no duplicate points with conflicting labels). What is its training accuracy (as a %)? Reveal solution
Answer100
SolutionWith k=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 Methods—Medium—MCQ
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
AnswerC
SolutionBoosting (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 Impurity—Medium—Numerical
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
Answer0.35
SolutionWith equal-size children, the weighted average is simply the mean: (0.3+0.4)/2=0.35 — a decrease from the parent's 0.5, indicating a useful split.
Q8.Principal Component Analysis—Medium—MCQ
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
AnswerA
SolutionPCA 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 Metrics—Medium—Numerical
A binary classifier has confusion matrix TP=40, FP=10, FN=5, TN=45. What is its precision (as a decimal)?
Reveal solution
Answer0.8
SolutionPrecision =TP+FPTP=40+1040=5040=0.8.
Q10.Model Selection—Medium—MCQ
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
AnswerB
SolutionCross-validation estimates out-of-sample performance across complexity/regularization settings, letting you pick the sweet spot where bias and variance together minimize validation error.
06GATE DA · Subject
Deep Learning
Backprop, gates, kernels, attention — the vocabulary of modern AI, tested precisely.
Q1.Backpropagation—Medium—MCQ
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
AnswerB
SolutionBackpropagation is a systematic application of the multivariable chain rule, computing ∂L/∂w layer by layer from the output back to the input, reusing intermediate gradients.
Q2.Vanishing Gradients—Medium—MCQ
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
AnswerB
SolutionSigmoid 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 Functions—Easy—Numerical
For ReLU f(x)=max(0,x), compute f(−3)+f(5). Reveal solution
Answer5
Solutionf(−3)=max(0,−3)=0 and f(5)=max(0,5)=5. Sum =0+5=5.
Q4.Dropout—Medium—MCQ
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
AnswerB
SolutionDropout 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 · Pooling—Medium—MCQ
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
AnswerB
SolutionPooling downsamples feature maps (reducing computation and overfitting) while making the representation more robust to small shifts in where a feature appears.
Q6.CNN · Convolutions—Medium—Numerical
A 2D convolution uses a 3×3 kernel with stride 1 and no padding on a 7×7 input. What is the output size (per dimension)? Reveal solution
Answer5
SolutionOutput size =SW−K+1=17−3+1=5, so the output is 5×5.
Q7.LSTM—Hard—MCQ
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
AnswerB
SolutionLSTM'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 · Attention—Hard—MCQ
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
AnswerB
SolutionSelf-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 Basics—Easy—Numerical
A fully connected layer has 100 input neurons and 50 output neurons (no bias terms). How many weight parameters does it have?
Reveal solution
Answer5000
SolutionA dense layer connects every input neuron to every output neuron: 100×50=5,000 weights.
Q10.Batch Normalization—Medium—MCQ
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
AnswerB
SolutionBatch 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.
07GATE 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* Search—Medium—MCQ
The A* search algorithm selects the next node to expand using the evaluation function:
- A) f(n)=g(n)
- B) f(n)=h(n)
- C) f(n)=g(n)+h(n)
- D) f(n)=g(n)−h(n)
Reveal solution
AnswerC
SolutionA* combines g(n), the actual cost from the start to n, with 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).
Q2.A* Search · Admissibility—Hard—MCQ
For A* to guarantee an optimal solution (with tree search), the heuristic 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
AnswerB
SolutionAn 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 Complexity—Medium—Numerical
Using the standard worst-case bound O(bd) for BFS, compute bd for branching factor b=3 and solution depth d=4. Reveal solution
Answer81
Solution34=3×3×3×3=81.
Q4.Alpha-Beta Pruning—Hard—MCQ
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
AnswerA
SolutionAlpha-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 Logic—Medium—MCQ
In propositional logic, (P→Q) is logically equivalent to: - A) P∧Q
- B) ¬P∨Q
- C) P∨¬Q
- D) ¬P∧¬Q
Reveal solution
AnswerB
SolutionThe implication P→Q is true whenever P is false or Q is true, which is exactly the truth condition of ¬P∨Q — a standard logical equivalence.
Q6.DFS Complexity—Medium—Numerical
DFS has worst-case space complexity O(bm), where b is the branching factor and m is the maximum depth. For b=2 and m=5, what is bm? Reveal solution
Answer10
SolutionSimply bm=2×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 Logic—Medium—MCQ
The first-order logic statement ∀x(Bird(x)→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
AnswerB
SolutionThe ∀ symbol is the universal quantifier — the statement asserts the implication holds for every x, not just some particular one.
Q8.Uninformed Search—Medium—MCQ
Setting the heuristic h(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
AnswerB
SolutionWith h(n)=0, A*'s evaluation function becomes f(n)=g(n) alone — expanding nodes purely by accumulated path cost, which is exactly uniform-cost search.
Q9.Constraint Satisfaction Problems—Medium—Numerical
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
Answer81
SolutionEach of the 4 variables independently picks one of 3 values, so the total number of assignments is 34=81.
Q10.Rule-Based Systems—Medium—MCQ
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
AnswerB
SolutionForward 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).
08GATE DA · Subject
DBMS & Warehousing
Normalization, transactions, and the warehouse architecture behind every dashboard.
Q1.Normalization · 2NF—Medium—MCQ
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
AnswerB
Solution2NF 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 Properties—Easy—MCQ
In the ACID properties of database transactions, "A" stands for:
- A) Availability
- B) Atomicity
- C) Accuracy
- D) Aggregation
Reveal solution
AnswerB
SolutionAtomicity guarantees a transaction executes as a single indivisible unit — either all of its operations commit, or none do.
Q3.Functional Dependencies—Medium—Numerical
Relation R(A,B,C,D) has functional dependencies A→B, B→C, C→D. How many attributes are in the closure A+? Reveal solution
Answer4
SolutionStarting from {A}: A→B adds B; B→C adds C; C→D adds D. So A+={A,B,C,D} — all 4 attributes, meaning A alone is a candidate key.
Q4.Star Schema—Easy—MCQ
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
AnswerB
SolutionThe 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 OLTP—Medium—MCQ
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
AnswerB
SolutionOLAP 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+ Trees—Medium—Numerical
A B+ tree has order p=4, meaning each leaf node can hold at most p−1 keys. What is the maximum number of keys a leaf node can hold? Reveal solution
Answer3
SolutionBy the standard B+ tree convention, a leaf node of order p holds at most p−1 keys: 4−1=3.
Q7.Normalization · BCNF—Hard—MCQ
A relation is in Boyce-Codd Normal Form (BCNF) if, for every non-trivial functional dependency X→Y: - A) Y must be a prime attribute
- B) X must be a superkey
- C) X must be a candidate key strictly smaller than a superkey
- D) Y must itself be a candidate key
Reveal solution
AnswerB
SolutionBCNF is a stricter version of 3NF: for every non-trivial FD X→Y, the determinant X must be a superkey of the relation — no exceptions for prime attributes.
Q8.SQL Aggregation—Easy—MCQ
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
AnswerB
SolutionThe WHERE clause filters rows (selection), and COUNT(*) then aggregates the filtered rows into a single count — a filter followed by an aggregate.
Q9.Candidate Keys—Medium—Numerical
A relation has attributes A, B, C, D, E with candidate keys {A,B} and {C}. How many prime attributes does the relation have? Reveal solution
Answer3
SolutionA prime attribute is any attribute that belongs to at least one candidate key. Here that set is {A,B,C} (D and E belong to no candidate key), giving 3 prime attributes.
Q10.ETL—Easy—MCQ
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
AnswerA
SolutionETL — 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.
09GATE DA · Subject
Data Science & Big Data
The unglamorous 80% of the job — cleaning, scaling, splitting, and moving data at scale.
Q1.Pandas—Easy—MCQ
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
AnswerB
Solutiondf.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 Statistics—Easy—Numerical
A dataset has the values [10, 12, 23, 23, 16, 23, 21, 16]. What is the mode?
Reveal solution
Answer23
Solution23 appears 3 times, more than any other value (16 appears twice, all others once), making it the mode.
Q3.Feature Scaling—Easy—MCQ
Min-max normalization rescales a feature's values to lie within:
- A) [−1,1] always
- B) [0,1] (by the standard definition)
- C) An unbounded range
- D) The range [mean,std]
Reveal solution
AnswerB
SolutionMin-max scaling maps x→xmax−xminx−xmin, which by construction lands every value in [0,1].
Q4.MapReduce—Medium—MCQ
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
AnswerB
SolutionAfter 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 Split—Easy—Numerical
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
Answer2000
Solution20% of 10,000 is 0.20×10000=2,000 records.
Q6.Standardization—Easy—MCQ
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]
- D) Only positive values
Reveal solution
AnswerA
SolutionThe z-score transform z=σx−μ centers the data at mean 0 with unit standard deviation, by construction.
Q7.Z-Score—Easy—Numerical
Compute the z-score of x=85, given mean μ=70 and standard deviation σ=10. Reveal solution
Answer1.5
Solutionz=σx−μ=1085−70=1015=1.5.
Q8.NumPy Broadcasting—Medium—MCQ
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
AnswerA
SolutionBroadcasting 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 Methods—Medium—MCQ
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
AnswerB
SolutionStratified 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 Scale—Easy—Numerical
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
Answer30
Solution1 TB/day×30 days=30 TB.
10GATE DA · Subject
General Aptitude
GATE never lets you forget the basics — quantitative and verbal reasoning to close out the paper.
Q1.Ratio & Proportion—Easy—Numerical
The ratio of two numbers is 3 : 5 and their sum is 96. What is the larger number?
Reveal solution
Answer60
SolutionLet the numbers be 3x and 5x: 3x+5x=96⇒8x=96⇒x=12. The larger number is 5x=60.
Q2.Verbal · Antonyms—Easy—MCQ
Choose the word most nearly OPPOSITE in meaning to "TRANSIENT":
- A) Fleeting
- B) Permanent
- C) Brief
- D) Temporary
Reveal solution
AnswerB
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-Distance—Easy—Numerical
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
Answer8
SolutionSpeed =300/5=60 km/h. Time for 480 km =480/60=8 hours.
Q4.Verbal · Analogy—Easy—MCQ
Complete the analogy: Doctor : Hospital :: Judge : ?
- A) Court
- B) Law
- C) Jail
- D) Police
Reveal solution
AnswerA
SolutionA doctor practices in a hospital; analogously, a judge presides in a court — the relationship is "professional : primary workplace".
Q5.Number Series—Medium—Numerical
Find the next number in the series: 5, 11, 23, 47, ?
Reveal solution
Answer95
SolutionEach term follows tn+1=2tn+1: 5→11, 11→23, 23→47, and 47×2+1=95.
Q6.Logical Reasoning—Hard—MCQ
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
AnswerD
SolutionThe 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 Interest—Easy—Numerical
A sum of ₹12,000 becomes ₹13,200 in 2 years at simple interest. What is the rate of interest (% per annum)?
Reveal solution
Answer5
SolutionSI =13200−12000=1200. Using SI=100P⋅R⋅T: 1200=10012000×R×2⇒R=24000120000=5%.
Q8.Verbal · Idioms—Easy—MCQ
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
AnswerB
Solution"To bite the bullet" means to accept and endure something unpleasant or difficult because it is unavoidable.
Q9.Sets · Venn Diagrams—Medium—Numerical
In a class of 50 students, 30 play cricket, 25 play football, and 10 play both. How many play neither sport?
Reveal solution
Answer5
SolutionBy inclusion-exclusion, students playing at least one sport =30+25−10=45. Those playing neither =50−45=5.
Q10.Verbal · Grammar—Easy—MCQ
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
AnswerB
Solution"It's" (contraction of "it is") and "isn't" (contraction of "is not") both require apostrophes exactly where option B places them.