Data Science Exam — Questions and Answers
Question 1: What is 'catastrophic forgetting' in the context of fine-tuning language models?
- The optimizer forgets momentum values between epochs
- The model loses previously learned knowledge when updated on new task data (Correct answer)
- The model forgets the fine-tuning task after deployment
- The model fails to converge during pre-training
Correct answer: The model loses previously learned knowledge when updated on new task data
Catastrophic forgetting occurs when fine-tuning on a new task overwrites the weights learned during pre-training, degrading performance on original capabilities.
Question 2: In a neural network, what is the vanishing gradient problem?
- Gradients become too large and cause weight updates to diverge
- The loss function fails to converge during backpropagation
- Gradients shrink exponentially through layers, slowing learning in early layers (Correct answer)
- Dropout randomly zeroes gradients, reducing effective learning
Correct answer: Gradients shrink exponentially through layers, slowing learning in early layers
When gradients approach zero during backpropagation, early layers learn very slowly or not at all.
Question 3: Find the clustering technique that accounts for data variance.
- All of the above
- K means
- Decision tree
- Gaussian mixture model (Correct answer)
Correct answer: Gaussian mixture model
The Gaussian Mixture Model (GMM) is a probabilistic clustering technique that accounts for the variance and covariance of data within each cluster. Unlike K-means, which assumes spherical clusters of equal size, GMM models each cluster as a Gaussian distribution, allowing for elliptical and differently sized clusters. This flexibility provides a more nuanced and robust approach to identifying natural groupings in complex datasets.
Question 4: When applying K-Means to text data represented as TF-IDF vectors, which distance metric is typically preferred?
- Euclidean distance
- Hamming distance
- Cosine similarity (Correct answer)
- Manhattan distance
Correct answer: Cosine similarity
Cosine similarity measures the angle between document vectors regardless of magnitude, making it more appropriate for high-dimensional sparse TF-IDF representations.
Question 5: What does the 'elbow' in the K-Means elbow method represent?
- The point where the algorithm stops converging
- The k value where marginal reduction in inertia becomes small (Correct answer)
- The k value where inertia starts increasing
- The optimal silhouette score
Correct answer: The k value where marginal reduction in inertia becomes small
The elbow is where adding more clusters yields diminishing returns in inertia reduction, suggesting that additional clusters explain little additional variance.
Question 6: Which algorithm is a non-parametric, instance-based learning method that classifies new points based on the majority label among their nearest neighbors?
- Naive Bayes
- Logistic Regression
- K-Nearest Neighbors (KNN) (Correct answer)
- Support Vector Machine
Correct answer: K-Nearest Neighbors (KNN)
KNN stores training examples and classifies new instances by a vote among the k closest training points in feature space.
Question 7: Which metric is commonly used to evaluate named entity recognition (NER) performance?
- Perplexity
- BLEU score
- ROUGE-L
- Entity-level F1 score (Correct answer)
Correct answer: Entity-level F1 score
NER is evaluated with entity-level F1, which requires both the entity boundary and entity type to match for a prediction to count as correct.
Question 8: What is the 'curse of dimensionality' and how does it affect k-NN classification?
- k-NN requires exponentially more classes as dimensions grow
- As dimensions increase, distances between points become similar, making nearest neighbors less meaningful (Correct answer)
- High dimensionality causes k-NN to overfit via the kernel trick
- High dimensionality speeds up k-NN by reducing search space
Correct answer: As dimensions increase, distances between points become similar, making nearest neighbors less meaningful
In high-dimensional spaces, Euclidean distances concentrate, making it hard to distinguish 'near' from 'far' neighbors, which undermines k-NN's core assumption.
Question 9: Which of the following best describes the approach used to find previously undiscovered qualities in the data?
- Reinforcement Learning
- Supervised Learning
- Unsupervised Learning (Correct answer)
- Deep Learning
Correct answer: Unsupervised Learning
Unsupervised learning is a type of machine learning that deals with unlabeled data, meaning there are no predefined output variables. Its primary goal is to discover hidden patterns, structures, or relationships within the data without human guidance. This approach is ideal for finding previously undiscovered qualities, unlike supervised learning which relies on labeled data for prediction.
Question 10: Which technique is specifically designed to identify which features most influenced a model prediction for a single instance?
- Cross-validation
- SHAP (SHapley Additive exPlanations) (Correct answer)
- Principal Component Analysis
- Gradient clipping
Correct answer: SHAP (SHapley Additive exPlanations)
SHAP assigns each feature a contribution value for a specific prediction based on game-theoretic Shapley values.
Question 11: In data science, what is a 'data lake'?
- A centralized repository storing raw data in any format at scale (Correct answer)
- A type of visualization tool
- A structured relational database
- A machine learning framework
Correct answer: A centralized repository storing raw data in any format at scale
A data lake stores raw, unprocessed data in any format at scale, unlike a data warehouse which stores structured, processed data.
Question 12: The Matthews Correlation Coefficient (MCC) is preferred over accuracy for imbalanced binary classification because:
- It only considers true positives and true negatives
- It is equivalent to the F1-score
- It is faster to compute
- It accounts for all four confusion matrix values and handles class imbalance (Correct answer)
Correct answer: It accounts for all four confusion matrix values and handles class imbalance
MCC incorporates TP, TN, FP, and FN into a single balanced measure, making it robust even when classes are heavily imbalanced.
Question 13: Which of the following technologies is primarily designed as a distributed, fault-tolerant, and high-throughput messaging system used to ingest and publish real-time streams of data?
- Apache Hive
- Apache Kafka (Correct answer)
- HDFS
- Apache Spark
Correct answer: Apache Kafka
Apache Kafka is a distributed event streaming platform built to handle high-throughput, real-time data feeds. It acts as a publish-subscribe messaging system, decoupling data producers from data consumers, and is a cornerstone of modern streaming data pipelines. Spark is a processing engine, HDFS is for storage, and Hive is for querying.
Question 14: Which encoding method is most appropriate for an ordinal categorical variable like 'education level' (High School < Bachelor's < Master's < PhD)?
- Ordinal encoding (Correct answer)
- One-hot encoding
- Binary encoding
- Target encoding
Correct answer: Ordinal encoding
Ordinal encoding assigns integer values that preserve the natural order of the categories.
Question 15: What is the purpose of one-hot encoding in machine learning preprocessing?
- To convert categorical variables into binary indicator columns for use in algorithms requiring numerical input (Correct answer)
- To normalize numerical features to a 0-1 range
- To impute missing values using the most frequent category
- To reduce the number of categories by merging rare levels
Correct answer: To convert categorical variables into binary indicator columns for use in algorithms requiring numerical input
One-hot encoding represents each category as a separate binary column, allowing algorithms that require numerical input to use categorical variables.
Question 16: What is the primary reason to use stratified k-fold cross-validation for classification?
- It prevents data leakage between training and test sets
- It ensures each fold maintains the same class proportion as the full dataset (Correct answer)
- It automatically handles missing values in the dataset
- It reduces training time by using fewer folds
Correct answer: It ensures each fold maintains the same class proportion as the full dataset
Stratified k-fold ensures each fold reflects the overall class distribution, giving a more reliable estimate of model performance, especially with imbalanced classes.
Question 17: A data scientist calculates a 95% confidence interval for the average daily screen time of users on a new mobile app, resulting in an interval of [35.2 minutes, 39.8 minutes]. Which of the following is the most accurate interpretation of this result?
- The sample mean of daily screen time has a 95% chance of being the true population mean.
- There is a 95% probability that the true average daily screen time for all users is between 35.2 and 39.8 minutes.
- 95% of all users have a daily screen time between 35.2 and 39.8 minutes.
- If we were to repeat this sampling process many times, we would expect 95% of the calculated confidence intervals to contain the true population mean for daily screen time. (Correct answer)
Correct answer: If we were to repeat this sampling process many times, we would expect 95% of the calculated confidence intervals to contain the true population mean for daily screen time.
The 95% confidence level refers to the reliability of the estimation method, not a specific interval. It means that if we repeated the experiment or sampling many times, 95% of the intervals we create would capture the true, unknown population parameter.
Question 18: The principle of 'beneficence' in AI ethics requires that AI systems:
- Actively promote the well-being of users and society (Correct answer)
- Be open-source to enable peer review
- Operate within defined computational budgets
- Minimize the number of model parameters
Correct answer: Actively promote the well-being of users and society
Beneficence obligates AI developers to design systems that do good and improve human welfare, not merely avoid harm.
Question 19: In a right-skewed distribution, which ordering of summary statistics is correct?
- Mean = Median = Mode
- Mean < Median < Mode
- Mode < Median < Mean (Correct answer)
- Median < Mode < Mean
Correct answer: Mode < Median < Mean
In a right-skewed distribution the long tail pulls the mean up above the median, which sits above the mode.
Question 20: What is the primary purpose of data normalization?
- Remove null values
- Remove duplicate records
- Scale features to a common range (Correct answer)
- Increase dataset size
Correct answer: Scale features to a common range
Normalization scales features to a common range (e.g., 0–1) so no single feature dominates due to magnitude.
Question 21: A retail company wants to test if there is a statistically significant difference in the average transaction value among customers using three different payment methods (Credit Card, Debit Card, Mobile Pay). Which statistical test is most appropriate for this analysis?
- Analysis of Variance (ANOVA) (Correct answer)
- Chi-squared test
- Independent two-sample t-test
- Paired t-test
Correct answer: Analysis of Variance (ANOVA)
ANOVA is used to compare the means of three or more independent groups. A t-test is only suitable for comparing the means of two groups. Using multiple t-tests would inflate the probability of a Type I error.
Question 22: Counterfactual explanations in AI ethics are used to:
- Audit training pipelines for data leakage
- Detect adversarial attacks on models
- Generate synthetic data for fairness testing
- Show what minimal changes to input would alter a model's decision (Correct answer)
Correct answer: Show what minimal changes to input would alter a model's decision
Counterfactual explanations tell users 'if X had been different, the outcome would have changed,' making decisions more actionable and understandable.
Question 23: A paired t-test is preferred over an independent samples t-test when:
- Each observation in one group is naturally matched to one in the other (Correct answer)
- Sample sizes in the two groups are very different
- Both samples are drawn from normal distributions
- The population variances are assumed equal
Correct answer: Each observation in one group is naturally matched to one in the other
Pairing (e.g., before/after measurements on the same subject) removes between-subject variability, increasing power via the paired design.
Question 24: A customer segmentation model produces 6 clusters, but cluster 3 has a silhouette score of -0.2 while others average 0.6. What should the analyst do?
- Try a different k value or merge cluster 3 with its nearest cluster (Correct answer)
- Remove all points in cluster 3 from the dataset
- Switch to a supervised learning approach
- Accept the results since the average is positive
Correct answer: Try a different k value or merge cluster 3 with its nearest cluster
A negative silhouette score means points in cluster 3 are on average closer to another cluster than their own, indicating a poor cluster assignment that warrants reconfiguration.
Question 25: In the context of clustering high-dimensional data, what is the 'curse of dimensionality' problem?
- Cluster labels become unreliable in high dimensions
- Distance metrics become less meaningful as all pairwise distances converge (Correct answer)
- Algorithms run slower in high dimensions
- Silhouette scores cannot be computed above 100 dimensions
Correct answer: Distance metrics become less meaningful as all pairwise distances converge
As dimensionality increases, the ratio of maximum to minimum pairwise distances approaches 1, making distance-based clustering unreliable since all points appear equally far apart.
Question 26: Which evaluation metric is most appropriate for machine translation tasks?
- F1-score
- Jaccard similarity
- Perplexity
- BLEU score (Correct answer)
Correct answer: BLEU score
BLEU (Bilingual Evaluation Understudy) measures n-gram overlap between generated translations and reference translations.
Question 27: Differential privacy protects individual data by:
- Encrypting all records with AES-256
- Adding calibrated statistical noise to query outputs (Correct answer)
- Anonymizing names and addresses only
- Requiring opt-in consent for each query
Correct answer: Adding calibrated statistical noise to query outputs
Differential privacy adds carefully calibrated noise so aggregate query results cannot reveal individual-level information.
Question 28: What does the term 'polysemy' mean in linguistics and NLP?
- A word borrowed from another language
- A word that has multiple spellings
- Two different words with identical meanings
- A single word form that carries multiple related meanings (Correct answer)
Correct answer: A single word form that carries multiple related meanings
Polysemy refers to a single word having multiple related senses, such as 'bank' meaning a financial institution or a riverbank.
Question 29: Which of the following is an example of a hyperparameter (not a learned parameter) in a neural network?
- The learning rate used by the optimizer (Correct answer)
- The bias values in a dense layer
- The activation values at a hidden layer
- The weights of a convolutional filter
Correct answer: The learning rate used by the optimizer
Hyperparameters like learning rate, batch size, and number of layers are set before training and not updated by gradient descent, unlike weights and biases which are learned.
Question 30: In a confusion matrix, what does a False Negative represent?
- Model predicted negative but the actual was positive (Correct answer)
- Model predicted positive and was correct
- Model predicted negative and was correct
- Model predicted positive but was wrong
Correct answer: Model predicted negative but the actual was positive
A False Negative occurs when the model predicts the negative class but the true label is positive.
Question 31: In the encoder-decoder attention of a transformer, what do the queries come from?
- The decoder's previous hidden states (Correct answer)
- A learned embedding table
- The positional encoding layer
- The encoder's final hidden states
Correct answer: The decoder's previous hidden states
In cross-attention, the decoder generates queries from its own states, while keys and values come from the encoder's output.
Question 32: Which distance metric computes the sum of absolute differences between coordinates?
- Manhattan distance (Correct answer)
- Mahalanobis distance
- Euclidean distance
- Cosine similarity
Correct answer: Manhattan distance
Manhattan (L1) distance sums the absolute differences along each dimension, geometrically resembling travel along city blocks.
Question 33: In hierarchical clustering, what is the time complexity of the naive algorithm for n data points?
- O(n²)
- O(n² log n)
- O(n log n)
- O(n³) (Correct answer)
Correct answer: O(n³)
Naive agglomerative hierarchical clustering requires O(n²) space for the distance matrix and O(n³) time to repeatedly find and update minimum distances across n-1 merge steps.
Question 34: What chart type uses color as a third dimension to represent a third variable across a 2D scatter plot?
- Scatter plot matrix
- Heatmap
- Bubble chart (Correct answer)
- Choropleth map
Correct answer: Bubble chart
A bubble chart extends a scatter plot by varying the size or color of each point to encode a third variable, effectively visualizing three dimensions.
Question 35: In the context of building a classification model, what is the primary purpose of a train/test split?
- To evaluate the model's performance on unseen data and check for overfitting. (Correct answer)
- To train the model on the entire dataset for maximum accuracy.
- To ensure the features are on a similar scale before model training.
- To increase the size of the dataset by creating new data points.
Correct answer: To evaluate the model's performance on unseen data and check for overfitting.
The dataset is split into a training set and a testing set. The model learns from the patterns in the training set. The test set, which the model has not been exposed to during training, is then used to provide an unbiased evaluation of how well the model generalizes to new, unseen data. This process is crucial for identifying overfitting, where a model performs well on training data but poorly on new data.
Question 36: A data scientist is developing a classification model to predict customer churn. The dataset is highly imbalanced, with only 5% of customers having churned. Which evaluation metric is most appropriate to assess the model's performance in identifying the minority class (churners)?
- Recall (Sensitivity) (Correct answer)
- Specificity
- Mean Squared Error (MSE)
- Accuracy
Correct answer: Recall (Sensitivity)
In imbalanced datasets, accuracy can be misleading. A model could achieve high accuracy by simply predicting the majority class for all instances. Recall, or Sensitivity, measures the model's ability to correctly identify all relevant instances of the positive class (churners in this case). It is calculated as TP / (TP + FN), making it crucial when the cost of false negatives (failing to identify a churner) is high.
Question 37: A research team wants to test if a new employee wellness program *improves* productivity scores. The null hypothesis is that the program has no effect on productivity. The team is only interested in whether the program leads to an increase, not a decrease. Which type of test is most appropriate?
- An F-test, to compare the variances of the two groups.
- A chi-squared test, because the outcome is categorical.
- A two-tailed test, to see if there is any difference in either direction.
- A one-tailed test, because the hypothesis is directional. (Correct answer)
Correct answer: A one-tailed test, because the hypothesis is directional.
A one-tailed test is used when the alternative hypothesis specifies a direction (e.g., greater than or less than). Since the team is specifically testing for an *improvement* (an increase in scores), a one-tailed test is appropriate. A two-tailed test would be used if they were testing for *any* difference, either positive or negative.
Question 38: A violin plot combines features of which two visualizations?
- Histogram and scatter plot
- Heatmap and box plot
- Box plot and kernel density estimate (Correct answer)
- Bar chart and line chart
Correct answer: Box plot and kernel density estimate
A violin plot shows a box plot inside a mirrored kernel density estimate, providing both summary statistics and the full distribution shape.
Question 39: What is the primary function of a pooling layer in a Convolutional Neural Network?
- Adding more learnable parameters
- Connecting all neurons to the output layer
- Applying a non-linear activation function
- Downsampling feature maps to reduce spatial dimensions and computation (Correct answer)
Correct answer: Downsampling feature maps to reduce spatial dimensions and computation
Pooling layers (e.g., max pooling) reduce the height and width of feature maps by aggregating values in local regions, decreasing computation and providing some translation invariance.
Question 40: Which type of map visualization is best suited for showing a continuous variable (e.g., population density) distributed across geographic regions?
- Bubble map
- Flow map
- Dot density map
- Choropleth map (Correct answer)
Correct answer: Choropleth map
A choropleth map shades geographic regions by intensity of a variable, making spatial patterns in continuous data (like income or population density) immediately visible.
Question 41: Which statistical test is most commonly used to check whether a time series is stationary by testing for a unit root?
- Augmented Dickey-Fuller (ADF) test (Correct answer)
- Chi-square test
- Shapiro-Wilk test
- F-test
Correct answer: Augmented Dickey-Fuller (ADF) test
The Augmented Dickey-Fuller test checks for a unit root in a time series; failing to reject the null hypothesis indicates the series is non-stationary.
Question 42: What does the Variance Inflation Factor (VIF) measure in feature selection?
- The degree to which a feature's variance is explained by other features, indicating multicollinearity (Correct answer)
- The ratio of between-class variance to within-class variance
- The variance of a single feature relative to the target
- The proportion of variance captured by each principal component
Correct answer: The degree to which a feature's variance is explained by other features, indicating multicollinearity
VIF quantifies how much a feature's variance is inflated due to correlation with other features; VIF > 10 typically signals severe multicollinearity.
Question 43: What is the key advantage of using pre-trained contextual embeddings (like those from BERT) over static word embeddings (like word2vec)?
- They produce different representations for the same word in different contexts (Correct answer)
- They eliminate the need for tokenization
- They require less computational memory
- They only need character-level input
Correct answer: They produce different representations for the same word in different contexts
Contextual embeddings dynamically encode a word's meaning based on its surrounding context, addressing polysemy that static embeddings cannot.
Question 44: Which linkage criterion in hierarchical clustering tends to produce compact, spherical clusters?
- Single linkage
- Ward linkage (Correct answer)
- Complete linkage
- Average linkage
Correct answer: Ward linkage
Ward linkage minimizes the total within-cluster variance at each merge step, consistently producing compact and similarly-sized clusters.
Question 45: Which technique is used in word2vec to predict surrounding context words given a target word?
- CBOW
- FastText
- GloVe
- Skip-gram (Correct answer)
Correct answer: Skip-gram
Skip-gram predicts surrounding context words given a center/target word, while CBOW does the opposite.
Data Science Exam
The Data Science Examination (DSE) evaluates proficiency in computer science, mathematics, and statistics for data science professionals, administered by Pearson VUE.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds