MS-DS Master of Data science Master of Data Science 3 — Questions and Answers
Question 1: In Apache Spark, what is the key difference between a transformation and an action?
- Transformations run on the driver; actions run on workers
- Transformations are lazy and return RDDs; actions trigger execution and return results (Correct answer)
- Actions are faster than transformations
- Transformations always cache data in memory
Correct answer: Transformations are lazy and return RDDs; actions trigger execution and return results
Spark transformations (like map, filter) are lazy and only define a computation graph, while actions (like collect, count) trigger actual execution.
Question 2: Which technique is used to handle missing data by filling in plausible values based on observed data relationships?
- Listwise deletion
- Multiple imputation (Correct answer)
- Zero-fill
- Label encoding
Correct answer: Multiple imputation
Multiple imputation replaces missing values with several plausible estimates drawn from the observed data distribution, preserving statistical relationships.
Question 3: What is the primary purpose of the attention mechanism in transformer models?
- To reduce the number of model parameters
- To allow the model to weigh the importance of different tokens when encoding each token (Correct answer)
- To prevent overfitting through regularization
- To speed up matrix multiplication
Correct answer: To allow the model to weigh the importance of different tokens when encoding each token
The attention mechanism computes a weighted sum of value vectors, where weights reflect how relevant each position is to the current token being processed.
Question 4: In hypothesis testing, what does a p-value of 0.03 indicate?
- There is a 3% chance the alternative hypothesis is true
- There is a 3% chance of observing results this extreme if the null hypothesis is true (Correct answer)
- The effect size is 3% of the variance
- The study has a 97% confidence interval
Correct answer: There is a 3% chance of observing results this extreme if the null hypothesis is true
The p-value is the probability of obtaining a test statistic at least as extreme as observed, assuming the null hypothesis is true.
Question 5: Which data structure is most efficient for implementing a priority queue?
- Linked list
- Binary heap (Correct answer)
- Hash table
- Balanced BST
Correct answer: Binary heap
A binary heap supports O(log n) insert and extract-min/max operations, making it the standard choice for priority queue implementations.
Question 6: What is the role of the discriminator in a Generative Adversarial Network (GAN)?
- To generate synthetic data samples
- To classify whether a sample is real or generated (Correct answer)
- To encode data into a latent space
- To decode latent vectors into images
Correct answer: To classify whether a sample is real or generated
The discriminator is trained to distinguish real data samples from fake ones produced by the generator, providing the adversarial training signal.
Question 7: In dimensionality reduction, what does PCA maximize?
- Class separability
- Explained variance in the projected data (Correct answer)
- Reconstruction accuracy of individual samples
- Pairwise distances between all points
Correct answer: Explained variance in the projected data
PCA finds orthogonal components (principal components) that successively capture the maximum variance in the data.
In Apache Spark, what is the key difference between a transformation and an action?