First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Artificial Intelligence Fundamentals and Concepts
Which term describes the ability of an AI system to perform tasks it was not explicitly programmed to handle, by generalizing from training data?
- Generalization Correct answer.
- Serialization
- Memorization
- Overfitting
Explanation
Generalization is the capacity to apply learned patterns to new, unseen inputs rather than only reproducing training examples. It is the central goal of machine learning, distinguishing useful models from those that merely memorize.
Question 2Artificial Intelligence Fundamentals and Concepts
In machine learning, what is the role of a training set?
- It provides labeled examples from which a model learns patterns. Correct answer.
- It stores the final deployed model weights.
- It defines the programming language used for inference.
- It measures how fast the model runs on hardware.
Explanation
A training set consists of examples used to adjust model parameters so the model captures the underlying relationship. Evaluation should happen on separate data to avoid optimistic bias.
Question 3Artificial Intelligence Fundamentals and Concepts
Which of the following best characterizes supervised learning?
- The model learns from a reward signal through trial and error.
- The model clusters inputs without any labels.
- The model learns a mapping from inputs to known target labels. Correct answer.
- The model generates data from a random prior.
Explanation
Supervised learning uses paired input-output examples so the model can approximate the mapping from features to targets. Classification and regression are its two main forms.
Question 4Artificial Intelligence Fundamentals and Concepts
A model that performs very well on training data but poorly on new data is most likely experiencing which problem?
- Underfitting
- Class imbalance
- Overfitting Correct answer.
- Data leakage
Explanation
Overfitting occurs when a model captures noise specific to the training set, so performance drops on unseen data. The gap between training and validation performance is the classic symptom.
Question 5Artificial Intelligence Fundamentals and Concepts
What does a neural network's activation function primarily do?
- It stores the training dataset between epochs.
- It introduces non-linearity into the network's transformations. Correct answer.
- It selects which features to discard permanently.
- It compresses the model file for deployment.
Explanation
Activation functions apply a non-linear transform to neuron outputs, enabling the network to represent complex functions. Without non-linearity, stacked layers would collapse into a single linear mapping.
Question 6Artificial Intelligence Fundamentals and Concepts
Which statement describes unsupervised learning?
- It always produces a probability for a predefined class.
- It relies on a scalar reward from an environment.
- It requires human-labeled target values for every example.
- It finds structure in data without provided target labels. Correct answer.
Explanation
Unsupervised learning seeks patterns such as clusters or lower-dimensional representations in unlabeled data. No ground-truth targets guide the learning process.
Question 7Artificial Intelligence Fundamentals and Concepts
What is the purpose of a validation set during model development?
- To tune hyperparameters and compare model variants. Correct answer.
- To provide the final unbiased estimate of deployed performance.
- To increase the number of parameters the model learns.
- To replace the need for any training data.
Explanation
A validation set is used to select hyperparameters and model configurations without touching the test set. The held-out test set then provides the final performance estimate.
Question 8Artificial Intelligence Fundamentals and Concepts
Which of these is a classic example of a classification task?
- Forecasting next quarter's revenue.
- Assigning an email to spam or not spam. Correct answer.
- Predicting tomorrow's temperature in degrees.
- Estimating a house's sale price.
Explanation
Classification predicts a discrete category, such as spam versus not spam. The other listed tasks predict continuous numeric values, which is regression.
Question 9Artificial Intelligence Fundamentals and Concepts
A spam filter is trained on 10,000 labeled emails and then evaluated. Which metric directly measures the fraction of actual spam messages the filter correctly caught?
- Recall Correct answer.
- Accuracy
- Specificity
- Precision
Explanation
Recall for the spam class is the number of true positives divided by all actual positives, so it measures how many real spam messages were caught. Precision instead measures how many flagged messages were truly spam.
Question 10Artificial Intelligence Fundamentals and Concepts
Why is accuracy often a misleading metric for a dataset where 99% of examples belong to one class?
- Because accuracy ignores the training data entirely.
- Because accuracy requires probability outputs.
- Because accuracy cannot be computed for binary problems.
- Because a model predicting only the majority class still scores about 99%. Correct answer.
Explanation
With severe class imbalance, a trivial majority-class predictor achieves high accuracy while being useless for the minority class. Metrics such as precision, recall, or F1 reveal that failure.
Question 11Artificial Intelligence Fundamentals and Concepts
Which technique most directly reduces overfitting in a deep neural network by randomly disabling units during training?
- Learning rate warmup
- Batch normalization
- Dropout Correct answer.
- Weight initialization
Explanation
Dropout randomly zeroes a fraction of activations each training step, preventing units from co-adapting and acting as a regularizer. At inference, scaling is applied so expected activations remain consistent.
Question 12Artificial Intelligence Fundamentals and Concepts
In reinforcement learning, what does the agent receive after taking an action in an environment?
- A cluster assignment
- A gradient from a loss function
- A reward signal and a new state Correct answer.
- A labeled target vector
Explanation
The reinforcement learning loop has the agent act, then observe a reward and the next state, which together guide policy improvement. There are no explicit target labels as in supervised learning.
Question 13Artificial Intelligence Fundamentals and Concepts
What is the primary function of a convolutional layer in an image model?
- To detect local spatial patterns using shared filters. Correct answer.
- To convert images into text captions.
- To store pixel values in a database.
- To reduce the number of training images required.
Explanation
Convolutional layers slide learned filters across the input, detecting local features such as edges and textures while sharing weights across positions. This weight sharing exploits spatial structure efficiently.
Question 14Artificial Intelligence Fundamentals and Concepts
Which description best fits a large language model?
- A rule-based system with hand-written grammar rules.
- A decision tree that classifies individual words.
- A neural network trained to predict tokens in sequences. Correct answer.
- A database that retrieves stored sentences verbatim.
Explanation
Large language models are neural networks, typically transformers, trained on a next-token prediction objective over large text corpora. This objective lets them model statistical structure of language.
Question 15Artificial Intelligence Fundamentals and Concepts
A team notices their model's validation loss decreases then begins to rise while training loss keeps falling. What is the most reasonable interpretation?
- The model has begun to overfit and training should stop or regularize. Correct answer.
- The validation set is larger than the training set.
- The dataset contains no useful signal.
- The learning rate is too low to make progress.
Explanation
Diverging training and validation curves indicate the model is fitting training-specific noise, a hallmark of overfitting. Early stopping or added regularization typically addresses this.
Question 16Artificial Intelligence Fundamentals and Concepts
What does the softmax function produce from a vector of raw class scores?
- A binary vector with exactly one nonzero entry.
- A single scalar representing total loss.
- A sorted list of the input scores.
- A set of values that sum to one, interpretable as class probabilities. Correct answer.
Explanation
Softmax exponentiates each score and normalizes by the sum, yielding a probability distribution over classes. It preserves relative ordering while making values comparable as probabilities.
Question 17Artificial Intelligence Fundamentals and Concepts
Which scenario best illustrates the exploration-exploitation trade-off in reinforcement learning?
- An agent choosing between a known rewarding action and trying a new one. Correct answer.
- A classifier selecting the highest-probability class.
- A model training on a fixed labeled dataset without updates.
- A database choosing an index for a query.
Explanation
Exploration gathers information about uncertain actions, while exploitation uses current knowledge to maximize reward. Balancing the two is central to reinforcement learning algorithms.
Question 18Artificial Intelligence Fundamentals and Concepts
What is the main purpose of splitting data into training, validation, and test sets?
- To guarantee the model has zero error.
- To increase the total amount of data available.
- To eliminate the need for hyperparameters.
- To estimate generalization performance honestly. Correct answer.
Explanation
Holding out data that the model never trains on gives an unbiased estimate of how it will perform on new inputs. The three-way split separates model fitting, tuning, and final evaluation.
Question 19Artificial Intelligence Fundamentals and Concepts
Which statement about precision and recall is correct?
- Precision and recall always increase together.
- Recall measures the fraction of predicted positives that are correct.
- Precision is undefined when there are false negatives.
- Increasing the classification threshold typically raises precision and lowers recall. Correct answer.
Explanation
Raising the threshold makes positive predictions more conservative, usually increasing precision while reducing recall. The two metrics trade off along the precision-recall curve.
Question 20Artificial Intelligence Fundamentals and Concepts
What distinguishes a generative model from a discriminative model?
- Generative models only classify; discriminative models only create images.
- Generative models cannot be neural networks.
- Generative models require no data; discriminative models require labeled data.
- Generative models learn the joint distribution of inputs and labels; discriminative models learn the conditional label distribution given inputs. Correct answer.
Explanation
Generative models capture how data and labels are jointly produced, allowing sampling of new data, while discriminative models focus on the decision boundary between classes. Both can be implemented with neural networks.
Question 21Artificial Intelligence Fundamentals and Concepts
A transformer's self-attention mechanism primarily allows each token to do what?
- Sort the vocabulary by frequency.
- Apply a convolution over neighboring pixels only.
- Compress the sequence into a single fixed vector before processing.
- Weigh information from other tokens in the sequence when building its representation. Correct answer.
Explanation
Self-attention computes relevance scores between tokens so each position aggregates context from the whole sequence. This contrasts with fixed-window recurrence or convolution, enabling long-range dependencies.
Question 22Artificial Intelligence Fundamentals and Concepts
In gradient descent, what does the learning rate control?
- The size of the parameter update at each step. Correct answer.
- The fraction of data held out for testing.
- The number of layers in the network.
- The number of classes in the output.
Explanation
The learning rate scales the gradient step, determining how far parameters move per update. Too large a rate can diverge, while too small a rate slows convergence.
Question 23Artificial Intelligence Fundamentals and Concepts
Why does weight sharing in convolutional layers improve efficiency compared with fully connected layers on images?
- It guarantees the model cannot overfit.
- The same filter is applied at many positions, greatly reducing the number of parameters. Correct answer.
- It removes the need for any activation functions.
- It eliminates the need for training data.
Explanation
A single filter reused across spatial positions captures a pattern anywhere in the image with far fewer parameters than position-specific connections. This exploits translation invariance and reduces memory and compute.
Question 24Artificial Intelligence Fundamentals and Concepts
Which situation most clearly indicates data leakage in a machine learning pipeline?
- Training uses mini-batches of varying size.
- The model uses a different random seed each run.
- The test set is used only once at the very end.
- Normalization statistics are computed on the full dataset before splitting. Correct answer.
Explanation
Computing statistics on the full dataset lets information from test examples influence training preprocessing, inflating validation performance. Preprocessing should be fit only on training data.
Question 25Artificial Intelligence Fundamentals and Concepts
An agent trained in a simulation performs poorly when deployed in the real world. Which concept best explains this gap?
- An insufficient number of output classes
- Incorrect use of softmax
- Distribution shift between the training and deployment environments Correct answer.
- A learning rate that is too high
Explanation
When deployment data or dynamics differ from training conditions, the learned policy or model no longer matches the environment, a distribution shift. Closing this gap requires domain randomization or adaptation.
Question 26Artificial Intelligence Fundamentals and Concepts
Which statement best describes the goal of supervised learning?
- To discover hidden structure in unlabeled data without any target values.
- To maximize a reward signal through trial-and-error interaction with an environment.
- To learn a mapping from input features to a target output using labeled examples. Correct answer.
- To compress high-dimensional data into a lower-dimensional representation for visualization.
Explanation
Supervised learning uses a dataset of input-output pairs to approximate the function that maps inputs to outputs. The presence of labeled targets distinguishes it from unsupervised and reinforcement learning.
Question 27Artificial Intelligence Fundamentals and Concepts
A model achieves 95% accuracy on the training set but only 60% on the test set. Which term best characterizes this outcome?
- Data leakage
- Underfitting
- Class imbalance
- Overfitting Correct answer.
Explanation
Overfitting occurs when a model captures noise or idiosyncrasies of the training data and therefore fails to generalize to unseen data. The large gap between training and test performance is a classic symptom.
Question 28Artificial Intelligence Fundamentals and Concepts
Which statement best describes the role of an activation function in a neural network?
- It introduces non-linearity so the network can approximate complex functions. Correct answer.
- It normalizes the input features to have zero mean and unit variance.
- It computes the gradient of the loss with respect to each weight.
- It randomly drops units during training to reduce co-adaptation.
Explanation
Activation functions such as ReLU or sigmoid apply a non-linear transformation to neuron outputs. Without non-linearity, a deep network would collapse to an equivalent linear model regardless of depth.
Question 29Artificial Intelligence Fundamentals and Concepts
Which statement best describes the bias-variance trade-off?
- Bias and variance are independent of model complexity.
- Variance measures the error from overly simplistic assumptions, while bias measures sensitivity to training data.
- Simple models tend to have high bias, while complex models tend to have high variance. Correct answer.
- Increasing model complexity always reduces both bias and variance.
Explanation
The bias-variance trade-off describes how model complexity affects generalization error. Simpler models underfit with high bias, while more flexible models can overfit with high variance.
Question 30Artificial Intelligence Fundamentals and Concepts
A company wants to predict a customer's exact spending amount next month based on past transactions. Which type of machine learning task is this?
- Clustering
- Regression Correct answer.
- Classification
- Dimensionality reduction
Explanation
Regression predicts a continuous numeric output, such as a spending amount. Classification predicts discrete categories, while clustering and dimensionality reduction are unsupervised tasks.
Question 31Artificial Intelligence Fundamentals and Concepts
Which technique is most appropriate for handling missing values in a feature before training a model?
- Ignoring missing values and training on incomplete rows
- Removing the entire feature if any value is missing
- Replacing missing values with a constant such as -1 without considering the data distribution
- Imputation using the mean or median of observed values Correct answer.
Explanation
Imputation replaces missing entries with estimated values such as the mean or median, preserving the sample size and allowing the model to use the feature. Dropping the feature or rows can discard useful information, and arbitrary constants can distort the distribution.
Question 32Artificial Intelligence Fundamentals and Concepts
Which statement best describes the purpose of feature scaling in algorithms such as k-nearest neighbors or support vector machines?
- It converts categorical variables into numeric ones.
- It ensures that features with larger numeric ranges do not dominate the distance calculations. Correct answer.
- It increases the number of features to improve model flexibility.
- It reduces the risk of overfitting by removing outliers.
Explanation
Distance-based algorithms are sensitive to the scale of features, so scaling (e.g., standardization or min-max normalization) puts features on a comparable range. This prevents features with large magnitudes from disproportionately influencing the model.
Question 33Artificial Intelligence Fundamentals and Concepts
Which statement best describes the difference between a model's parameters and its hyperparameters?
- Parameters control the learning algorithm, while hyperparameters define the model architecture.
- Parameters are set by the user, while hyperparameters are learned from data.
- Parameters are learned from data during training, while hyperparameters are set before training. Correct answer.
- Both parameters and hyperparameters are learned from data during training.
Explanation
Model parameters, such as weights in a neural network, are optimized during training. Hyperparameters, such as learning rate or number of layers, are chosen before training and guide the learning process.
Question 34Artificial Intelligence Fundamentals and Concepts
A data scientist trains a decision tree and observes that it perfectly classifies the training data but performs poorly on new data. Which change is most likely to improve generalization?
- Removing the validation set and training on all data
- Increasing the maximum depth of the tree
- Adding more training examples with the same distribution
- Limiting the maximum depth or pruning the tree Correct answer.
Explanation
A tree that perfectly fits training data is likely overfitting, and restricting its depth or pruning reduces variance. More training data can help, but the question specifies the same distribution, so it may not address the overfitting.
Question 35Artificial Intelligence Fundamentals and Concepts
Which statement best describes the purpose of cross-validation in model evaluation?
- To estimate generalization performance by training and testing on multiple different splits of the data. Correct answer.
- To increase the size of the training set by using the test set during training.
- To select the model with the highest training accuracy.
- To reduce the number of features used by the model.
Explanation
Cross-validation partitions the data into multiple folds, training and evaluating on different subsets to obtain a more reliable estimate of performance. It helps assess how well a model generalizes beyond a single train-test split.
Question 36Artificial Intelligence Fundamentals and Concepts
Which statement best describes the difference between batch gradient descent and stochastic gradient descent (SGD)?
- Batch gradient descent uses a single example per update, while SGD uses the entire training set.
- Batch gradient descent and SGD are identical in how they compute updates.
- Batch gradient descent updates weights using the entire training set, while SGD updates using a single example or small batch. Correct answer.
- SGD always converges to a better solution than batch gradient descent.
Explanation
Batch gradient descent computes the gradient over the full dataset before each update, whereas SGD uses one example or a mini-batch, making updates more frequent and noisy. This affects convergence speed and stability.
Question 37Artificial Intelligence Fundamentals and Concepts
A team is building a model to detect fraudulent transactions, where only 1% of transactions are fraudulent. They want to ensure that most actual fraud cases are flagged. Which metric should they prioritize?
- Precision
- Accuracy
- Specificity
- Recall Correct answer.
Explanation
Recall measures the fraction of actual positive cases that are correctly identified, which aligns with the goal of flagging most fraud cases. Precision focuses on the proportion of flagged cases that are truly fraudulent, and accuracy can be misleading with severe class imbalance.
Question 38Artificial Intelligence Fundamentals and Concepts
Which statement best describes the role of the backpropagation algorithm in training a neural network?
- It normalizes the input data to speed up convergence.
- It computes the gradient of the loss with respect to each weight by applying the chain rule. Correct answer.
- It selects the learning rate for each layer automatically.
- It randomly initializes the weights of the network before training.
Explanation
Backpropagation efficiently computes gradients by propagating errors backward through the network using the chain rule. These gradients are then used by an optimizer to update the weights.
Question 39Artificial Intelligence Fundamentals and Concepts
A machine learning engineer notices that their model's performance on the test set is surprisingly high compared to validation, and later discovers that features were computed using statistics from the entire dataset before splitting. Which issue does this describe?
- Concept drift
- Underfitting
- Data leakage Correct answer.
- Overfitting
Explanation
Data leakage occurs when information from outside the training set, such as statistics from the full dataset, contaminates the training process. This can artificially inflate test performance because the model has indirect access to test data.
Question 40Artificial Intelligence Fundamentals and Concepts
Which statement best explains why the softmax function is often used in the output layer of a multi-class classifier?
- It applies a non-linear transformation to hidden layers to improve training.
- It ensures that each class score is between zero and one independently of the others.
- It converts raw scores into a probability distribution that sums to one across classes. Correct answer.
- It reduces the dimensionality of the feature space before classification.
Explanation
Softmax exponentiates and normalizes the raw class scores so that they form a valid probability distribution over the classes. This is useful for multi-class classification where the classes are mutually exclusive.
Question 41Machine Learning and Data Processing
Which learning paradigm trains a model on labeled input-output pairs?
- Density estimation
- Unsupervised learning
- Supervised learning Correct answer.
- Reinforcement learning
Explanation
Supervised learning uses a dataset where each input is paired with a known target label, and the model learns a mapping from inputs to those labels. The other paradigms do not require labeled target values for each example.
Question 42Machine Learning and Data Processing
A model fits its training data almost perfectly but performs poorly on new data. What is this called?
- Regularization
- Overfitting Correct answer.
- Underfitting
- Data leakage
Explanation
Overfitting occurs when a model captures noise or idiosyncrasies specific to the training set, so its generalization error is high despite low training error. The gap between low training error and high test error is the signature of overfitting.
Question 43Machine Learning and Data Processing
In k-fold cross-validation, what is the primary purpose of splitting the data into k folds?
- To reduce the size of the training set
- To eliminate the need for a separate test set
- To estimate generalization performance more reliably Correct answer.
- To guarantee the model has zero variance
Explanation
Cross-validation rotates which fold is held out, so every example is used for validation exactly once, giving a lower-variance estimate of generalization performance than a single split. It does not change the fundamental need for honest evaluation.
Question 44Machine Learning and Data Processing
Which metric is most appropriate for a heavily imbalanced binary classification problem where the positive class is rare?
- Mean squared error
- Precision-recall AUC Correct answer.
- Accuracy
- R-squared
Explanation
With severe class imbalance, accuracy can be high simply by predicting the majority class, so it hides poor detection of the rare class. Precision-recall curves and their AUC focus on performance on the positive class and are more informative in that setting.
Question 45Machine Learning and Data Processing
What does L2 regularization add to the training objective?
- A penalty proportional to the sum of squared weights Correct answer.
- A penalty proportional to the sum of absolute weights
- A penalty proportional to the number of nonzero weights
- A penalty proportional to the number of training examples
Explanation
L2 regularization adds a term proportional to the sum of squared parameter values, which shrinks weights toward zero smoothly. L1 uses absolute values and tends to produce sparse solutions.
Question 46Machine Learning and Data Processing
A dataset has a feature with values ranging from 1 to 1,000,000 while other features range from 0 to 1. Which preprocessing step is most important before training a distance-based model such as k-nearest neighbors?
- One-hot encoding
- Feature scaling Correct answer.
- Target encoding
- Polynomial expansion
Explanation
Distance-based models compute distances across all features, so a feature with a much larger numeric range dominates the distance calculation. Standardizing or normalizing features puts them on comparable scales so each contributes fairly.
Question 47Machine Learning and Data Processing
Which statement best describes the role of a validation set during model development?
- It is used to tune hyperparameters and select models Correct answer.
- It provides the final unbiased estimate of test performance
- It is used to update model weights during training
- It replaces the training set when data is scarce
Explanation
The validation set is held out from training and used to compare model configurations and choose hyperparameters. The test set is reserved for the final, unbiased performance estimate.
Question 48Machine Learning and Data Processing
In a decision tree, what quantity does the Gini impurity of a node measure?
- The depth of the node in the tree
- The correlation between features used in the split
- The fraction of training examples that reach the node
- The probability that a randomly chosen sample is misclassified by the node's label distribution Correct answer.
Explanation
Gini impurity equals one minus the sum of squared class probabilities in a node, which is the probability that a randomly drawn sample would be mislabeled if labeled according to the node's class distribution. Lower values indicate purer nodes.
Question 49Machine Learning and Data Processing
What is the main effect of increasing the number of trees in a random forest?
- It generally improves or stabilizes performance up to diminishing returns Correct answer.
- It guarantees the training error will rise
- It increases variance in the ensemble prediction
- It removes the need for bootstrapping
Explanation
Averaging more trees reduces the variance of the ensemble prediction, so performance typically improves and stabilizes, though with diminishing returns and higher computation cost. Adding trees does not cause overfitting in the way adding depth does.
Question 50Machine Learning and Data Processing
Gradient boosting builds an additive model by doing which of the following at each stage?
- Clustering the residuals into groups
- Selecting features with the highest variance
- Averaging predictions of independently trained deep networks
- Fitting a new weak learner to the negative gradient of the loss Correct answer.
Explanation
Gradient boosting fits each new weak learner to approximate the negative gradient of the loss with respect to current predictions, which is the functional gradient descent step. This generalizes residual fitting to arbitrary differentiable losses.