Understand the four ML ideas every AI interview starts with, explain them in plain words, and handle follow-up questions with confidence.
⏱ 10 min🎯 Freshers & career switchers🧪 4 hands-on drills
Your lab progress0 of 4 drills done
Spot itDecodeBuildTest
Almost every AI or ML interview, from campus placements to senior roles, starts with the basics. Interviewers ask about supervised learning, data splits and overfitting because these ideas show whether you understand how a model learns, or only know library function names.
In this lab you will learn each idea with an everyday analogy first, then the correct technical meaning. By the end, you can explain the bias-variance tradeoff clearly and spot overfitting from just two numbers.
The big idea: Learn, Check, Balance
Every good ML answer follows the life of a model. Explain it in this order.
Step 1
FRAME 1
Learn
The model finds patterns in data, with or without labels.
Step 2
FRAME 2
Check
Test it on data it has never seen before.
Step 3
FRAME 3
Balance
Not too simple, not too complex: control bias and variance.
A model is only as good as its score on data it has never seen.
Drill 1 · Spot it
Spot the difference
Same question: “What is overfitting?” Switch between the two answers and watch what changes.
Overfitting is when the model is fitting too much. Basically if accuracy is very high, like 99%, then it is overfitting. To fix it we can train for more epochs or use a bigger model. I think it happens mostly in deep learning only. Also we can skip the test data and train on everything, so the model learns better.
✕ Explains the word by repeating the word
✕ High accuracy alone does not prove overfitting
✕ Suggests fixes that make overfitting worse
Overfitting is when a model memorises the training data, including its noise, instead of learning the general pattern. You can spot it when training accuracy is high but validation or test accuracy is much lower, for example 98% versus 75%. To fix it, I would add more data, simplify the model, use regularisation like L2 or dropout, or use early stopping, and confirm with cross-validation.
LearnCheckBalance
✓ Clear definition that names the cause (noise)
✓ Shows how to detect it with a train vs test gap
✓ Gives several correct, practical fixes
Drill 2 · Decode
Quick concept check
Tap each card to flip it.
Key concepts, explained simply
Analogy first, then the real technical meaning. Interviewers want both.
Supervised learningLike learning with a teacher who gives you the answers. The model trains on labelled examples, where each input has the correct output. Regression predicts a number (house price); classification predicts a category (fraud or not fraud).
Unsupervised learningLike sorting a mixed box of buttons when nobody tells you the groups. The model finds structure in unlabelled data. Common examples are K-means clustering and PCA, which reduces many features to a few.
Train, validation, testPractice questions, mock test, final exam. The training set teaches the model, the validation set helps you tune settings (hyperparameters), and the test set is used once at the end for an honest score.
Overfitting vs underfittingOverfitting is a student who memorised last year’s paper; underfitting is one who barely studied. An overfit model has low training error but high test error. An underfit model has high error on both.
Bias-variance tradeoffBias is error from a model that is too simple. Variance is error from a model that is too sensitive to its training data. Adding complexity usually lowers bias but raises variance, so you pick the point with the lowest validation error.
Cross-validationLike judging a student on five mock tests instead of one. In k-fold cross-validation the data is split into k parts; the model trains on k−1 parts and validates on the remaining part, k times, and you average the scores.
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.tree import DecisionTreeClassifier
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42) # 80/20 split
model = DecisionTreeClassifier(max_depth=4) # limit depth to fight overfitting
print(cross_val_score(model, X_train, y_train, cv=5).mean()) # 5-fold CV
model.fit(X_train, y_train)
print(model.score(X_train, y_train), model.score(X_test, y_test)) # compare the gap
💡 Always compare training and test scores side by side. A big gap means overfitting; both scores low means underfitting.
Drill 3 · Build
Build your answer: explain a concept
Fill the blanks. Your answer writes itself on the right.
Your answer
Start typing on the left and your answer will appear here.
Each one explains the idea, gives an example and shows you have used it. Swap in your own project.
“Supervised learning uses labelled data, where every input has a correct answer. For example, predicting whether a loan will default using past loans marked yes or no. Unsupervised learning has no labels, so the model finds structure on its own, like K-means grouping shoppers by buying habits. In my college project I used clustering to find customer groups, and then a classifier to predict the group of a new customer.”
“Overfitting is when a model learns the training data too closely, including the noise, so it performs badly on new data. In my project, a decision tree had 99% training accuracy but only 78% on the test set. I limited the tree depth, chose the depth using 5-fold cross-validation, and the gap between training and test scores became much smaller.”
“Bias is error from overly simple assumptions, like fitting a straight line to a curved pattern. Variance is error from being too sensitive to the training data, so small changes in the data change the model a lot. As model complexity increases, bias usually falls and variance rises. I choose the complexity where validation error is lowest, and I use regularisation to keep variance under control.”
Four mistakes that make interviewers doubt you
Calling high accuracy ‘good’If only 1% of transactions are fraud, always predicting ‘not fraud’ gives 99% accuracy. Mention precision, recall or F1 too.
Tuning on the test setIt leaks information and gives a fake high score. Tune with a validation set or cross-validation, and use the test set once.
Fitting the scaler on all dataThis is data leakage. Fit preprocessing steps on the training data only, then apply them to the test data.
Only naming libraries‘I used scikit-learn’ is not an explanation. Explain the idea first, then mention the tool.
Drill 4 · Test
Test yourself
Question 1 of 5
Grouping customers with no labels is…Supervised learningReinforcement learningUnsupervised learning
Train accuracy 98%, test accuracy 70%. This is…OverfittingUnderfittingA perfect model
Which of these helps reduce overfitting?Training for many more epochsRegularisation, like L2 or dropoutRemoving the test set
High bias usually means the model is…Too complexPerfectly balancedToo simple
Why keep a separate validation set?To make training fasterTo tune settings without touching the test setTo create more labels
🏅
Rehearse before the real thing
Press start and explain overfitting out loud, with one analogy and one fix. The ring turns amber at 60 seconds and red at 90.
Interview Lab · 05
ML basics in 4 lines
1Labels = supervised learning
2Test on data never seen
3Big train-test gap = overfit
★Balance bias and variance
worldremotejobs.com@keshav_consults
Screenshot it. Save it. Share it.
Keep this card on your phone and look at it five minutes before your interview.
Deep learning is a part of machine learning that uses neural networks with many layers. The same basics still apply: data splits, overfitting and bias-variance.
What split ratio should I mention?
80/20 or 70/30 is common, plus a validation set or cross-validation. Add that it depends on data size: with very large datasets, a smaller test share can be enough.
What is a parameter vs a hyperparameter?
Parameters are learned from data during training, like the weights of a model. Hyperparameters are set by you before training, like learning rate, tree depth or k in k-NN, and are tuned on validation data.
Do I need heavy maths for a fresher ML interview?
You need clear intuition and basics: mean, variance, probability, simple linear algebra, and what a loss function and gradient descent do. Practise explaining them in words, not only formulas.
One Comment