General Aptitude (GA - Mandatory 15 Marks for All Papers)
Verbal Aptitude: English Grammar, Vocabulary, Reading Comprehension & Narrative Sequencing
Read a short passage twice: first for its main claim, then for evidence, contrasts and references.

Opening your page…
GATE DA · Study materials
Choose a syllabus topic to study its notes, revisit the key ideas or open its lecture page.
General Aptitude (GA - Mandatory 15 Marks for All Papers)
Read a short passage twice: first for its main claim, then for evidence, contrasts and references.
General Aptitude (GA - Mandatory 15 Marks for All Papers)
Start here: Ratios, percentage bases and weighted averages. Suggested session: 35 minutes.
A ratio tells you how two amounts compare. For example, 2:3 means two equal parts for one amount and three for the other.
A percentage means "out of 100", but always ask: 100 of what? In this lesson you will split a total, follow price changes and combine averages.
First name the total and units. Then choose the rule, put in the numbers and check whether the answer makes sense.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
General Aptitude (GA - Mandatory 15 Marks for All Papers)
Start here: Ordering clues: build valid arrangements and tell 'must' from 'can'. Suggested session: 40 minutes.
Suppose a notice says that A speaks before B. A may speak immediately before B, but another speaker could come between them. A common reasoning mistake is to turn a weak clue into a stronger one.
An ordering puzzle gives several clues that must hold together. Turn the clues into a small picture of numbered positions, keep only arrangements that satisfy every clue, then answer exactly what the question asks.
This lesson covers a single straight row or a schedule with one distinct item per slot. Positions increase from left to right, or from earlier to later. It develops a foundation within analytical aptitude: ordering, complete case splits, and the difference between 'must' and 'can'. Circular seating, people facing different directions, tied rankings, general deduction and other reasoning topics need separate treatment.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
General Aptitude (GA - Mandatory 15 Marks for All Papers)
Track labelled vertices or marked faces through one transformation at a time.
Probability and Statistics
Start here: Random variables: probability tables, densities and cumulative chances. Suggested session: 45 minutes.
A random variable turns the outcome of an experiment into a number. If you toss two coins, X could be the number of heads: 0, 1 or 2.
A probability table tells you how much chance belongs to each possible value. A density describes probability spread across intervals. The cumulative distribution function, or CDF, answers one question in both cases: how much probability lies at or below x?
This lesson covers these foundations and finite moments. Named distributions, statistical estimation and hypothesis tests need their own lessons.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Probability and Statistics
Start here: Discrete distributions: Bernoulli, binomial and Poisson foundations (partial DA-2-2). Suggested session: 50 minutes.
Imagine a device check that either passes or fails. Record a pass as 1 and a failure as 0: that single indicator is a Bernoulli variable. If you run exactly six independent checks with the same pass probability and count the passes, you have a binomial variable. A different question asks how many events arrive during a fixed time interval. A Poisson variable can model that count when its event-process assumptions are justified. The word count alone does not tell you which distribution applies.
This original beta foundation covers only Bernoulli, binomial and Poisson model selection, their probability masses and moments, rate conversion, and a few exact probability calculations within DA-2-2. It assumes the earlier random-variables lesson: support, probability mass, expectation and variance. It does not repeat the full PMF/PDF/CDF introduction or the normal-mean inference lesson.
Uniform, exponential, normal, standard normal, t and chi-squared distributions remain further work, as do distribution approximations, parameter estimation, goodness-of-fit and broader counting-process theory. Reading this pack does not complete DA-2-2. Its 50-minute estimate is an adjustable guide for the whole lesson, not a required single sitting or an extra allocation in your daily plan. These examples and questions are original practice, not official GATE questions. Independent human academic review is pending.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Probability and Statistics
Start here: Hypothesis tests and confidence intervals: state the model before the conclusion. Suggested session: 60 minutes.
A measuring instrument sometimes reads above a target and sometimes below it. An average from a small sample may differ from the target even when the instrument's long-run mean is correct. Before calling that difference evidence of a changed mean, we need a model for ordinary sampling variation.
The population mean mu is a fixed, unknown parameter. The sample mean changes across random samples. A hypothesis test asks whether a planned measure of departure is unusually extreme under a specified null model. A confidence interval instead reports a range generated by a procedure with a stated long-run coverage. Both need assumptions; a calculation does not repair biased sampling or dependent observations.
The null hypothesis H0 states the mean values being tested. A two-sided alternative asks whether the mean differs in either direction. A one-sided alternative asks whether it is larger, or smaller, in a direction chosen before seeing the data. In a right-sided test we use H0: mu<=mu0 against H1: mu>mu0; in a left-sided test H0: mu>=mu0 against H1: mu<mu0. For the normal mean tests here, calculate the one-sided p-value at boundary mu0, where the false-rejection probability is greatest within the null.
Our exact numerical procedures use a fixed sample of independent, identically distributed normal observations with common mean and positive variance. When the population standard deviation sigma is known, use a z statistic. When sigma is unknown, estimate it using the sample standard deviation s and use a one-sample Student t statistic with n-1 degrees of freedom. For a small sample, the t result needs the normal-population assumption; 'sigma unknown' or 'n small' alone is not a justification.
Choose the significance level alpha before the test. This lesson uses the explicit rule reject when p<alpha; if p=alpha exactly, do not reject. That strict rule makes rejection exactly equivalent to the null mean lying outside the matching closed confidence interval or bound. Many references use p<=alpha instead. For a continuous null distribution the exact boundary has probability zero, but a stated boundary convention still matters in an exact problem. Follow the convention supplied by a question. Never infer an exact equality merely because a rounded p-value displays 0.05.
A small p-value is a probability about hypothetical statistic values under the null model and the prechosen tail rule. It is not P(H0 is true), not the chance that the current conclusion is wrong, and not an effect-size measurement. Failing to reject does not prove equality: a test may have insufficient power to detect an existing departure.
Use about 10 minutes for the model and terminology, 15 for the test/interval rules, 15 for the two worked examples and 20 for practice. These are original AI-assisted Amalgams beta notes and practice, not official GATE questions. Independent academic review is pending. The pack covers the single-normal-mean portion of DA-2-3, with known-sigma z methods, unknown-sigma one-sample t methods and one right-sided z power calculation. It does not cover every inference method in that heading: proportions, two-sample or paired procedures, variance tests, nonparametric tests, multiple-testing corrections, sequential testing and Bayesian intervals remain separate.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Linear Algebra and Calculus for AI
Start here: Orthogonal projection: coordinates, residuals and the nearest point. Suggested session: 55 minutes.
A point may sit above a line or plane rather than on it. To approximate that point using only positions in the line or plane, choose the nearest allowed point. In ordinary Euclidean geometry, the difference from the original point to that nearest point is perpendicular to the allowed directions. This nearest-point operation is an orthogonal projection. The word orthogonal means perpendicular under the dot product.
For example, projecting (3,4) onto the horizontal axis gives (3,0). The leftover vector (0,4) is perpendicular to the axis. A tilted line uses the same idea: for nonzero direction u, look for a multiple tu whose residual v-tu has zero dot product with u. Solving gives t=(u^T v)/(u^T u). The denominator matters unless u has unit length. A scalar coordinate t and a projected vector t*u are different objects.
For several allowed directions, collect a basis in matrix columns. An orthonormal basis has unit-length columns that are mutually perpendicular. If Q has these columns, coordinates are Q^T v and projection is Q Q^T v. If the columns are independent but not orthonormal, use B(B^T B)^(-1)B^T v instead. Replacing that formula by B B^T v generally changes both length and direction.
We work over real vectors in R^d with the ordinary Euclidean dot product and norm. All vectors in formulas are columns. A transpose is written ^T; I is an identity matrix of the required size. A subspace includes the origin, whereas an affine set is a translated subspace. To project onto mu+span(Q), subtract mu, project onto span(Q), and add mu back. This is exactly the geometric step needed when centered PCA is later used to reconstruct a point in its original coordinates.
The matrix P of an orthogonal projection is symmetric and idempotent: P^T=P and P^2=P. Idempotent means applying the operation twice gives the same result as applying it once. The first application already reaches the subspace. Symmetry distinguishes an orthogonal projection from an oblique one. The vector splits as v=Pv+(I-P)v, and those two parts are perpendicular. Their squared lengths add to the squared length of v. This pack develops the projection part of DA-3-1; a complete survey of subspaces and matrix decompositions remains outside its scope.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Next lesson: Centered PCA: eigenvectors, scores and reconstruction. Suggested session: 65 minutes.
Imagine measuring several quantities on each object. Two measurements may vary together, so the objects can lie near a tilted line rather than filling the whole feature space. Keeping the most useful tilted directions can reduce the number of coordinates needed to describe the objects. Principal component analysis, or PCA, chooses mutually perpendicular directions that retain the greatest possible variance for a fixed number of retained directions. The approximation is an orthogonal projection.
The center matters. A cloud around (10,0) may vary mostly vertically, although its raw vectors point mostly horizontally from the origin. Centered PCA first subtracts the mean feature vector, so it measures variation around the cloud center. An SVD of the raw matrix can instead be dominated by the mean offset. Mean subtraction is centering; dividing each centered feature by its standard deviation is a separate scaling choice. Scaling changes the geometry and can change the PCA directions.
Use X with m observations as rows and d features as columns. Assume m>=2 and real, finite values. Let mu be the d-dimensional feature mean, Z=X-1*mu^T the centered matrix, and S=Z^T Z/(m-1) the sample covariance. Here 1 is the m-entry all-ones column. The eigenvalues lambda1>=lambda2>=...>=lambdad>=0 are variances along orthonormal eigenvectors. The first direction maximizes a^T S a over unit a; successive directions use orthogonality constraints. We use unscaled covariance PCA unless scaling is explicitly requested.
With orthonormal retained directions in Vₖ, the score matrix is T=Z Vₖ. Each row has k signed coordinates, not geometric lengths. For a unit direction vⱼ, a score vⱼ^T z can be negative; the length of that one-dimensional projected vector is |vⱼ^T z|. The centered reconstruction is Z_hat=T Vₖ^T, and the original-coordinate reconstruction is X_hat=1*mu^T+Z_hat. The data residual is perpendicular to the retained directions.
The compact SVD Z=USigmaV^T gives the same directions from the right singular vectors V. If sigma_j is a singular value, lambda_j=sigma_j^2/(m-1). A source using covariance divisor m has lambda_j=sigma_j^2/m instead. The directions and explained-variance fractions are unchanged by this common scalar divisor; absolute variance and the error conversion must use the stated divisor. PCA directions are not unique in sign, and repeated eigenvalues allow rotations within their eigenspace. This pack covers ordinary linear, unwhitened PCA; it does not develop kernel PCA, whitening or a complete survey of SVD algorithms.
Linear Algebra and Calculus for AI
Start here: Single-variable optimization: certify the best value and check each update. Suggested session: 75 minutes.
Imagine tuning one setting on a machine. A cost tells you how poor the current setting is, and a slope tells you which small change should lower that cost. These are different questions: which allowed setting is best, and will a chosen sequence of adjustments reach it?
Let x be a real decision variable, D its allowed set, and f(x) the real cost to minimize. A minimizer x^* is an allowed input with f(x^*)\leq f(x) for every x\in D. The minimum value is f(x^*), not the input x^*. A local minimum compares only nearby allowed inputs. A numerical method instead starts at x_0 and constructs x_1,x_2,\ldots; it needs its own step-size, domain and stopping checks.
This lesson builds on the existing derivatives-and-extrema lesson. It adds a convexity certificate, exact constant-step updates for a one-dimensional quadratic, and carefully bounded Newton examples. All examples and questions are original practice. The derivative updates illustrate the maintained DA-3-3 heading; they are not a claim that each algorithm is separately named in the official syllabus. Multivariable constraints, stochastic updates, general convergence rates, line-search implementation and full numerical conditioning are outside this pack.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Machine Learning Foundations
Start here: Fit a line and stabilize its weights: least squares and ridge regression. Suggested session: 65 minutes.
Suppose a small instrument reports a number x, and you want a straight rule predicting another number y. A rule y_hat=b0+b1x has two adjustable parameters: its starting height b0 and its slope b1. Real measurements need not fall exactly on a line. Least squares chooses the line whose squared vertical errors have the smallest total. A large positive error and a large negative error both cost something because each is squared. With several measured features, the same idea gives y_hat=b0+sum_j bⱼfⱼ. The model is linear in its parameters; a chosen feature may itself be a transformed input, such as x squared. This pack uses given real-valued features and squared loss.
Let n>=1 observations form the rows of F, an n by p feature matrix. Let y be an n-entry target column, beta the p-entry slope column, and 1 the n-entry all-ones column. The predictions are y_hat=b01+Fbeta. The residual e=y-y_hat has one entry per observation. We minimize J=(1/2)*||e||^2, half the sum of squared errors. SSE=||e||^2 and training MSE=SSE/n. Those quantities differ from the estimated noise variance with a degrees-of-freedom divisor. No assumption of Gaussian noise is needed to solve this stated optimization problem; probabilistic claims need separate assumptions.
Write X=[1,F], an n by (p+1) design matrix, and theta=(b0,beta). Differentiating J gives X^T(Xtheta-y). Setting this to zero gives X^T Xtheta=X^T y. If X has independent columns, the solution is unique. The inverse formula requires that rank condition. If columns are dependent, several coefficient vectors may give the same best fitted values. The fitted vector is still the unique nearest vector to y in the column space of X. Solve a suitable linear system or use QR/SVD in computation; the formula is a derivation, not a recommendation to form an explicit inverse.
Ridge adds a cost for large slopes. Our convention is J_lambda=(1/2)SSE+(lambda/2)||beta||^2, with lambda>=0. The intercept b0 is deliberately not penalized. This convention must be stated: penalizing the intercept or averaging the data loss changes the equations. A positive penalty balances data fit with smaller slope norm and yields a unique optimum even with duplicated features. It does not promise a lower training SSE or a lower test error. Choosing a useful penalty needs separate validation data or cross-validation.
Subtract the training feature means and target mean: F_c=F-1f_bar^T and y_c=y-y_bar1. The unpenalized-intercept equation gives b0=y_bar-f_bar^Tbeta. Ridge then solves (F_c^T F_c+lambdaIₚ)beta=F_c^T y_c. For lambda>0 this matrix is positive definite. For a single predictor define S_xx=sum_i(xᵢ-x_bar)^2 and S_xy=sum_i(xᵢ-x_bar)(yᵢ-y_bar). Then b1=S_xy/(S_xx+lambda), followed by b0=y_bar-b1*x_bar. For ordinary least squares set lambda=0 only when S_xx>0. This lesson covers bounded linear/multiple-linear fitting and ridge. Logistic regression, statistical inference, detailed optimization algorithms and a complete model-assessment treatment remain further study.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Machine Learning Foundations
Compute a split criterion or margin from a small dataset and distinguish a model’s decision rule from training loss.
Machine Learning Foundations
Trace assignment and centroid updates for k-means, then compare medoids and hierarchical linkage rules.
Artificial Intelligence and Search
Trace the frontier, the set of states waiting to be expanded, and update the cheapest known path when a state is reached again.
Artificial Intelligence and Search
Back up leaf utilities through alternating min and max nodes, then apply alpha-beta bounds without changing the minimax value.
Artificial Intelligence and Search
Start here: Propositional logic: read conditions and test an argument. Suggested session: 40 minutes.
Imagine checking a rule for issuing an access token: if a request is approved, a token is issued. One situation breaks that rule: the request is approved but no token is issued. A token issued for some other reason does not, by itself, break this one-way rule.
A proposition is a statement assigned either true or false. We use letters such as p and q for whole propositions, then combine them into formulas. A truth table lists the possible assignments of truth values and evaluates the formula on each assignment. It lets us check a claim without guessing from an everyday story.
This lesson uses classical, two-valued propositional logic. OR is inclusive: one or both alternatives may be true. The arrow means material implication, not a claim about causes or the order of events. Atomic propositions are unrestricted unless premises explicitly constrain them. Predicates, quantifiers, first-order inference and resolution are later topics; this is the shared foundation for those larger modules.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Deep Learning & Neural Networks
Track tensor dimensions and parameter counts through a feed-forward network, then apply the chain rule backward.
Probability and Statistics
Start here: Conditional probability, independence and Bayes reasoning. Suggested session: 40 minutes.
Conditional probability means finding a chance after you learn some information. Suppose a die result is known to be even.
Only 2,4,6 remain possible, so the chance of 6 is 1/3, not 1/6. The known information changes the group you count within.
For experiments with several steps, draw a tree: multiply along a path and add separate paths. Bayes rule helps you work backward from an observed result to its possible source.
This lesson starts with finite experiments and two source groups.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Probability and Statistics
Calculate conditional means, variances and covariance, then apply the laws of total expectation and total variance.
Linear Algebra and Calculus
Start here: Derivatives and extrema: find the best value and check the boundaries. Suggested session: 45 minutes.
A small change in a decision can improve an outcome, but only up to a point. For example, a rectangle with a fixed perimeter can become larger in area as one side grows, then smaller when that side becomes too long. A derivative tells us which way the value is changing near the current choice.
Write x for the input and f(x) for the output. The derivative f'(x) is the limiting slope near x, when that finite limit exists. If the derivative stays positive throughout an interval, the function increases across that interval; if it stays negative, the function decreases. A zero derivative is a useful candidate for a turning point, not a promise that a turn occurs.
This lesson uses real-valued functions of one real variable. It covers polynomial differentiation, first- and second-derivative checks, and optimization on a closed interval. Always write the allowed input values first. Limits and continuity in full detail, Taylor expansions, integration and other parts of the broader calculus topic remain separate lessons.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Linear Algebra and Calculus
Start here: Linear systems: elimination, rank and free variables. Suggested session: 40 minutes.
A linear system is a set of equations that must all be true at the same time. For example, x+y=3 and x-y=1 give x=2, y=1.
We store the numbers multiplying x and y in a table called the coefficient matrix. Adding the answers on the right gives the augmented matrix.
Elimination simplifies this table without changing its solutions. You will use it to decide whether there is one solution, no solution or many solutions.
We work with real numbers here.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Next lesson: Eigenvalues and eigenvectors: find the scale and check the direction. Suggested session: 45 minutes.
A matrix can stretch, turn or collapse an arrow represented by a vector. Some special nonzero vectors are sent to a scalar multiple of themselves. For example, a transformation might turn the vector (1,0)^T into (3,0)^T: its line stays the same and its scale becomes 3. These special vectors are called eigenvectors; their scale factors are eigenvalues.
The superscript T turns the written row of coordinates into a column vector. A positive scale preserves direction, a negative scale reverses direction, and a zero scale sends the vector to zero. The input eigenvector itself must never be the zero vector.
This lesson continues the earlier linear-systems lesson on the same syllabus topic. It covers square matrices, small eigenvalue calculations, direct checks, and the difference between repeated eigenvalues and independent eigenvectors. The worked calculations use real entries and real eigenvalues. A brief counterexample explains why a real matrix can also have complex eigenvalues. Full matrix decomposition methods, SVD and PCA remain separate lessons.
Machine Learning
Work through a kNN vote, a naive Bayes score and a shared-covariance LDA decision on small examples.
Machine Learning
Draw the training, validation and test partitions and fit every learned preprocessing step inside the training fold.
Machine Learning
Start here: Centered PCA: eigenvectors, scores and reconstruction. Suggested session: 65 minutes.
Imagine measuring several quantities on each object. Two measurements may vary together, so the objects can lie near a tilted line rather than filling the whole feature space. Keeping the most useful tilted directions can reduce the number of coordinates needed to describe the objects. Principal component analysis, or PCA, chooses mutually perpendicular directions that retain the greatest possible variance for a fixed number of retained directions. The approximation is an orthogonal projection.
The center matters. A cloud around (10,0) may vary mostly vertically, although its raw vectors point mostly horizontally from the origin. Centered PCA first subtracts the mean feature vector, so it measures variation around the cloud center. An SVD of the raw matrix can instead be dominated by the mean offset. Mean subtraction is centering; dividing each centered feature by its standard deviation is a separate scaling choice. Scaling changes the geometry and can change the PCA directions.
Use X with m observations as rows and d features as columns. Assume m>=2 and real, finite values. Let mu be the d-dimensional feature mean, Z=X-1*mu^T the centered matrix, and S=Z^T Z/(m-1) the sample covariance. Here 1 is the m-entry all-ones column. The eigenvalues lambda1>=lambda2>=...>=lambdad>=0 are variances along orthonormal eigenvectors. The first direction maximizes a^T S a over unit a; successive directions use orthogonality constraints. We use unscaled covariance PCA unless scaling is explicitly requested.
With orthonormal retained directions in Vₖ, the score matrix is T=Z Vₖ. Each row has k signed coordinates, not geometric lengths. For a unit direction vⱼ, a score vⱼ^T z can be negative; the length of that one-dimensional projected vector is |vⱼ^T z|. The centered reconstruction is Z_hat=T Vₖ^T, and the original-coordinate reconstruction is X_hat=1*mu^T+Z_hat. The data residual is perpendicular to the retained directions.
The compact SVD Z=USigmaV^T gives the same directions from the right singular vectors V. If sigma_j is a singular value, lambda_j=sigma_j^2/(m-1). A source using covariance divisor m has lambda_j=sigma_j^2/m instead. The directions and explained-variance fractions are unchanged by this common scalar divisor; absolute variance and the error conversion must use the stated divisor. PCA directions are not unique in sign, and repeated eigenvalues allow rotations within their eigenspace. This pack covers ordinary linear, unwhitened PCA; it does not develop kernel PCA, whitening or a complete survey of SVD algorithms.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Artificial Intelligence
Write the joint distribution as factors and choose an elimination order before computing an exact query.
Programming, Data Structures and Algorithms
Start here: Program tracing: variables, loops and recursive calls. Suggested session: 40 minutes.
Tracing means running a program on paper, one line at a time. Keep a small table of variable values.
When x changes, the next line uses the new x. A loop repeats a block; a recursive function calls itself on a smaller problem and waits for the answer.
This lesson uses stated pseudocode rules shared by CS and DA. It covers basic tracing, not all of C or Python.
Read the language and data types before applying these ideas to a PYQ.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Programming, Data Structures and Algorithms
Start here: Stacks and queues: trace the order and manage a circular queue. Suggested session: 40 minutes.
Think of a pile of plates and a line of people. From the pile, you take the plate placed on top most recently. From the line, the person who arrived earliest goes first. These are two different rules for removing stored items.
A stack uses last in, first out, or LIFO. A queue uses first in, first out, or FIFO. The rule describes behavior; arrays or linked nodes can implement either structure.
Stacks help with nested work such as function calls. Queues help process work in arrival order, including the frontier in breadth-first search. This lesson covers their basic operations, stack-output reasoning and one explicit circular-array queue design. It does not cover every linked-list, array or hash-table topic in the broader syllabus.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Programming, Data Structures and Algorithms
Start here: Binary search trees: follow a search path and read inorder. Suggested session: 40 minutes.
Imagine a set of numbered cards arranged as a branching search guide. At each card, a smaller target sends you left and a larger target sends you right. You follow one path until you find the target or reach an empty link.
A binary search tree, or BST, stores at most two children per node. Its ordering rule applies to whole subtrees: every key in a node's left subtree is smaller than that node's key, and every key in its right subtree is larger.
These notes use distinct keys, ordinary insertion without rotations, and height measured in edges. The root has depth zero, so a tree containing just the root has height zero. Duplicate-key policies, deletion, balancing rotations and heap operations need separate rules and are outside this lesson.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Programming, Data Structures and Algorithms
Start here: Binary search: shrink a sorted range and find the first match. Suggested session: 35 minutes.
Imagine looking for a word in an alphabetically ordered list. Read the middle word. Its position tells you which half can still contain your word. Repeat on that half.
Binary search uses this idea on a sorted array. Each step removes the middle position and at least roughly half the remaining candidates.
The examples here use ascending order, zero-based indices and constant-time access to an array element. They cover searching; sorting the array is a separate task.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Next lesson: Elementary sorting: trace insertion, selection and bubble sort. Suggested session: 50 minutes.
Suppose five exam scripts have scores [6,2,5,2,4]. You want the scores in ascending order, but you must keep every script: sorting rearranges records; it does not discard a repeated score. Insertion sort grows an ordered prefix one script at a time. Selection sort chooses the smallest remaining script and puts it in its final position. Bubble sort compares neighbours so that a large value can move right across a pass.
The three methods eventually give the same sorted keys, but their intermediate arrays, work counts and treatment of equal-key records can differ. Write the actual algorithm before counting. For example, bubble sort with an early-stop flag has a linear best case; removing the flag changes that best-case comparison count.
Prerequisites: zero-based arrays, assignment, for/while loops, comparisons and a remainder-free sum such as 1+2+...+k. Basic asymptotic notation helps with the last section. This lesson covers ascending, comparison-based insertion sort by shifting, selection sort by exchange, and left-to-right bubble sort with a shrinking right boundary and an early-stop flag. It does not cover merge sort, quicksort, heapsort, binary insertion, linked-list implementations or language-library sorting.
Further reading links: [OpenDSA: Insertion Sort](https://opendsa-server.cs.vt.edu/ODSA/Books/Everything/html/InsertionSort.html), [Selection Sort](https://opendsa-server.cs.vt.edu/ODSA/Books/Everything/html/SelectionSort.html), and [Bubble Sort](https://opendsa-server.cs.vt.edu/ODSA/Books/Everything/html/BubbleSort.html). Check the precise variant in any other explanation before transferring an exact count. The examples and questions below are original practice, not official GATE questions.
Programming, Data Structures and Algorithms
Start here: Algorithm cost: count loops and understand divide and conquer. Suggested session: 40 minutes.
Suppose a task checks every item in a list. Doubling the list roughly doubles the work. If it compares every item with every item, doubling the list can make the work roughly four times larger. Algorithm analysis describes how this work grows with input size.
Let n be the input size, such as the number of array elements. First choose an operation to count: a comparison, a loop-body execution or another constant-cost step. State which input case you are studying. Then express how the count grows as n becomes large.
This lesson covers basic loop counts and a balanced divide-and-conquer recurrence. It assumes ordinary unit-cost operations and excludes costs that grow with the number of bits in a value. It is a foundation, not a complete treatment of every recurrence or sorting algorithm.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Programming, Data Structures and Algorithms
Start here: Breadth-first search: layers and shortest paths without weights. Suggested session: 40 minutes.
Imagine a map whose links all take one step to cross. Start at one place. First find every place one step away, then every place two steps away, and continue outward. This is breadth-first search, or BFS.
A graph calls the places vertices and the links edges. The starting vertex is the source. A vertex's distance here means the smallest number of edges needed to reach it from the source, not a physical distance or a sum of unequal weights.
For example, if S connects to A and A connects to B, with no shorter route, their distances from S are 0, 1 and 2. BFS discovers them in these layers. This lesson covers BFS and its unweighted shortest-path use; other graph algorithms need their own rules.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Next lesson: Dijkstra: shortest paths when links have different costs. Suggested session: 45 minutes.
A route with fewer links need not be cheaper. A direct link of cost 9 loses to two links of costs 3 and 2, whose total is 5. BFS counts links; this lesson adds their stated costs.
Dijkstra keeps the cheapest route found so far to each vertex. Such a value is tentative: a later route may improve it. At each step, choose the unsettled vertex with the smallest finite tentative value. Its value can now be settled, meaning final, because all edge weights are nonnegative. A zero-weight edge is allowed.
Assume a finite directed or undirected graph, known nonnegative weights, and arithmetic that represents the sums exactly. All worked graphs here use small integer weights. A directed edge allows travel only in its stated direction. The lesson builds on the BFS pack; DFS, minimum spanning trees and algorithms for negative edges remain separate topics.
Database Management and Warehousing
Start here: Relational algebra: filter rows, join tables and answer every-condition queries. Suggested session: 45 minutes.
A relation is a table with named columns. In classical relational algebra, its rows form a set: the same whole row cannot appear twice, and row order has no meaning.
A query builds a new relation from existing ones. Selection keeps matching rows; projection keeps chosen columns; a join matches related rows from two tables. Work one operation at a time so you can see which rows and columns remain.
This foundation uses classical set semantics, no NULL values and explicit column names. It does not cover the whole ER-model, relational-calculus or SQL syllabus.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Database Management and Warehousing
Start here: Database normalization: find keys and split a table safely. Suggested session: 45 minutes.
Imagine an enrolment table that repeats an instructor's office beside every student taking that instructor's course. If the office changes, many rows need an update. A missed row can leave two different offices for the same instructor. Normalization starts by writing down the facts that must stay consistent, then asks whether a different table design can store those facts with less repetition.
A functional dependency, written X -> Y, says that rows agreeing on attributes X must also agree on attributes Y. It is a rule about every legal instance of the relation, not a pattern inferred from one convenient sample. Attribute names such as Student and Course describe columns; a relation schema lists those columns.
This lesson uses finite relational schemas, set semantics, atomic values and no SQL NULLs. The stated dependency set F and everything logically implied by it are the complete constraints used in each exercise. We write SC for the attribute set {S,C}, and X+ for its closure under F. SQL syntax, minimal-cover algorithms, multivalued dependencies and normal forms beyond BCNF remain later topics.
This covers a foundation within the topic; continue with the broader ideas below before marking the whole topic complete.
Next lesson: SQL: trace NULLs, join rows and count groups correctly. Suggested session: 60 minutes.
A missing score is different from a score of zero. If a learner submitted work but the score is not recorded, SQL can store NULL in the score column. A query asking whether that score is at least 60 cannot answer yes or no from the available value. Its result is UNKNOWN. A filter keeps a row only when its condition is TRUE, so that row is removed unless the query explicitly includes missing scores.
SQL questions become manageable when you write the rows that exist after each stage. For the queries in this lesson, reason in this order: build the FROM/JOIN rows, apply WHERE, form GROUP BY groups, compute aggregates and apply HAVING, choose the SELECT output, remove duplicates if DISTINCT is requested, and apply ORDER BY. This is a logical explanation of the result, not a promise about the database engine's physical execution order.
The shared data below deliberately includes two submissions by the same learner, a submission with an unknown score, a submission with an unknown learner ID, and two learners with no submissions. These cases make the rules visible.
Use these original tables. Learner(sid,name) has rows (1,'Asha'), (2,'Bela'), (3,'Chen'), (4,'Dev'). Submission(aid,sid,score) has rows (101,1,70), (102,1,NULL), (103,2,40), (104,2,40), (105,NULL,90).
Learner.sid and Submission.aid are non-NULL integer primary keys. Learner.name is non-NULL text. Submission.sid and score are nullable integers; no foreign-key constraint is assumed. SQL keeps duplicate rows unless DISTINCT is stated. NULL is a marker, not a quoted string or zero.
CREATE TABLE Learner (sid INTEGER NOT NULL PRIMARY KEY, name VARCHAR(20) NOT NULL); CREATE TABLE Submission (aid INTEGER NOT NULL PRIMARY KEY, sid INTEGER, score INTEGER); INSERT INTO Learner (sid, name) VALUES (1, 'Asha'), (2, 'Bela'), (3, 'Chen'), (4, 'Dev'); INSERT INTO Submission (aid, sid, score) VALUES (101, 1, 70), (102, 1, NULL), (103, 2, 40), (104, 2, 40), (105, NULL, 90);
A table alias is a short name used inside one query: Learner AS l allows l.sid to name the learner's ID. Submission AS s allows s.sid to name the other ID without ambiguity. An equality join with ON l.sid = s.sid considers one pair of rows at a time and retains the pair only if this condition is TRUE. The NULL sid in submission 105 does not equal any learner's sid.
A result is normally a bag: repeated output rows are allowed and their multiplicities matter. Learner 2 has two different submission IDs, both with score 40. Selecting only sid and score produces two visible (2,40) rows. SELECT DISTINCT sid, score would reduce those two to one. DISTINCT concerns the whole selected tuple, not just its first column. Nothing here guarantees an output order without ORDER BY. When a result is described as a set of IDs, only membership is being discussed; the SQL rows still follow the stated duplicate rules.
A left join preserves each left input row at the join stage. If it finds no right row satisfying ON, it emits one row with NULL in every right-table column. This is called a NULL-extended row. A later WHERE condition can still remove it. For learner 3 there is no matching submission at all, so s.aid is NULL in the result. For learner 1's submission 102, s.aid is 102 but s.score is NULL. An unknown score and an absent submission are different situations.
Grouping collects rows with the same grouping values so that an aggregate can summarize each group. COUNT(*) counts rows; COUNT(s.score) counts only non-NULL scores. AVG(s.score) divides the sum of known scores by the number of known scores, not by the number of submissions. All NULL values in a single grouping column belong to one group; this grouping rule does not make NULL = NULL TRUE in an equality predicate. A grouped query in this lesson lists every selected nonaggregate column in GROUP BY. We do not rely on a database choosing an arbitrary ungrouped value.
This is an expanded lesson within CS-10-2 and DA-8-2. It covers scalar NULL logic, simple SELECT queries, inner/left equality joins, elementary grouping and a missing-match subquery. It does not cover triggers, views, normalization, transaction behavior, window functions, optimizer costs or every SQL dialect. Continue the separate normalization lesson for DA-8-2. The constructed data, worked examples and six practice questions are original learning material, not official GATE PYQs.
Database Management and Warehousing
Distinguish file/index structure from data transformations such as scaling, discretization, sampling and compression.
Database Management and Warehousing
Design a fact table with dimensions and classify each measure before performing roll-up or drill-down.