Practice
1. When training a deep neural network, which approach is more suitable to mitigate the vanishing gradient problem?
medium
Solution
Step 1: Identify methods to mitigate vanishing gradients
ReLU activation functions help mitigate the vanishing gradient problem by maintaining gradients through layers.Step 2: Eliminate wrong options
Use a very small learning rate. is incorrect because a small learning rate doesn't address vanishing gradients. Increase the number of layers. exacerbates the problem. Use L2 regularization. is unrelated to gradient flow.Final Answer:
Option D -> Option DQuick Check:
ReLU helps maintain gradients. [OK]
Hint: ReLU helps maintain gradients. [OK]
Common Mistakes:
2. A K-Means model is not converging on a dataset. What is the most likely cause?
medium
Solution
Step 1: Identify convergence issues
Centroids initialized too close can cause slow convergence or getting stuck in local minima.Step 2: Eliminate other causes
Too many clusters can cause overfitting but not convergence issues. Data normalization affects distance calculation but not convergence. Euclidean distance is standard for K-Means.Final Answer:
Option A -> Option AQuick Check:
Close centroids = slow convergence [OK]
Hint: Close centroids = slow convergence [OK]
Common Mistakes:
3. When deciding between offline and online evaluation for a new feature in a web application, which approach is more suitable if user feedback is critical and why?
medium
Solution
Step 1: Identify the need for user feedback.
When user feedback is critical, capturing real interactions is essential.Step 2: Evaluate the suitability of each approach.
Offline evaluation, because it allows for controlled experiments. is incorrect because controlled experiments do not capture real-time feedback. Offline evaluation, because it is faster and less resource-intensive. is incorrect because speed and resource usage do not address feedback needs. Online evaluation, because it avoids overfitting to historical data. is partially correct but does not emphasize feedback.Final Answer:
Option B -> Option BQuick Check:
Real feedback needs online evaluation. [OK]
Hint: Real feedback needs online evaluation. [OK]
Common Mistakes:
4. You are working with a neural network on a dataset with features on vastly different scales. Which scaling method should you apply and why?
hard
Solution
Step 1: Consider the effect of feature scaling on neural networks.
Neural networks can benefit from standardized inputs as they handle different scales better.Step 2: Choose the appropriate scaling method.
Standardization is preferred for neural networks as it centers data and scales by variance, which helps in convergence.Final Answer:
Option B -> Option BQuick Check:
Standardize for neural networks, handles scales better. [OK]
Hint: Standardize for neural networks, handles scales better. [OK]
Common Mistakes:
5. You are tasked with deploying a real-time fraud detection system. Which approach would you choose to handle class imbalance effectively without significantly increasing latency?
hard
Solution
Step 1: Consider latency constraints.
Real-time systems require low-latency solutions.Step 2: Evaluate focal loss.
Focal loss can be integrated into the model without affecting real-time processing speed.Final Answer:
Option C -> Option CQuick Check:
Focal loss suits real-time needs. [OK]
Hint: Focal loss suits real-time needs. [OK]
Common Mistakes:
