Numerical Computation & Estimation, Programming Fundamentals, Vector Spaces… Test for GATE DA: 32 Questions with Solutions & Analysis
Attempt the Numerical Computation & Estimation, Programming Fundamentals, Vector Spaces… test for GATE DA: 32 exam-level questions, detailed solutions and per
32 Qs
Total Questions
48 Marks
Total Marks
1.44 Mins
Duration
Section-wise Paper Structure
Probability and Statistics
5 Qs
16% of total marks
Machine Learning
5 Qs
16% of total marks
Database Management and Warehousing
5 Qs
16% of total marks
Programming, Data Structures and Algorithms
4 Qs
13% of total marks
Quantitative Aptitude
3 Qs
9% of total marks
Linear Algebra
3 Qs
9% of total marks
Spatial Aptitude
2 Qs
6% of total marks
Calculus and Optimization
2 Qs
6% of total marks
Artificial Intelligence
2 Qs
6% of total marks
Verbal Aptitude
1 Qs
3% of total marks
Free Solved Questions with Step-by-Step Solutions
Authentic examination problems with detailed derivations and answer keys.
Question 1
2025 PYQ
Level 3: Exam Standard
There are three boxes containing white balls and black balls.
Box-1 contains 2 black and 1 white balls.
Box-2 contains 1 black and 2 white balls.
Box-3 contains 3 black and 3 white balls.
In a random experiment, one of these boxes is selected, where the probability of choosing Box-1 is 21, Box-2 is 61, and Box-3 is 31. A ball is drawn at random from the selected box. Given that the ball drawn is white, the probability that it is drawn from Box-2 is
(Round off to two decimal places)
Question 2
2025 PYQ
Level 3: Exam Standard
The naive Bayes classifier is used to solve a two-class classification problem with class-labels y1,y2. Suppose the prior probabilities are P(y1)=31 and P(y2)=32. Assuming a discrete feature space with
P(x∣y1)=43
and
P(x∣y2)=41
for a specific feature vector x. The probability of misclassifying x is
(Round off to two decimal places)
Question 3
2026 PYQ
Level 3: Exam Standard
Let
L=n→∞limk=0∑nk!e−nnk
Which of the following is the value of L?
Question 4
2025 PYQ
Level 3: Exam Standard
Consider designing a linear classifier
y=sign(f(x;w,b)),f(x;w,b)=wTx+b
on a dataset D={(x1,y1),(x2,y2),...,(xN,yN)}, xi∈Rd, yi∈{+1,−1}, i=1,2,...,N. Recall that the sign function outputs +1 if the argument is positive, and −1 if the argument is non-positive. The parameters w and b are updated as per the following training algorithm:
wnew=wold+ynxn,bnew=bold+yn
whenever sign(f(xn;wold,bold))=yn. In other words, whenever the classifier wrongly predicts a sample (xn,yn) from the dataset, wold gets updated to wnew, and likewise bold gets updated to bnew. Consider the case (xn,+1), f(xn;wold,bold)<0. Then
Question 5
2024 PYQ
Level 3: Exam Standard
For any binary classification dataset, let SB∈Rd×d and SW∈Rd×d be the between-class and within-class scatter (covariance) matrices, respectively. The Fisher linear discriminant is defined by u∗∈Rd, that maximizes J(u)=uTSWuuTSBu If λ=J(u∗), SW is non-singular and SB=0, then (u∗,λ) must satisfy which ONE of the following equations? Note: R denotes the set of real numbers.
Question 6
2025 PYQ
Level 3: Exam Standard
Given data {(−1,1),(2,−5),(3,5)} of the form (x,y), we fit a model y=wx using linear least-squares regression. The optimal value of w is
(Round off to three decimal places)
Question 7
2024 PYQ
Level 3: Exam Standard
Consider the following two tables named Raider and Team in a relational database maintained by a Kabaddi league. The attribute ID in table Team references the primary key of the Raider table, ID.
Raider
ID
Name
Raids
RaidPoints
1
Arjun
200
250
2
Ankush
190
219
3
Sunil
150
200
4
Reza
150
190
5
Pratham
175
220
6
Gopal
193
215
The SQL query described below is executed on this database:
SELECT * FROM Raider, Team WHERE Raider.ID=Team.ID AND City=“Jaipur” AND RaidPoints > 200;
The number of rows returned by this query is ______.
Team
City
ID
BidPoints
Jaipur
2
200
Patna
3
195
Hyderabad
5
175
Jaipur
1
250
Patna
4
200
Jaipur
6
200
Question 8
2025 PYQ
Level 3: Exam Standard
On a relation named Loan of a bank:
Loan
loan number
branch name
amount
L11
Banjara Hills
90000
L14
Kondapur
50000
L15
SR Nagar
40000
L22
SR Nagar
25000
L23
Balanagar
80000
L25
Kondapur
70000
L19
SR Nagar
65000
the following SQL query is executed.
SELECT L1.loan number
FROM Loan L1
WHERE L1.amount > (SELECT MAX (L2.amount)
FROM Loan L2
WHERE L2.branch name = ’SR Nagar’);
The number of rows returned by the query is (Answer in integer)
Question 9
2026 PYQ
Level 3: Exam Standard
Consider a table Employee(EmpID, TeamID), where the column EmpID (ID of an employee) is the primary key. The column TeamID denotes the team ID of the team of which the employee is a member. TeamID is a NOT NULL column.
We want to display the size of the team (denoted as TeamSize) in which each employee is a member by using SQL. As an example, the desired output for the given Employee table is also shown in tabular form.
Which of the following is the correct output of this program?
Question 11
2024 PYQ
Level 3: Exam Standard
Consider the following Python function: def fun(D, s1, s2): if s1 < s2: D[s1], D[s2] = D[s2], D[s1] fun(D, s1+1, s2-1) What does this Python function fun() do? Select the ONE appropriate option below.
Question 12
2026 PYQ
Level 3: Exam Standard
Consider the given Python program.
def outer():
x = []
def inner(val):
x.append(val)
return x
return inner
f1 = outer()
f2 = outer()
print(f1(10)) # Line P
print(f1(20)) # Line Q
print(f2(30)) # Line R
print(f1(40)) # Line S
Which of the following options is/are correct?
Question 13
2026 PYQ
Level 3: Exam Standard
Consider two distinct positive real numbers m,n, with m>n.
Let x=nlog10(m) and y=mlog10(n). The relation between x and y is _______.
Question 14
2024 PYQ
Level 3: Exam Standard
The sum of the following infinite series is 2+21+31+41+81+91+161+271+⋯
Question 15
2025 PYQ
Level 3: Exam Standard
If a real variable x satisfies 3x2=27×9x, then the value of (2x)22x2 is:
Question 16
2026 PYQ
Level 3: Exam Standard
Consider a set S1={x=(x1,x2,x3)T∈R3∣xTx≤16}. Let S2 be another set which is a subspace of R3 with dimension two.
Which of the following gives the area of S1∩S2?
Question 17
2025 PYQ
Level 3: Exam Standard
Which of the following statements is/are correct?
Question 18
2024 PYQ
Level 3: Exam Standard
Select all choices that are subspaces of R3. Note: R denotes the set of real numbers.
Question 19
2026 PYQ
Level 3: Exam Standard
The four pieces of a puzzle are shown in the figure below.
Which one of the figures labelled as P, Q, R, and S can be constructed by using each of the four pieces only once without overlaps?
Question 20
2025 PYQ
Level 3: Exam Standard
A regular dodecagon (12-sided regular polygon) is inscribed in a circle of radius r cm as shown in the figure. The side of the dodecagon is d cm. All the triangles (numbered 1 to 12) in the figure are used to form squares of side r cm and each numbered triangle is used only once to form a square.
The number of squares that can be formed and the number of triangles required to form each square, respectively, are:
Note: The figure shown is representative.
Question 21
2025 PYQ
Level 3: Exam Standard
t→+∞limt2+t−t=
(Round off to one decimal place)
Question 22
2024 PYQ
Level 3: Exam Standard
Evaluate the following limit: x→0limx2ln((x2+1)cosx)=______.
Question 23
2024 PYQ
Level 3: Exam Standard
Let h1 and h2 be two admissible heuristics used in A∗ search. Which ONE of the following expressions is always an admissible heuristic?
Question 24
2025 PYQ
Level 3: Exam Standard
The state graph shows the action cost along the edges and the heuristic function h associated with each state.
Suppose A∗ algorithm is applied on this state graph using priority queue to store the frontier. In what sequence are the nodes expanded?
Question 25
2025 PYQ
Level 3: Exam Standard
We __________ tennis in the lawn when it suddenly started to rain.
Select the most appropriate option to complete the above sentence.
Unlock All 32 Questions in Real Examination Mode
Practice with the authentic timer, on-screen calculator, instant percentile ranking, and section-wise analytics.
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Built around you, not around a syllabus PDF
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
Revision that hits your weak spots
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Questions calibrated to the real exam
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Notes written for recall, not for volume
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
One place for everything
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
Honest progress
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Unlock the whole course
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
Numerical Computation & Estimation, Programming Fundamentals, Vector Spaces… Test for GATE DA: 32 Questions with Solutions & Analysis
Attempt the Numerical Computation & Estimation, Programming Fundamentals, Vector Spaces… test for GATE DA: 32 exam-level questions, detailed solutions and performance analysis. First questions free.
Paper breakdown
32 questions · 48 marks · 1.44 minutes. Probability and Statistics: 5 · Machine Learning: 5 · Database Management and Warehousing: 5 · Programming, Data Structures and Algorithms: 4 · Quantitative Aptitude: 3 · Linear Algebra: 3 · Spatial Aptitude: 2 · Calculus and Optimization: 2 · Artificial Intelligence: 2 · Verbal Aptitude: 1
There are three boxes containing white balls and black balls.
Box-1 contains 2 black and 1 white balls.
Box-2 contains 1 black and 2 white balls.
Box-3 contains 3 black and 3 white balls.
In a random experiment, one of these boxes is selected, where the probability of choosing Box-1 is 21, Box-2 is 61, and Box-3 is 31. A ball is drawn at random from the selected box. Given that the ball drawn is white, the probability that it is drawn from Box-2 is
(Round off to two decimal places)
Correct Answer:
0.25
Step-by-Step Solution
Insight: Three-box Bayes. The partition is {B1,B2,B3}, the evidence is "white ball drawn". You want P(B2∣W).
Exam route:
Step 1 — Priors and likelihoods:
P(B1)=21,P(B2)=61,P(B3)=31
P(W∣B1)=31,P(W∣B2)=32,P(W∣B3)=21
Step 2 — Branches:
P(W∣B1)P(B1)=31⋅21=61
P(W∣B2)P(B2)=32⋅61=182=91
P(W∣B3)P(B3)=21⋅31=61
Step 3 — Total:
P(W)=61+91+61=183+2+3=188=94
Step 4 — Posterior:
P(B2∣W)=4/91/9=41=0.25
Learning route: Each box is a hypothesis. The evidence "white ball" is more likely under Box 2 than Box 1 or 3, but Box 2 is chosen less often a priori. Bayes balances these two forces.
Trap check: If you forget that Box 3 has 3 white out of 6 and write P(W∣B3)=3 or 1/3, the denominator breaks. Always reduce the fraction first.
The naive Bayes classifier is used to solve a two-class classification problem with class-labels y1,y2. Suppose the prior probabilities are P(y1)=31 and P(y2)=32. Assuming a discrete feature space with
P(x∣y1)=43
and
P(x∣y2)=41
for a specific feature vector x. The probability of misclassifying x is
(Round off to two decimal places)
Correct Answer:
0.40
Step-by-Step Solution
Insight: This is a MAP-decision misclassification question. Compute both posteriors, pick the larger, and the misclassification probability is the posterior of the other class.
Exam route:
Step 1 — Unnormalised posteriors:
P(x∣y1)P(y1)=43⋅31=41P(x∣y2)P(y2)=41⋅32=61
Step 2 — Normalise:
Sum =41+61=123+2=125P(y1∣x)=5/121/4=53=0.6P(y2∣x)=5/121/6=52=0.4
Step 3 — MAP rule: predict y1 (since 0.6>0.4). Misclassification =P(y2∣x)=0.40.
Learning route: A Bayes classifier assigns x to argmaxiP(yi∣x). The probability of being wrong is exactly the posterior of the class not chosen. Because the denominator is common, you can compare the unnormalised scores directly to find the winner, then normalise only to read off the loser's posterior.
Trap check: If you misclassify as y2 you would report $0.60$ — but MAP picks the larger posterior, so y1 is the prediction and y2 is the error.
Verification: P(y1∣x)+P(y2∣x)=0.6+0.4=1. ✓
Question 3 · Probability and Statistics · 2026MCQ
Let
L=n→∞limk=0∑nk!e−nnk
Which of the following is the value of L?
A.
0.5
B.
1.0
C.
0
D.
e−1
Correct Answer:
A
Step-by-Step Solution
Insight: The sum is the cumulative distribution function (CDF) of a Poisson random variable with parameter n, evaluated at n. As n approaches infinity, the standardized Poisson converges to a standard normal distribution.
Exam route: The sum represents P(Yn≤n) where Yn∼Poisson(n). Standardize the variable: P(nYn−n≤0). By the Central Limit Theorem, this converges to Φ(0)=0.5.
Learning route: Recognize the summand k!e−nnk as the probability mass function of a Poisson distribution with parameter λ=n. The sum from k=0 to n is exactly the probability P(Yn≤n). Since a Poisson(n) variable can be viewed as the sum of n independent Poisson(1) variables, the Central Limit Theorem applies. As n→∞, the standardized variable Zn=nYn−n converges in distribution to N(0,1). Therefore, the limit is P(Z≤0)=Φ(0)=0.5.
Question 4 · Machine Learning · 2025MCQ
Consider designing a linear classifier
y=sign(f(x;w,b)),f(x;w,b)=wTx+b
on a dataset D={(x1,y1),(x2,y2),...,(xN,yN)}, xi∈Rd, yi∈{+1,−1}, i=1,2,...,N. Recall that the sign function outputs +1 if the argument is positive, and −1 if the argument is non-positive. The parameters w and b are updated as per the following training algorithm:
wnew=wold+ynxn,bnew=bold+yn
whenever sign(f(xn;wold,bold))=yn. In other words, whenever the classifier wrongly predicts a sample (xn,yn) from the dataset, wold gets updated to wnew, and likewise bold gets updated to bnew. Consider the case (xn,+1), f(xn;wold,bold)<0. Then
A.
f(xn;wnew,bnew)>f(xn;wold,bold)
B.
f(xn;wnew,bnew)<f(xn;wold,bold)
C.
f(xn;wnew,bnew)=f(xn;wold,bold)
D.
ynf(xn;wold,bold)>1
Correct Answer:
A
Step-by-Step Solution
Insight: The perceptron update adds ynxn to w and yn to b. Evaluating the new score on the same misclassified point adds ∥xn∥2+1 to the old score, strictly increasing it.
Exam route: fnew=(wold+xn)Txn+(bold+1)=fold+∥xn∥2+1. Since ∥xn∥2≥0, fnew>fold.
Learning route:
Step 1: We are given yn=+1 and f(xn;wold,bold)<0. This is a misclassification, so an update occurs.
Step 2: The update rules are wnew=wold+ynxn=wold+xn and bnew=bold+yn=bold+1.
Step 3: Evaluate the new score on the same point xn:
f(xn;wnew,bnew)=wnewTxn+bnew
Step 4: Substitute the updated parameters:
f(xn;wnew,bnew)=(wold+xn)Txn+(bold+1)
=woldTxn+xnTxn+bold+1
=(woldTxn+bold)+∥xn∥2+1
=f(xn;wold,bold)+∥xn∥2+1
Step 5: Since ∥xn∥2≥0, we have ∥xn∥2+1≥1>0. Therefore, f(xn;wnew,bnew)>f(xn;wold,bold). (Option A is correct).
Step 6: Check Option D. We are given f(xn;wold,bold)<0 and yn=+1. Their product is negative, so it cannot be >1. (Option D is false).
Answer: A
Question 5 · Machine Learning · 2024MCQ
For any binary classification dataset, let SB∈Rd×d and SW∈Rd×d be the between-class and within-class scatter (covariance) matrices, respectively. The Fisher linear discriminant is defined by u∗∈Rd, that maximizes J(u)=uTSWuuTSBu If λ=J(u∗), SW is non-singular and SB=0, then (u∗,λ) must satisfy which ONE of the following equations? Note: R denotes the set of real numbers.
A.
SW−1SBu∗=λu∗
B.
SWu∗=λSBu∗
C.
SBSWu∗=λu∗
D.
u∗Tu∗=λ2
Correct Answer:
A
Step-by-Step Solution
Insight: Maximizing the Rayleigh quotient J(u)=uTSWuuTSBu leads directly to the generalized eigenvalue problem SBu=λSWu.
Exam route: Since SW is non-singular, left-multiply by SW−1 to isolate the eigenvalue form: SW−1SBu=λu.
Learning route:
Step 1: The Fisher criterion is J(u)=uTSWuuTSBu. To find the optimal u∗, we set the gradient ∇uJ(u)=0.
Step 2: Applying the quotient rule of matrix calculus, the derivative simplifies to the condition SBu=(uTSWuuTSBu)SWu.
Step 3: The term in parentheses is exactly the scalar value J(u)=λ. Thus, we get the generalized eigenvalue problem: SBu=λSWu.
Step 4: Given that SW is non-singular (invertible), we can multiply both sides on the left by SW−1, yielding SW−1SBu=λu.
Answer: A
Question 6 · Machine Learning · 2025NAT
Given data {(−1,1),(2,−5),(3,5)} of the form (x,y), we fit a model y=wx using linear least-squares regression. The optimal value of w is
(Round off to three decimal places)
Correct Answer:
0.286
Step-by-Step Solution
Insight: For a linear model without a bias term (y=wx), the optimal weight is the ratio of the sum of xiyi to the sum of xi2.
Exam route: Sum of xy=−1+(−10)+15=4. Sum of x2=1+4+9=14. w=4/14=2/7≈0.286.
Learning route:
Identify the model: y=wx. Notice there is no bias term (w0).
Recall the scalar normal equation for no-bias least squares: w∗=∑xi2∑xiyi.
Compute the numerator ∑xiyi: (−1)(1)+(2)(−5)+(3)(5)=−1−10+15=4.
Compute the denominator ∑xi2: (−1)2+(2)2+(3)2=1+4+9=14.
Calculate w∗=144=72.
Convert to decimal and round to three decimal places: 2÷7≈0.2857...→0.286.
Question 7 · Database Management and Warehousing · 2024NAT
Consider the following two tables named Raider and Team in a relational database maintained by a Kabaddi league. The attribute ID in table Team references the primary key of the Raider table, ID.
Raider
ID
Name
Raids
RaidPoints
1
Arjun
200
250
2
Ankush
190
219
3
Sunil
150
200
4
Reza
150
190
5
Pratham
175
220
6
Gopal
193
215
The SQL query described below is executed on this database:
SELECT * FROM Raider, Team WHERE Raider.ID=Team.ID AND City=“Jaipur” AND RaidPoints > 200;
The number of rows returned by this query is ______.
Team
City
ID
BidPoints
Jaipur
2
200
Patna
3
195
Hyderabad
5
175
Jaipur
1
250
Patna
4
200
Jaipur
6
200
Correct Answer:
3.00
Step-by-Step Solution
Insight: The query performs an implicit inner join on ID, then filters by City and RaidPoints. Count the rows that satisfy both conditions.
Exam route: Join the tables on ID, then apply the WHERE conditions row by row.
Step 2: Apply WHERE City="Jaipur" AND RaidPoints > 200.
ID=1: Jaipur, 250 > 200 → TRUE
ID=2: Jaipur, 219 > 200 → TRUE
ID=3: Patna → FALSE
ID=4: Patna → FALSE
ID=5: Hyderabad → FALSE
ID=6: Jaipur, 215 > 200 → TRUE
Step 3: Count TRUE rows: ID=1, 2, 6 → 3 rows.
Verification: Check each Jaipur row: 250, 219, 215 are all > 200. Count is 3.
Question 8 · Database Management and Warehousing · 2025NAT
On a relation named Loan of a bank:
Loan
loan number
branch name
amount
L11
Banjara Hills
90000
L14
Kondapur
50000
L15
SR Nagar
40000
L22
SR Nagar
25000
L23
Balanagar
80000
L25
Kondapur
70000
L19
SR Nagar
65000
the following SQL query is executed.
SELECT L1.loan number
FROM Loan L1
WHERE L1.amount > (SELECT MAX (L2.amount)
FROM Loan L2
WHERE L2.branch name = ’SR Nagar’);
The number of rows returned by the query is (Answer in integer)
Correct Answer:
3.00
Step-by-Step Solution
Insight: The inner subquery is non-correlated (it does not reference L1), so it evaluates exactly once to a single scalar value.
Exam route: Compute MAX(amount) for branch_name = 'SR Nagar' first, then count outer rows with amount strictly greater than that value.
Learning route:
Step 1: Identify the inner query. It selects MAX(L2.amount) FROM Loan L2 WHERE L2.branch_name = 'SR Nagar'. Since L2 does not reference L1, this is a non-correlated subquery and runs once.
Step 2: Filter Loan for branch_name = 'SR Nagar'. The matching rows are:
L15: 40000
L22: 25000
L19: 65000
Step 3: MAX(40000, 25000, 65000) = 65000.
Step 4: The outer query becomes: SELECT loan_number FROM Loan WHERE amount > 65000.
Verification: Plug 65000 back — only 90000, 80000, 70000 are strictly greater. Count is 3.
Question 9 · Database Management and Warehousing · 2026MSQ
Consider a table Employee(EmpID, TeamID), where the column EmpID (ID of an employee) is the primary key. The column TeamID denotes the team ID of the team of which the employee is a member. TeamID is a NOT NULL column.
We want to display the size of the team (denoted as TeamSize) in which each employee is a member by using SQL. As an example, the desired output for the given Employee table is also shown in tabular form.
Which of the following is/are correct?
Employee
EmpID TeamID
1 8
2 8
3 8
4 7
5 7
6 9
Output
EmpID TeamSize
1 3
2 3
3 3
4 2
5 2
6 1
A. SELECT E.EmpID, B.TeamSize
FROM Employee AS E, (SELECT TeamID, COUNT(TeamID) AS TeamSize FROM Employee GROUP BY TeamID) AS B
WHERE E.TeamID = B.TeamID
B. SELECT A.EmpID, COUNT(B.TeamID) AS TeamSize
FROM Employee AS A, Employee AS B
WHERE A.TeamID = B.TeamID AND A.EmpID = B.EmpID
GROUP BY A.EmpID
C. SELECT B.EmpID, B.TeamSize
FROM (SELECT EmpID, COUNT(TeamID) AS TeamSize
FROM Employee GROUP BY EmpID) AS B
D. SELECT A.EmpID, B.TeamSize
FROM Employee AS A, (SELECT COUNT(TeamID) AS TeamSize FROM Employee GROUP BY TeamID) AS B
WHERE A.TeamID = B.TeamID
Correct Answer:
["A"]
Step-by-Step Solution
Insight: To display an aggregate (team size) for each individual row without collapsing the output, we must compute the aggregate in a derived table or use a self-join that preserves individual IDs.
Exam route: Evaluate each option's GROUP BY and JOIN conditions to see which correctly pairs each employee with their team's total count.
Learning route:
Step 1: Analyze Option A. The inner query groups by TeamID and counts the members, producing a derived table B with columns (TeamID, TeamSize). The outer query joins Employee E with B on TeamID. This correctly assigns the team size to each employee. This matches the desired output.
Step 2: Analyze Option B. The self-join condition includes A.EmpID = B.EmpID. Since EmpID is the primary key, this restricts B to be exactly the same row as A. COUNT(B.TeamID) will always be 1 for every employee. This is incorrect.
Step 3: Analyze Option C. The query groups by EmpID. Since EmpID is the primary key, each group contains exactly one row. COUNT(TeamID) will always be 1. This is incorrect.
Step 4: Analyze Option D. The derived table B only selects COUNT(TeamID) AS TeamSize; it does not include TeamID in its SELECT list. The outer query's WHERE clause attempts to join on B.TeamID, which does not exist in the derived table. This will cause a SQL error. This is incorrect.
Verification: Only Option A correctly computes the team sizes (3, 3, 3, 2, 2, 1) and joins them back to the individual employees.
Question 10 · Programming, Data Structures and Algorithms · 2026MCQ
Which of the following is the correct output of this program?
A. [1]
[2]
[3]
B. [1]
[1, 2]
[3]
C. [1]
[2]
[1, 2, 3]
D. [1]
[1, 2]
[1, 3]
Correct Answer:
B
Step-by-Step Solution
Insight: Default arguments are evaluated exactly once at definition time; mutating a mutable default object persists its state across all subsequent calls that use the default.
Exam route: Call 1 uses the default empty list, appends 1, and returns [1]. The default list is now [1]. Call 2 uses that same default list, appends 2, and returns [1, 2]. Call 3 explicitly passes a new empty list, bypassing the default, appends 3, and returns [3].
Learning route: This is a classic mutable default argument question, recognizable by the lst=[] parameter. When Python executes the def statement, it creates a single list object and stores it as the default.
Step 1: In the first call append_to_lst(1), no list is provided, so lst binds to the default []. The append method mutates this default object to [1]. The function returns [1].
Step 2: In the second call append_to_lst(2), no list is provided, so lst binds to the exact same default object, which is now [1]. The append method mutates it to [1, 2]. The function returns [1, 2].
Step 3: In the third call append_to_lst(3, []), a new list is explicitly provided. The parameter lst binds to this new object, completely ignoring the default. The append method mutates the new list to [3]. The function returns [3].
The final output is [1], then [1, 2], then [3].
Answer: Option B.
Question 11 · Programming, Data Structures and Algorithms · 2024MCQ
Consider the following Python function: def fun(D, s1, s2): if s1 < s2: D[s1], D[s2] = D[s2], D[s1] fun(D, s1+1, s2-1) What does this Python function fun() do? Select the ONE appropriate option below.
A.
It finds the smallest element in D from index s1 to s2, both inclusive.
B.
It performs a merge sort in-place on this list D between indices s1 and s2, both inclusive.
C.
It reverses the list D between indices s1 and s2, both inclusive.
D.
It swaps the elements in D at indices s1 and s2, and leaves the remaining elements unchanged.
Correct Answer:
C
Step-by-Step Solution
Insight: The function swaps the elements at s1 and s2, then recursively calls itself with s1+1 and s2-1. This is the standard two-pointer recursive reversal pattern.
Exam route: Recognize the two pointers moving inwards (s1+1, s2-1) and swapping elements. This reverses the subarray from s1 to s2.
Learning route:
Base case: s1 < s2 is false (i.e., s1 >= s2), it stops.
Recursive step: swaps D[s1] and D[s2], then moves pointers inward.
This exactly reverses the segment D[s1...s2] in place.
Question 12 · Programming, Data Structures and Algorithms · 2026MSQ
Consider the given Python program.
def outer():
x = []
def inner(val):
x.append(val)
return x
return inner
f1 = outer()
f2 = outer()
print(f1(10)) # Line P
print(f1(20)) # Line Q
print(f2(30)) # Line R
print(f1(40)) # Line S
Which of the following options is/are correct?
A.
f1 and f2 share the same list x
B.
Output of Line Q is [10, 20]
C.
Output of Line R is [10, 20, 30]
D.
Output of Line S is [10, 20, 40]
Correct Answer:
["B","D"]
Step-by-Step Solution
Insight: Each call to the outer function creates a completely independent closure with its own isolated cell objects for enclosed variables.
Exam route: f1 and f2 are created by separate calls to outer(), so they have separate x lists. f1(10) -> [10], f1(20) -> [10, 20] (Line Q). f2(30) -> [30] (Line R). f1(40) -> [10, 20, 40] (Line S).
Learning route: This is a closure instance isolation question, recognizable by the nested function returning an inner function that modifies an enclosed mutable variable.
Step 1: When f1 = outer() is executed, a new list x is created in outer's local scope. The inner function captures this specific list in its closure cell. f1 now points to this specific inner function instance.
Step 2: When f2 = outer() is executed, a completely new list x is created. A new inner function instance is created, capturing this new list. f2 points to this second instance. f1 and f2 do not share any state.
Step 3: Line P: f1(10) appends 10 to f1's list. Returns [10].
Step 4: Line Q: f1(20) appends 20 to f1's list. Returns [10, 20]. Option B is correct.
Step 5: Line R: f2(30) appends 30 to f2's list. Since f2's list is independent and starts empty, it returns [30]. Option C is incorrect.
Step 6: Line S: f1(40) appends 40 to f1's list. Returns [10, 20, 40]. Option D is correct.
Answer: Options B and D.
Question 13 · Quantitative Aptitude · 2026MCQ
Consider two distinct positive real numbers m,n, with m>n.
Let x=nlog10(m) and y=mlog10(n). The relation between x and y is _______.
A.
x>y
B.
x<y
C.
x=y
D.
x=log10(y)
Correct Answer:
C
Step-by-Step Solution
Insight: Taking the logarithm of both expressions reveals that their log values are identical due to the commutative property of multiplication.
Exam route: Apply log10 to both x and y. Use the power rule to bring the exponents down. Compare the results.
Learning route:
Given x=nlog10m and y=mlog10n.
Take log10 of both sides for x:
log10x=log10(nlog10m)=(log10m)×(log10n).
Take log10 of both sides for y:
log10y=log10(mlog10n)=(log10n)×(log10m).
Since multiplication is commutative, (log10m)×(log10n)=(log10n)×(log10m).
Therefore, log10x=log10y.
Since the logarithm function is one-to-one, this implies x=y.
The relation is x=y, matching option C.
Question 14 · Quantitative Aptitude · 2024MCQ
The sum of the following infinite series is 2+21+31+41+81+91+161+271+⋯
A.
311
B.
27
C.
413
D.
29
Correct Answer:
B
Step-by-Step Solution
Insight: The series is a mix of a constant, a geometric series with ratio 1/2, and another with ratio 1/3.
Exam route: Group the terms by their denominators' patterns. Sum the two infinite geometric series separately using S=a/(1−r) and add to the initial constant.
Learning route:
The given series is 2+21+31+41+81+91+161+271+…
Observe the denominators after the first term: 2, 4, 8, 16... are powers of 2. 3, 9, 27... are powers of 3.
We can split the series into three parts:
S=2+(21+41+81+…)+(31+91+271+…)
The first bracket is a geometric series with a=1/2 and r=1/2. Its sum is 1−1/21/2=1.
The second bracket is a geometric series with a=1/3 and r=1/3. Its sum is 1−1/31/3=2/31/3=1/2.
Total sum S=2+1+1/2=3.5=7/2.
Correct option is B.
Question 15 · Quantitative Aptitude · 2025MCQ
If a real variable x satisfies 3x2=27×9x, then the value of (2x)22x2 is:
A.
2−1
B.
20
C.
23
D.
215
Correct Answer:
C
Step-by-Step Solution
Insight: Unify the bases to 3 to find a relation between x2 and x, then substitute this relation directly into the target expression without solving for x.
Exam route: Convert $27$ and 9x to base 3. Equate exponents to get x2−2x=3. Simplify the target expression to 2x2−2x and substitute 3.
Learning route:
Given 3x2=27×9x.
Express all terms with base 3: 27=33 and 9x=(32)x=32x.
So, 3x2=33×32x=33+2x.
Since the bases are equal, equate the exponents:
x2=3+2x⟹x2−2x=3.
Now look at the target expression: (2x)22x2.
Using exponent laws, (2x)2=22x.
So the expression becomes 22x2x2=2x2−2x.
Substitute x2−2x=3 into the exponent:
23=8.
The value is 23, which matches option C.
Question 16 · Linear Algebra · 2026MCQ
Consider a set S1={x=(x1,x2,x3)T∈R3∣xTx≤16}. Let S2 be another set which is a subspace of R3 with dimension two.
Which of the following gives the area of S1∩S2?
A.
16π
B.
4π
C.
4π2
D.
16π2
Correct Answer:
A
Step-by-Step Solution
Insight: The intersection of a solid n-dimensional ball with a k-dimensional subspace passing through the origin is a solid k-dimensional ball of the exact same radius.
Exam route: xTx≤16 means ∥x∥2≤4, so it's a solid 3D ball of radius R=4. S2 is a 2D subspace (a plane through the origin). The intersection is a 2D solid disk of radius 4. Area = πR2=16π.
Learning route:
Identify S1: The condition xTx≤16 is equivalent to ∥x∥22≤16, which means ∥x∥2≤4. This defines a solid 3-dimensional L2 ball centered at the origin with radius R=4.
Identify S2: A subspace of R3 with dimension 2 is a flat plane that passes exactly through the origin.
Find the intersection S1∩S2: Slicing a solid 3D sphere with a plane that passes through its exact center (the origin) yields a solid 2D disk (a "great disk") with the same radius R=4.
Calculate the area: The area of a 2D disk of radius R is πR2. Substituting R=4, we get Area = π(4)2=16π.
Question 17 · Linear Algebra · 2025MSQ
Which of the following statements is/are correct?
A.
Rn has a unique set of orthonormal basis vectors
B.
Rn does not have a unique set of orthonormal basis vectors
C.
Linearly independent vectors in Rn are orthonormal
D.
Orthonormal vectors Rn are linearly independent
Correct Answer:
["B","D"]
Step-by-Step Solution
Insight: Orthonormal bases are not unique (any rotation works), but orthonormality strictly guarantees linear independence.
Exam route: Evaluate each option. A is false because we can rotate the standard basis. B is true. C is false because independent vectors need not be orthogonal. D is true because orthonormal vectors are always independent.
Learning route:
An orthonormal basis for Rn requires vectors to be mutually orthogonal and unit length. The standard basis is one, but any rotation of it (e.g., in R2, using (cosθ,sinθ) and (−sinθ,cosθ)) is another. Thus, it is not unique (A is false, B is true).
For C, consider vectors (1,0) and (1,1) in R2. They are linearly independent, but their dot product is 1=0, so they are not orthogonal. Thus, independent vectors are not necessarily orthonormal.
For D, let v1,…,vk be orthonormal. Suppose ∑civi=0. Taking the dot product with vj gives cj(vj⋅vj)=0⟹cj=0. Thus, they are linearly independent.
Question 18 · Linear Algebra · 2024MSQ
Select all choices that are subspaces of R3. Note: R denotes the set of real numbers.
Insight: Subspaces must be closed under all scalar multiplications (including negative) and contain the origin. Spans of vectors and solutions to homogeneous linear equations are always subspaces.
Exam route: Check each option against the subspace criteria. A is a span (subspace). B uses squared parameters (only non-negative scalars, fails closure). C is a homogeneous system (subspace). D is a non-homogeneous system (fails zero vector).
Learning route:
Option A: This is the span of two vectors, span{v1,v2}. The span of any set of vectors is always a subspace because it is closed under addition and scalar multiplication by definition.
Option B: The coefficients are α2 and β2. Since squares of real numbers are always non-negative (α2≥0), we can only form non-negative linear combinations. If we multiply a vector in this set by −1, we cannot guarantee it remains in the set. It fails closure under scalar multiplication.
Option C: This is the solution set to a system of homogeneous linear equations (Ax=0). The null space of any matrix is always a subspace. It contains the zero vector and is closed under addition and scalar multiplication.
Option D: The equation is 5x1+2x3=−4. To be a subspace, it must contain the zero vector (0,0,0). Substituting gives 5(0)+2(0)=0=−4. It fails the zero vector test.
Question 19 · Spatial Aptitude · 2026MCQ
The four pieces of a puzzle are shown in the figure below.
Which one of the figures labelled as P, Q, R, and S can be constructed by using each of the four pieces only once without overlaps?
A.
P
B.
Q
C.
R
D.
S
Correct Answer:
A
Step-by-Step Solution
Insight: This is a 2D puzzle assembly problem. The key is to identify the straight outer edges that must form the perimeter of the target rectangle, and then match the complex inner jagged/curved edges to form the specific cutout shape.
Exam route: Identify the pieces with straight outer boundaries (left, right, bottom, top). These must form the frame of the rectangle. The remaining internal boundaries must interlock to form the white hole. Compare the inner boundary profile of the assembled frame with the cutout profiles in P, Q, R, S.
Learning route:
Analyze the puzzle pieces. We have pieces with straight outer edges and complex inner edges (jagged steps and curves).
Identify the 'frame' pieces:
One piece has a straight vertical left edge and straight horizontal bottom edge. It must anchor the bottom-left corner.
Another piece has a straight vertical right edge and straight horizontal bottom edge. It must anchor the bottom-right corner.
A third piece has a straight horizontal top edge. It must sit at the top center.
When these pieces are placed in their respective corners/edges, they form a rectangular frame with a large, irregular hole in the center.
The boundary of this hole is defined by:
Left side: The jagged right edge of the left piece.
Right side: The jagged left edge of the right piece.
Top/Bottom sides: The curved edges of the remaining pieces.
Now examine the target options P, Q, R, S. Each shows a rectangle with a specific white cutout. The correct option must have a cutout whose outer boundary perfectly matches the hole's boundary.
Look at the left edge of the cutouts:
Figure P has a complex boundary that matches the interlocking tabs and slots of the assembled pieces. Specifically, the vertical and diagonal segments in P's cutout align perfectly with the step-pattern on the left-most puzzle piece.
Figures Q and S have smooth or mismatched curved left edges that cannot mate with the sharp zigzag of the left piece.
Figure R has a zigzag profile with different tab depths and angles that would leave gaps or cause overlaps.
Therefore, Figure P is the only shape that can be constructed by assembling the pieces without overlaps, as its negative space perfectly receives the interlocking boundaries of the frame pieces.
Trap Analysis: The 'Rotation Illusion' trap occurs if you try to rotate the target figures P, Q, R, S. In standard assembly questions of this type, the outer frame is fixed (horizontal/vertical), and you only rotate the individual pieces to fit the frame. Do not rotate the final assembled rectangle. Also, avoid the 'Flip Assumption'—pieces can be rotated in the plane but not flipped over (reflected) unless they are symmetric.
Verification: By mentally sliding the left piece to the left, the right piece to the right, and the top piece to the top, the resulting negative space is an exact silhouette of the white cutout in P.
Question 20 · Spatial Aptitude · 2025MCQ
A regular dodecagon (12-sided regular polygon) is inscribed in a circle of radius r cm as shown in the figure. The side of the dodecagon is d cm. All the triangles (numbered 1 to 12) in the figure are used to form squares of side r cm and each numbered triangle is used only once to form a square.
The number of squares that can be formed and the number of triangles required to form each square, respectively, are:
Note: The figure shown is representative.
A.
3; 4
B.
4; 3
C.
3; 3
D.
3; 2
Correct Answer:
A
Step-by-Step Solution
Insight: This is a geometric decomposition question disguised as a pattern puzzle. The fastest and most rigorous route is area conservation.
Exam route: Calculate the area of one central triangle, multiply by 12 to get the total available area, and divide by the area of the target square to find the number of squares. Then divide the total triangles by the number of squares to find the count per square.
Learning route:
Identify the properties of the given triangles. A regular dodecagon inscribed in a circle of radius r is divided into 12 congruent isosceles triangles by lines from the center to each vertex.
Each triangle has two sides equal to the radius r, and the included central angle is 12360∘=30∘.
Calculate the area of one such triangle using the sine formula for the area of a triangle:
Areatriangle=21×r×r×sin(30∘)=21r2(21)=4r2.
Calculate the total area of all 12 triangles available:
Total Area=12×4r2=3r2.
The problem states we must form squares of side r cm. The area of one such square is r2.
By the principle of area conservation (assuming no overlaps or gaps, which is standard for such assembly puzzles), the maximum number of complete squares we can form is:
Number of squares=Area of one squareTotal Area=r23r2=3.
Since all 12 triangles are used exactly once to form these 3 squares, the number of triangles required for each square is:
Triangles per square=312=4.
Therefore, 3 squares can be formed, each requiring 4 triangles.
Trap Analysis: A common mistake is to notice that 3×30∘=90∘ and assume that 3 triangles can be arranged around a central point to form the 90∘ corner of a square. If a student assumes 3 triangles make one square, they would calculate 12/3=4 squares. This leads to Option B (4; 3). However, this ignores area conservation: 3 triangles only have an area of 3×4r2=43r2, which is strictly less than the r2 required for a square of side r. The geometric arrangement of 4 triangles into a square of side r is possible through specific non-symmetric interlocking dissections, but the area argument uniquely and immediately identifies the correct counts without needing to visualize the complex tiling.
Verification: 3 squares×4 triangles/square=12 triangles. Total area = 3×r2=3r2. Matches perfectly.
Question 21 · Calculus and Optimization · 2025NAT
t→+∞limt2+t−t=
(Round off to one decimal place)
Correct Answer:
0.50
Step-by-Step Solution
Insight: This is an ∞−∞ indeterminate form. Rationalise by multiplying and dividing by the conjugate t2+t+t, or equivalently factor out t and use the binomial approximation.
Exam route: Rationalise → simplify → divide numerator and denominator by t → substitute t→∞.
Learning route:
This is an infinity-minus-infinity limit question, recognisable because both t2+t→∞ and t→∞, giving the indeterminate form ∞−∞.
Method 1 — Conjugate rationalisation (recommended for exams):
Step 1 — Multiply and divide by the conjugate:
t2+t−t=t2+t+t(t2+t−t)(t2+t+t)
Step 2 — Simplify the numerator using (a−b)(a+b)=a2−b2:
=t2+t+t(t2+t)−t2=t2+t+tt
Step 3 — Divide numerator and denominator by t (valid since t>0):
=1+t1+11
Step 4 — Take the limit as t→∞ (so 1/t→0):
L=1+0+11=21
Method 2 — Binomial expansion:
Factor t from the square root: t2+t=t1+1/t.
Using (1+u)1/2≈1+u/2 with u=1/t:
t(1+2t1)−t=t+21−t=21
Trap check: A common error is to conclude the limit is $0$ by arguing "both terms go to infinity, so they cancel." This ignores the sub-leading 1/2 term that survives.
Verification: At t=1000: 1000000+1000−1000=1001000−1000≈1000.4999−1000=0.4999≈0.5. Confirmed.
The answer is $0.5$ (rounded to one decimal place: $0.5$).
Question 22 · Calculus and Optimization · 2024NAT
Evaluate the following limit: x→0limx2ln((x2+1)cosx)=______.
Correct Answer:
0.50
Step-by-Step Solution
Insight: The numerator is a log of a product, so split it into ln(1+x2)+ln(cosx), then expand each piece to order x2 using standard Taylor series.
Exam route: Split log → expand ln(1+x2)≈x2 and ln(cosx)≈−x2/2 → add → divide by x2 → get 21.
Learning route:
This is a log-trig limit via Taylor expansion question, recognisable because direct substitution gives 0ln(1⋅1)=00, an indeterminate form, and the numerator contains ln of a product involving a trig function.
Step 1 — Use the log product rule:
ln((x2+1)cosx)=ln(1+x2)+ln(cosx)
Step 2 — Expand ln(1+x2) using ln(1+u)=u−2u2+⋯ with u=x2:
ln(1+x2)=x2−2x4+⋯≈x2(to order x2)
Step 3 — Expand ln(cosx). First, cosx=1−2x2+24x4−⋯. Let u=−2x2+⋯, then:
ln(cosx)=ln(1+u)≈u=−2x2(to order x2)
Step 4 — Combine the numerator:
ln(1+x2)+ln(cosx)≈x2−2x2=2x2
Step 5 — Divide by x2:
L=x→0limx2x2/2=21
Trap check: If you forget to expand ln(cosx) and only keep ln(1+x2)≈x2, you would get L=1, which is wrong. Both log terms contribute at order x2.
Verification: Numerical check at x=0.01: ln((0.0001+1)cos0.01)/0.0001≈ln(1.0001×0.99995)/0.0001≈ln(1.00005)/0.0001≈0.5000. Confirmed.
The answer is $0.50$.
Question 23 · Artificial Intelligence · 2024MCQ
Let h1 and h2 be two admissible heuristics used in A∗ search. Which ONE of the following expressions is always an admissible heuristic?
A.
h1+h2
B.
h1×h2
C.
h1/h2,(h2=0)
D.
∣h1−h2∣
Correct Answer:
D
Step-by-Step Solution
Insight: An admissible heuristic must never overestimate the true cost h∗(n). The absolute difference of two admissible heuristics is bounded by their maximum, which is itself bounded by h∗(n).
Exam route: Check each option against a counterexample. For h1+h2, if h∗=10,h1=8,h2=8, sum is 16 > 10 (fails). For ∣h1−h2∣, since 0≤h1,h2≤h∗, the maximum possible difference is h∗−0=h∗. Thus, 0≤∣h1−h2∣≤h∗, guaranteeing admissibility.
Learning route:
Step 1: Recall definition: h(n) is admissible if 0≤h(n)≤h∗(n) for all n.
Step 2: Test h1+h2: Let h∗=10,h1=8,h2=8. Sum = 16 > 10. Not admissible.
Step 3: Test h1×h2: Let h∗=10,h1=4,h2=4. Product = 16 > 10. Not admissible.
Step 4: Test h1/h2: Let h∗=10,h1=8,h2=0.5. Quotient = 16 > 10. Not admissible.
Step 5: Test ∣h1−h2∣: Since both h1 and h2 are between $0$ and h∗, their difference must lie in the range [−h∗,h∗]. Taking the absolute value ensures the result is in [0,h∗]. Therefore, it never overestimates h∗ and is always admissible.
Answer: ∣h1−h2∣
Question 24 · Artificial Intelligence · 2025MCQ
The state graph shows the action cost along the edges and the heuristic function h associated with each state.
Suppose A∗ algorithm is applied on this state graph using priority queue to store the frontier. In what sequence are the nodes expanded?
A.
S,A,E,C,B,D,G
B.
S,E,A,C,B,D,G
C.
S,A,E,B,C,D,G
D.
S,A,B,E,C,D,G
Correct Answer:
C
Step-by-Step Solution
Insight: A* expansion order is strictly dictated by the f(n)=g(n)+h(n) value, with mandatory updates to g(n) if a cheaper path to an already discovered node is found.
Exam route: Calculate f for all generated nodes. S(f=6) → A(f=6), E(f=7). Pop A → B(f=8). Pop E → update B to f=5, add C(f=9). Pop B(f=5) → C is already f=9 (better). Pop C(f=9) → D(f=8). Pop D(f=8) → G(f=9). Pop G.
Learning route:
Step 1: Init: Open = {S(f=0+6=6)}.
Step 2: Pop S. Gen A(g=4, h=2, f=6), E(g=1, h=6, f=7). Open = {A(f=6), E(f=7)}.
Step 3: Pop A (lowest f). Gen B(g=4+2=6, h=2, f=8). Open = {E(f=7), B(f=8)}.
Step 4: Pop E (lowest f). Gen B(g=1+2=3, h=2, f=5). Since 5 < 8, update B's cost! Gen C(g=1+2=3, h=6, f=9). Open = {B(f=5), C(f=9)}.
Step 5: Pop B (lowest f). Gen C(g=3+2=5, h=6, f=11). Existing C has f=9, which is better, so ignore. Open = {C(f=9)}.
Step 6: Pop C. Gen D(g=3+3=6, h=2, f=8). Open = {D(f=8)}.
Step 7: Pop D. Gen G(g=6+3=9, h=0, f=9). Open = {G(f=9)}.
Step 8: Pop G. Goal reached.
Expansion sequence: S, A, E, B, C, D, G.
Answer: S, A, E, B, C, D, G.
Question 25 · Verbal Aptitude · 2025MCQ
We __________ tennis in the lawn when it suddenly started to rain.
Select the most appropriate option to complete the above sentence.
A.
have been playing
B.
had been playing
C.
would have been playing
D.
could be playing
Correct Answer:
B
Step-by-Step Solution
Insight: The sentence describes a past action that was ongoing up until another past event interrupted it.
Exam route: The interrupting event "started to rain" is in the simple past. The main action must be in a past tense that shows ongoing duration up to that point. Among the options, only "had been playing" (past perfect continuous) fits this past duration requirement.
Learning route:
Step 1: Anchor the time. The phrase "started to rain" places the entire sentence in the past.
Step 2: Identify the aspect. The action of playing tennis was ongoing for a duration before the rain started. This requires a continuous aspect in the past.
Step 3: Evaluate options. "have been playing" is present perfect continuous (wrong time). "would have been playing" is conditional (no conditional context). "could be playing" is present modal (wrong time). "had been playing" is past perfect continuous, correctly showing an action ongoing up to a past reference point.