Machine Learning Quiz: 60 MCQs with Answers on Algorithms and Evaluation
Test your machine learning knowledge: types of learning, data preparation and leakage, core algorithms, evaluation metrics, cross-validation, the bias–variance trade-off, regularisation, tuning and imbalanced data, with scikit-learn examples.

Machine Learning Quiz
60 questions · 7 topics · timer · instant explanations · printable mark sheet.
- Questions60 in the bank, 10–30 per attempt
- Levels20 easy · 24 medium · 16 hard
- TimeAbout 5–20 minutes
- PriceFree, no login needed
- Made byDr. Aammar Tufail, Codanics
- Updated18 November 2026
In short: the Machine Learning Quiz is a free online multiple-choice quiz by Codanics with 60 questions on types of learning; data preparation; core algorithms; model evaluation metrics; overfitting and regularisation; validation and tuning; and imbalanced data and MLOps. You choose the number of questions and the difficulty, answer against a timer, see an explanation after every answer and finish with a printable mark sheet.
What the Machine Learning Quiz covers
Machine learning interviews rarely ask you to write an algorithm from scratch. They ask whether you know which model to use, how to evaluate it honestly and why it overfits. That is exactly what this quiz tests.
It includes scikit-learn code and metric calculations, checked by running them, plus conceptual questions on precision versus recall, ROC-AUC, cross-validation and regularisation.
- Types of learning 7 questions
- Data preparation 10 questions
- Core algorithms 13 questions
- Model evaluation metrics 9 questions
- Overfitting and regularisation 8 questions
- Validation and tuning 7 questions
- Imbalanced data and MLOps 6 questions
Who it is for: Data science and AI students, bootcamp learners and anyone preparing for a machine learning or data scientist interview.
How the quiz works
- Type your name if you want it printed on the mark sheet (optional; it never leaves your browser).
- Choose 10, 20 or 30 questions, a difficulty (Easy, Mixed or Hard) and the timer: Standard, Relaxed or none.
- Answer each question before the timer runs out. Press A–D or 1–4 on a keyboard, or tap an option on your phone.
- Read the explanation after every answer, then press Next.
- At the end, get your score, grade, topic-wise breakdown and a full answer review. Print it or save it as a PDF.
- Retake the quiz for a fresh random set, or practise only the topics you found hard.
Free video lessons from Codanics
Score lower than you hoped? These free lessons from the Codanics YouTube channel cover the same topics, explained step by step.
Free on the Codanics YouTube channel, taught in Urdu/Hindi.
Sample questions with answers
Here are 9 questions from the bank, with answers and explanations. The quiz above draws from all 60.
1. A model learns from emails that are already labelled 'spam' or 'not spam'. What type of learning is this?
- Supervised learning
- Unsupervised learning
- Reinforcement learning
- Self-organising learning
Answer: A. Supervised learning
The training data contains the correct answer (label) for every example, which is the defining feature of supervised learning.
2. Why do we split data into training and test sets?
- To estimate how the model performs on unseen data
- To make the training process run faster
- To increase the total amount of training data
- To remove outliers from the dataset
Answer: A. To estimate how the model performs on unseen data
The test set is held back so we can measure generalisation. Scoring on the training data gives an over-optimistic estimate.
3. What does this code print? (X = [[10], [20], [30]])
from sklearn.preprocessing import MinMaxScaler
X = [[10], [20], [30]]
print(MinMaxScaler().fit_transform(X).ravel())- [-1. 0. 1.]
- [10. 20. 30.]
- [0.33 0.67 1. ]
- [0. 0.5 1. ]
Answer: D. [0. 0.5 1. ]
MinMaxScaler maps the minimum to 0 and the maximum to 1: (x – 10) / (30 – 10) gives 0, 0.5 and 1.
4. Which algorithm is mainly used for binary classification, despite having 'regression' in its name?
- Linear regression
- Ridge regression
- Polynomial regression
- Logistic regression
Answer: D. Logistic regression
Logistic regression passes a linear score through the sigmoid function to output a probability between 0 and 1, which is then turned into a class.
5. Recall (sensitivity) answers which question?
- Of all predicted positives, how many were right?
- Of all actual positives, how many did we find?
- Of all predictions, how many were right?
- Of all actual negatives, how many did we find?
Answer: B. Of all actual positives, how many did we find?
Recall = TP / (TP + FN). Precision is the one about predicted positives: TP / (TP + FP).
6. A classifier has TP = 30, FP = 10, FN = 20 and TN = 40. What is its precision?
- 0.75
- 0.60
- 0.70
- 0.80
Answer: A. 0.75
Precision = TP / (TP + FP) = 30 / 40 = 0.75. Recall would be 30 / 50 = 0.60.
7. A model scores 99% on training data but 65% on test data. What is this called?
- Overfitting
- Underfitting
- Regularisation
- Data augmentation
Answer: A. Overfitting
A large gap between training and test performance means the model memorised noise in the training data and does not generalise.
8. In this pipeline, how do you name the C parameter of the logistic regression inside GridSearchCV's param_grid? (pipe = Pipeline([)
from sklearn.pipeline import Pipeline
pipe = Pipeline([
('scale', StandardScaler()),
('clf', LogisticRegression())
])- 'clf.C'
- 'C'
- 'clf-C'
- 'clf__C'
Answer: D. 'clf__C'
Pipeline parameters use the step name, two underscores and the parameter name, so the key is 'clf__C'.
9. A loan model was accurate last year, but customer incomes and behaviour have shifted since. What is this called?
- Overfitting
- Data drift
- Data leakage
- Label encoding
Answer: B. Data drift
When the distribution of input data in production changes from the training data, it is data (covariate) drift. Monitoring catches it so the model can be retrained.
Free guides and blogs to study
Free tools for your studies and research
Codanics also has 160+ free online tools for students and researchers: statistics calculators, meta-analysis, PDF and writing tools. They run in your browser, with no login.
Frequently asked questions
Is the Machine Learning Quiz free?
Yes. The Machine Learning Quiz is completely free, with no sign-up, no login and no limit on attempts.
How many questions are in the Machine Learning Quiz?
The question bank has 60 multiple-choice questions (20 easy, 24 medium and 16 hard) across 7 topics. Each attempt draws 10, 20 or 30 of them at random, so every attempt is different.
How does the timer work?
Each question has its own countdown: about 25 seconds for easy, 40 for medium and 55 for hard questions, plus 15 seconds when there is code to read. Choose Relaxed to double the time or switch the timer off to study at your own pace. Unanswered questions count as skipped.
Can I get a certificate or mark sheet?
Yes. When you finish, you get a mark sheet with your name, score, grade, time, topic-wise performance and every answer explained. Use Print or save as PDF to keep it. It is a self-assessment result, not an official certificate.
Are the answers and explanations correct?
Every question was written and reviewed for one clearly correct answer, and code questions were checked by running the code. If you think an answer is wrong, tell us on the Codanics WhatsApp channel or in the YouTube comments and we will fix it.
Does the machine learning quiz include coding?
Yes, some questions show short scikit-learn code and ask what it does or returns. Most questions are conceptual so you can take the quiz without coding experience.
What level is the ML quiz?
Easy questions cover definitions, Mixed adds practical choices and metric calculations, and Hard covers interview-level topics such as leakage, regularisation and imbalanced data.
Is my data stored anywhere?
No. The quiz runs entirely in your browser. Your name, answers and score are not uploaded. Your best score and settings are remembered only in this browser so you can track your progress.
More free quizzes
See all Codanics quizzes → · Courses · Free tools · Blog



