# Top 20 Machine Learning Viva Questions for Engineering Students
Defending a Machine Learning or Artificial Intelligence project requires more than just showing that your code runs. External examiners will aggressively test your fundamental understanding of the algorithms, mathematics, and data preprocessing techniques you used.
Here is a deeply technical guide to the most commonly asked ML viva questions.
## Data Preprocessing & Fundamentals
### 1. How did you handle missing values in your dataset?
**Genuine Answer:** "Dropping rows with missing values results in data loss. Instead, I used imputation techniques. For numerical columns, I imputed using the median (which is robust to outliers) rather than the mean. For categorical columns, I used mode imputation or created a separate 'Unknown' category."
### 2. What is the Curse of Dimensionality?
**Genuine Answer:** "As the number of features (dimensions) in the dataset increases, the volume of the feature space grows exponentially, making the data sparse. This causes distance-based algorithms like KNN to fail because the distance between any two points becomes almost equal. I solved this by using PCA (Principal Component Analysis) to reduce dimensions while retaining 95% of the variance."
### 3. Why did you use One-Hot Encoding instead of Label Encoding?
**Genuine Answer:** "Label encoding assigns integers (1, 2, 3) to categories. Algorithms might misinterpret this as an ordinal relationship (meaning 3 is greater than 1). One-Hot encoding creates separate binary columns for each category, preventing the model from assuming false mathematical hierarchies in nominal data like 'City Names'."
## Algorithms & Models
### 4. Explain the Bias-Variance Tradeoff.
**Genuine Answer:** "Bias is the error from overly simplistic assumptions in the learning algorithm (Underfitting). Variance is the error from sensitivity to small fluctuations in the training set (Overfitting). The goal is to find the sweet spot. A Decision Tree has low bias but high variance, while Linear Regression has high bias but low variance."
### 5. Why use Random Forest instead of a single Decision Tree?
**Genuine Answer:** "Decision Trees are highly prone to overfitting because they create deep, complex splits perfectly tailored to the training data. Random Forest is an ensemble method (Bagging). It builds multiple shallow trees on random subsets of data and features, and averages their predictions, drastically reducing variance."
### 6. What is the difference between Gradient Boosting (XGBoost) and Random Forest?
**Genuine Answer:** "Random Forest builds trees independently and in parallel (Bagging). Gradient Boosting builds trees sequentially, where each new tree specifically tries to correct the residual errors made by the previous trees (Boosting). XGBoost is generally more accurate but prone to overfitting if not tuned properly."
## Evaluation Metrics
### 7. Why didn't you just use Accuracy to evaluate your classification model?
**Genuine Answer:** "My dataset was imbalanced (e.g., 99% normal transactions, 1% fraud). A model that always predicts 'normal' would have 99% accuracy but would be completely useless. Instead, I used the **F1-Score**, which is the harmonic mean of Precision and Recall, to accurately measure performance on the minority class."
### 8. What is the ROC-AUC Curve?
**Genuine Answer:** "The Receiver Operating Characteristic curve plots the True Positive Rate against the False Positive Rate at various classification thresholds. The AUC (Area Under the Curve) provides an aggregate measure of performance. An AUC of 1.0 is perfect, 0.5 is random guessing. It helps visualize how well the model separates the classes."
## Deep Learning & Neural Networks
### 9. What happens if you don't use an Activation Function?
**Genuine Answer:** "Without non-linear activation functions (like ReLU or Sigmoid), a deep neural network behaves exactly like a single-layer linear regression model. No matter how many layers you stack, the output will always be a linear combination of the input. Activation functions allow the network to learn complex, non-linear boundaries."
### 10. How did you prevent Overfitting in your Neural Network?
**Genuine Answer:** "I implemented two main techniques: **Dropout**, which randomly turns off a percentage of neurons during training to prevent co-adaptation, and **Early Stopping**, which monitors the validation loss and halts training when the loss starts increasing, preventing the model from memorizing the training data."
---
### Ace Your Presentation!
If you bought your final year project from **Cybotyx Labs**, remember that we offer extensive 1-on-1 code explanation sessions. We will walk you through your exact architecture so you can face the external examiner with complete confidence.