MS Master of Data Science 2 — Questions and Answers
Question 1: Which regularization technique adds the absolute value of coefficients as a penalty term, effectively performing feature selection by shrinking some coefficients to zero?
- Ridge (L2)
- Lasso (L1) (Correct answer)
- Elastic Net
- Dropout
Correct answer: Lasso (L1)
Lasso (L1) regularization uses the absolute value of coefficients as the penalty, which drives some coefficients to exactly zero, performing automatic feature selection.
Question 2: In the context of A/B testing, what does statistical power represent?
- The probability of a Type I error
- The probability of rejecting a true null hypothesis
- The probability of correctly detecting a true effect (Correct answer)
- The minimum detectable effect size
Correct answer: The probability of correctly detecting a true effect
Statistical power (1 - β) is the probability of correctly rejecting a false null hypothesis, i.e., detecting a real effect when one exists.
Question 3: A data scientist needs to join two large Spark DataFrames where one is small enough to fit in memory. Which join strategy minimizes shuffle overhead?
- Sort-merge join
- Broadcast join (Correct answer)
- Hash join
- Nested loop join
Correct answer: Broadcast join
A broadcast join sends the smaller DataFrame to all worker nodes, eliminating the expensive shuffle operation required by sort-merge joins.
Question 4: Which theorem states that a feedforward neural network with a single hidden layer can approximate any continuous function to arbitrary precision given enough neurons?
- Bayes' theorem
- No free lunch theorem
- Universal approximation theorem (Correct answer)
- Central limit theorem
Correct answer: Universal approximation theorem
The universal approximation theorem guarantees that a single hidden layer network with sufficient neurons can approximate any continuous function on a compact subset.
Question 5: In SQL window functions, what is the difference between RANK() and DENSE_RANK()?
- RANK() is faster; DENSE_RANK() is more accurate
- RANK() skips numbers after ties; DENSE_RANK() does not skip numbers (Correct answer)
- DENSE_RANK() requires an ORDER BY; RANK() does not
- They are identical in behavior
Correct answer: RANK() skips numbers after ties; DENSE_RANK() does not skip numbers
RANK() leaves gaps after tied values (e.g., 1,1,3), while DENSE_RANK() assigns consecutive ranks without gaps (e.g., 1,1,2).
Question 6: Which distance metric is most appropriate for comparing documents represented as term frequency vectors where magnitude should be ignored?
- Euclidean distance
- Manhattan distance
- Cosine similarity (Correct answer)
- Hamming distance
Correct answer: Cosine similarity
Cosine similarity measures the angle between vectors regardless of magnitude, making it ideal for document comparison where document length varies.
Question 7: What is the primary purpose of the 'explain' command when used with a database query?
- To display column definitions and data types
- To show the query execution plan chosen by the optimizer (Correct answer)
- To validate SQL syntax before execution
- To return sample rows from the result set
Correct answer: To show the query execution plan chosen by the optimizer
EXPLAIN reveals the query execution plan, showing how the database optimizer will access tables, use indexes, and join relations.
Which regularization technique adds the absolute value of coefficients as a penalty term, effectively performing feature selection by shrinking some coefficients to zero?