Top AI Interview Questions with Answers

Artificial Intelligence (AI) is the branch of computer science that focuses on building machines or systems that can perform tasks that typically require human intelligence
1000942763.jpg

*1. What is Artificial Intelligence?*  

Artificial Intelligence (AI) is the branch of computer science that focuses on building machines or systems that can perform tasks that typically require human intelligence — such as understanding language, recognizing images, making decisions, and learning from data.

*2. Difference between AI, Machine Learning, and Deep Learning*  

- *AI*: The broad concept of machines simulating human intelligence.  

- *Machine Learning (ML)*: A subset of AI that enables systems to learn from data and improve over time without being explicitly programmed.  

- *Deep Learning (DL)*: A subfield of ML that uses neural networks with many layers to model complex patterns, especially in images, audio, and text.

*3. What is supervised vs. unsupervised learning?*  

- *Supervised Learning*: The model learns from labeled data. It is trained on input-output pairs.  

  *Example*: Predicting house prices from past data.  

- *Unsupervised Learning*: The model finds patterns in data without labels.  

  *Example*: Grouping customers based on buying behavior (clustering).

*4. Explain overfitting and underfitting*

- *Overfitting*: The model learns noise and details in the training data, performing poorly on new data.  

- *Underfitting*: The model is too simple to capture the data patterns and performs poorly on both training and testing data.  

*A good model generalizes well to unseen data.*

*5. What are classification and regression?*  

- *Classification*: Predicts discrete labels.  

  *Example*: Email spam detection (spam or not).  

- *Regression*: Predicts continuous values.  

  *Example*: Predicting stock price or temperature.

*6. What is a confusion matrix?*  

It’s a table used to evaluate the performance of a classification model by comparing predicted vs. actual results.  

It shows:  

- True Positives (TP)  

- True Negatives (TN)  

- False Positives (FP)  

- False Negatives (FN)

*7. Define precision, recall, F1-score*  

- *Precision* = TP / (TP + FP): How many predicted positives are correct.  

- *Recall* = TP / (TP + FN): How many actual positives are captured.  

- *F1-Score* = Harmonic mean of precision and recall.  

Useful when dealing with imbalanced datasets.

*8. What is the difference between batch and online learning?*  

- *Batch Learning*: The model is trained on the entire dataset at once.

- *Online Learning*: The model is updated incrementally as new data arrives — useful for real-time systems.

*9. Explain bias-variance tradeoff*  

- *Bias*: Error from incorrect assumptions (underfitting).  

- *Variance*: Error from model sensitivity to training data (overfitting).  

*Goal:* Find a balance to minimize total error.

*10. What are activation functions in neural networks?*  

Activation functions decide whether a neuron should fire. They introduce non-linearity into the network.  

Common ones:  

- ReLU: `max(0, x)`  

- Sigmoid: squashes values between 0 and 1  

- Tanh: squashes between -1 and 1