MS Master of Data Science 4 — Questions and Answers
Question 1: Which Python library provides the DataFrame abstraction and is the de facto standard for tabular data manipulation in data science?
- NumPy
- SciPy
- pandas (Correct answer)
- Matplotlib
Correct answer: pandas
pandas provides the DataFrame and Series data structures along with powerful data manipulation tools, making it the standard for tabular data work in Python.
Question 2: In gradient descent, what happens when the learning rate is set too high?
- Training converges very slowly
- The loss decreases monotonically but takes longer
- The optimizer may overshoot the minimum and diverge (Correct answer)
- The model underfits by ignoring features
Correct answer: The optimizer may overshoot the minimum and diverge
A learning rate that is too large causes the optimizer to take steps that overshoot the loss minimum, potentially causing oscillation or divergence.
Question 3: What is the primary difference between supervised and unsupervised learning?
- Supervised learning uses neural networks; unsupervised uses decision trees
- Supervised learning trains on labeled data; unsupervised finds patterns in unlabeled data (Correct answer)
- Supervised learning requires GPUs; unsupervised runs on CPUs
- Supervised learning is faster; unsupervised is more accurate
Correct answer: Supervised learning trains on labeled data; unsupervised finds patterns in unlabeled data
Supervised learning uses input-output pairs with known labels to learn a mapping, while unsupervised learning discovers hidden structure in data without labels.
Question 4: A data pipeline fails intermittently due to race conditions when multiple processes write to the same file. What is the best solution?
- Increase file write timeouts
- Implement file locking or use an atomic write pattern (Correct answer)
- Retry failed writes indefinitely
- Convert the file to a different format
Correct answer: Implement file locking or use an atomic write pattern
File locking or atomic writes (write to temp file then rename) prevent race conditions by ensuring only one process modifies a file at a time.
Question 5: In the context of recommendation systems, what is collaborative filtering?
- Filtering recommendations based on content keywords
- Recommending items based on the preferences of similar users (Correct answer)
- Using demographic data to filter irrelevant items
- Collaborating with content editors to curate recommendations
Correct answer: Recommending items based on the preferences of similar users
Collaborative filtering identifies users with similar behavior patterns and recommends items that similar users have liked, without needing item content features.
Question 6: What does ACID stand for in database transactions, and which property ensures data survives system crashes?
- Atomicity, Consistency, Isolation, Durability; Durability ensures persistence after crashes (Correct answer)
- Accuracy, Concurrency, Integrity, Distribution; Integrity prevents data loss
- Atomicity, Correctness, Indexing, Durability; Atomicity ensures crash recovery
- Availability, Consistency, Isolation, Durability; Availability prevents data loss
Correct answer: Atomicity, Consistency, Isolation, Durability; Durability ensures persistence after crashes
ACID stands for Atomicity, Consistency, Isolation, Durability; Durability guarantees that committed transactions persist even after system failures.
Question 7: Which dimensionality reduction technique maximizes variance in the projected space and is commonly used for exploratory data analysis?
- Linear Discriminant Analysis (LDA)
- t-SNE
- Principal Component Analysis (PCA) (Correct answer)
- Autoencoders
Correct answer: Principal Component Analysis (PCA)
PCA finds orthogonal axes (principal components) that maximize variance, providing an unsupervised linear projection ideal for exploratory analysis and visualization.
Which Python library provides the DataFrame abstraction and is the de facto standard for tabular data manipulation in data science?