Sample questions
Question 1Easy
Min-max scaling transforms a feature to the range
- -1 to 1 always
- Mean 0 and standard deviation 1
- 0 to 100
- 0 to 1
Answer: D. 0 to 1
Explanation
x' = (x - min)/(max - min) places the minimum at 0 and the maximum at 1.
Step-by-step solution
- Subtract min.
- Divide by the range.
- Output lies in [0, 1].
Why the other options are wrong
- A. That needs a different formula such as scaling to [-1,1].
- B. That is standardisation (z-score).
- C. Only if explicitly rescaled.
Question 2Easy
Which encoding turns a categorical column like colour (red, green, blue) into binary columns?
- Min-max scaling
- Log transform
- Principal component analysis
- One-hot encoding
Answer: D. One-hot encoding
Explanation
One-hot creates one 0/1 column per category so no false order is implied.
Step-by-step solution
- List the categories.
- One column per category.
- Mark 1 where it applies.
Why the other options are wrong
- A. Scaling applies to numeric values.
- B. Log transforms are for skewed numeric values.
- C. PCA reduces numeric features.
Question 3Easy
Why is one-hot encoding preferred over label encoding (0,1,2) for a nominal feature in linear models?
- Label encoding implies an order and distance that does not exist
- One-hot uses less memory
- Label encoding cannot be inverted
- One-hot removes the need for scaling in every other column of the data
Answer: A. Label encoding implies an order and distance that does not exist
Explanation
A linear model would treat blue (2) as twice green (1), inventing a relationship.
Step-by-step solution
- Codes 0,1,2 look like numbers.
- Model reads them as ordered.
- One-hot avoids that.
Why the other options are wrong
- B. One-hot usually uses more memory.
- C. It can be inverted.
- D. Scaling needs are independent of encoding.
Question 4Easy
A feature has mean 50 and standard deviation 10. The z-score of the value 65 is
- 15
- 0.15
- 1.5
- 6.5
Answer: C. 1.5
Explanation
z = (65 - 50)/10 = 1.5.
Step-by-step solution
- x - mean = 15.
- Divide by std 10.
- z = 1.5.
Why the other options are wrong
- A. This is only the difference from the mean (65-50).
- B. Divides by 100 instead of by the standard deviation.
- D. Divides the raw value by the standard deviation only.
Question 5Medium
Fitting a scaler on the full dataset before splitting into train and test causes
- underfitting
- higher bias
- data leakage
- faster convergence with no side effect
Answer: C. data leakage
Explanation
Test-set statistics influence the training transform, so the evaluation becomes optimistic. Fit on the training data only.
Step-by-step solution
- A scaler fitted on the full dataset learns the mean and spread using the test rows too.
- The test data then influences training, so the test score looks better than it really is.
- This is data leakage, option C.
Why the other options are wrong
- A. Leakage does not make the model underfit; it makes results look better than they are.
- B. Bias is not what changes here; the problem is that test information leaks into training.
- D. Leakage always gives misleading results, so there is no side-effect-free case.
Tip: Fit preprocessing (scalers, imputers) on the training split only, then apply it to the test split.
Question 6Medium
Which scaler is least affected by outliers?
- Robust scaling using median and interquartile range
- Min-max scaling
- Scaling by the maximum
- Mean-only centring that subtracts the average but does not rescale
Answer: A. Robust scaling using median and interquartile range
Explanation
Median and IQR hardly move when a few extreme values appear.
Step-by-step solution
- Outliers shift min, max and mean.
- Median and IQR are rank-based.
- So robust scaling is stable.
Why the other options are wrong
- B. One extreme value stretches the range.
- C. Extremes control the max.
- D. The mean is sensitive to outliers.
Question 7Medium
A feature has values 10, 20, 30, 40, 50. After min-max scaling, the value 20 becomes
- 0.25
- 0.2
- 0.5
- 0.4
Answer: A. 0.25
Explanation
(20 - 10)/(50 - 10) = 10/40 = 0.25.
Step-by-step solution
- Min = 10, max = 50.
- Numerator 20-10 = 10.
- 10/40 = 0.25.
Why the other options are wrong
- B. Divides by the max (50) instead of the range.
- C. That is the scaled value of 30.
- D. That is 20/50, ignoring the min subtraction.
Question 8Medium
Min-max scaling maps x = 30 in the range [10, 50] to
- 0.6
- 0.3
- 30
- 0.5
Answer: D. 0.5
Explanation
(30-10)/(50-10) = 20/40 = 0.5.
Step-by-step solution
- Min-max scaling formula is (x - min) / (max - min).
- Plug in x = 30, min = 10, max = 50: (30 - 10) / (50 - 10).
- Calculate numerator: 30 - 10 = 20.
- Calculate denominator: 50 - 10 = 40.
- Divide 20 by 40: 20 / 40 = 0.5.
Why the other options are wrong
- A. 0.6 would need x = 34; with min 10 and max 50, x = 30 gives (30 - 10) / 40 = 0.5.
- B. 0.3 is not 20 divided by 40; that division gives 0.5.
- C. 30 is the raw value; min-max scaling maps it into the range 0 to 1, giving 0.5.
Tip: Use formula (x - min)/(max - min) for any min-max scaling question.
Question 9Medium
A column has 20% missing values. Which approach keeps all rows and is commonly used first for a numeric column?
- Delete the column in every case
- Impute with the median
- Fill with the label of the row
- Replace with the maximum value
Answer: B. Impute with the median
Explanation
Median imputation keeps rows and is robust to outliers, unlike the mean.
Step-by-step solution
- Choose a robust statistic.
- Median is not pulled by outliers.
- Fit it on training data only.
Why the other options are wrong
- A. Sometimes valid, but it loses all information.
- C. That leaks the target.
- D. Biases the feature upwards.
Tip: Fit imputers on train only to avoid leakage.
Question 10Hard
Which is the main risk of applying SMOTE (synthetic minority oversampling) to the whole dataset before a train-test split?
- It deletes minority samples
- It changes the number of features
- It makes the model underfit by definition because the classes change
- Synthetic points built from test rows leak into training
Answer: D. Synthetic points built from test rows leak into training
Explanation
Oversample only the training fold; otherwise synthetic samples derived from test examples inflate scores.
Step-by-step solution
- Split data first.
- Apply SMOTE on train only.
- Evaluate on untouched test data.
Why the other options are wrong
- A. SMOTE adds minority samples.
- B. The feature count stays the same.
- C. The issue is leakage, not underfitting.
Practise all 11 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →