What is Machine Learning? — ML Technical Interview Questions & Answers
Teaching computers to learn patterns from data instead of fixed rules.
What is Machine Learning?
- Simple meaning: Machine learning is when the computer learns a pattern from examples, instead of you writing a rule for every case. You do not type “if hours > 5 then pass” for 500 students. You show past hours and marks, and the model learns the pattern.
- Picture: A sheet with hours studied and marks. Asha 2 hours → 38. Kabir 6 hours → 79. A new student studied 4 hours. The model guesses marks from the pattern, not from a hand-written if.
- How you run it: collect rows → clean them → train on some rows → test on rows the model has not seen → look at a score (accuracy, RMSE). If the test score is weak, the pattern did not generalise.
- Trap: calling ML “AI magic”. Say: data → model → metric. Trap: testing on the same rows you trained on — that is cheating, not learning.
hours, marks → train → model
│
▼
new hours → guessed marksTechnical Interview Tip: Data → train → test → metric. Not a pile of ifs for every student.
Code Examples for What is Machine Learning?
What is Machine Learning? — working example
# Supervised idea: learn y from X
X = [[1], [2], [3], [4]]
y = [2, 4, 6, 8] # roughly y = 2x
def predict(x, w=2.0):
return w * x
preds = [predict(row[0]) for row in X]
mse = sum((yt - yp) ** 2 for yt, yp in zip(y, preds)) / len(y)
print(preds, mse)What is Machine Learning? — mL learns patterns from data. Start with features X, labels y, a model, and a metric like MSE/accuracy.
How to Explain What is Machine Learning? to an Interviewer
What is machine learning?
Learn a pattern from examples Predict on new rows Not hand-written rules for every case
What is the smallest pipeline?
Clean data Train Test on unseen rows Read a metric