Artificial intelligence and machine learning · Practice test · Updated November 2026
An AI and machine learning practice test checks whether you understand the core ideas behind modern AI: search, supervised and unsupervised learning, model evaluation, neural networks, reinforcement learning, NLP and generative AI, data preparation, and responsible AI and MLOps. No single official exam covers this whole syllabus, so a good practice test follows the topics that university courses and technical interviews for data science and ML roles expect. This guide explains what each of the nine topic areas tests and how to prepare in two to three weeks. It ends with 10 free practice questions with answers and explanations.
At a glance
| Topic | Artificial intelligence and machine learning |
| For | Students, aspiring data scientists, developers, ML engineers |
| Topic areas | Nine, from search to responsible AI and MLOps |
| Official exam | None: skills topic, not a certification |
| Exametics set | 6 practice tests, 240 questions |
| Free in this post | 10 practice questions with answers |
- Expect “why” questions: why a scaler leaks test data, or why accuracy hides a weak model on rare classes.
- Current topics include Transformers, RAG, LoRA, RLHF, drift monitoring, the EU AI Act and the NIST AI RMF.
Sources: scikit-learn common pitfalls, Sutton and Barto, Reinforcement Learning (2nd edition) and NIST AI Risk Management Framework. Checked on 9 November 2026.
What a good AI and machine learning practice test covers
A good AI and machine learning practice test covers the path from classic AI to deployed models: search, learning from data, honest evaluation and safe production use.
AI foundations and search
Search questions compare uninformed and informed search. The Berkeley CS188 notes on informed search define A* by the priority f(n) = g(n) + h(n): the cost so far plus the estimated cost to the goal.
- Admissible heuristic: an estimate that is never negative and never overestimates the true cost. With one, A* tree search returns an optimal solution.
- Greedy search: ranks nodes by the heuristic alone. The same notes say it is not guaranteed to find a goal and is not optimal.
Supervised learning
Supervised learning questions ask you to read a confusion matrix and choose the right metric. The scikit-learn model evaluation guide defines precision as tp / (tp + fp) and recall as tp / (tp + fn). F1 is the harmonic mean of the two. On imbalanced data, the same guide offers balanced accuracy, which avoids inflated scores when one class dominates.
Unsupervised learning
Unsupervised learning questions focus on clustering and dimensionality reduction. The scikit-learn clustering guide notes that k-means needs the number of clusters in advance, minimises within-cluster sum of squares (inertia) and assumes roughly convex, round clusters.
Model training and evaluation
This area tests whether you can trust a score. Google’s Machine Learning Crash Course warns that repeated tuning on test results makes the model fit the peculiarities of the test set.
- Overfitting: training loss keeps falling while validation loss rises.
- Cross-validation: the scikit-learn cross-validation guide trains on k − 1 folds, validates on the remaining fold and averages the scores. A test set should still be held out for the final check.
- Stratification: StratifiedKFold keeps roughly the same class percentages in every fold, which matters when one class is rare.
Neural networks and deep learning
Deep learning questions cover activation functions, backpropagation, regularisation and the main architectures: convolutional networks, recurrent networks and Transformers. Expect practical traps too: the PyTorch Dropout documentation explains that dropout zeroes activations with probability p during training, scales the rest by 1/(1 − p), and becomes an identity function in evaluation mode.
The Transformer gets its own questions. The original paper, Attention Is All You Need, describes an architecture based only on attention, with no recurrence or convolutions.
Reinforcement learning
Reinforcement learning (RL) questions use the vocabulary of agents, states, actions, rewards, policies and value functions. Sutton and Barto’s textbook sets up a classic comparison:
- Sarsa: on-policy control. It updates towards the value of the action the agent actually takes next.
- Q-learning: off-policy control (Watkins, 1989). It updates towards the best next action, so it learns the optimal action values regardless of the policy used to explore.
Also know the exploration-exploitation trade-off and the discount factor.
NLP and generative AI
NLP questions run from tokenisation to large language models. Generative AI questions ask how you adapt a model to a task:
- Retrieval-augmented generation (RAG): the original RAG paper pairs a pre-trained generator (parametric memory) with a dense vector index of documents (non-parametric memory). Updating the index updates what the system knows.
- LoRA: the LoRA paper freezes the pre-trained weights and trains small low-rank matrices. On GPT-3 175B it reports 10,000 times fewer trainable parameters than full fine-tuning with Adam.
- RLHF: the InstructGPT paper describes supervised fine-tuning on demonstrations, human rankings of outputs, then reinforcement learning from that feedback.
Data preparation
Data preparation questions test encoding, scaling and splitting. The scikit-learn preprocessing guide explains two key ideas. First, a feature with a much larger variance than the others can dominate the objective, so many models need standardised inputs. Second, integer codes for categories make a model treat them as ordered, so nominal categories are usually one-hot encoded.
The most important rule is about leakage. The scikit-learn common pitfalls guide says to split the data first and never call fit on the test data. Scalers, imputers and feature selection learn only from training data, and a Pipeline keeps each step inside the right fold during cross-validation.
Responsible AI and MLOps
For monitoring, Google Cloud’s Model Monitoring overview separates two problems. Training-serving skew means production data differs from the training data. Inference drift means production data changes significantly over time.
For governance, know the four core functions of the NIST AI Risk Management Framework: Govern, Map, Measure and Manage. The NIST AI RMF Core describes Govern as cross-cutting, supporting the other three. NIST released AI RMF 1.0 on 26 January 2023 for voluntary use and is now revising it.
For regulation, the European Commission’s AI Act page says the Act entered into force on 1 August 2024. The first eight prohibitions and AI literacy duties applied from 2 February 2025, and obligations for general-purpose AI models from 2 August 2025. The Act became generally applicable on 2 August 2026.
Watch out
EU AI Act dates moved in 2026. The Commission’s page says the AI Omnibus, in force since 27 July 2026, pushed the high-risk rules for Annex III use cases to 2 December 2027 and for Annex I products to 2 August 2028. It also added a ninth prohibition from December 2026.
Exametics practice tests
Artificial Intelligence and Machine Learning Practice Tests
- 6 practice tests with 40 questions each: 240 questions in total
- Rebuilt in 2026: half the questions are new and every answer key was checked
- Every answer explained, with a hint, and tagged with one of nine topic areas
- Timed Exam Mode test
- Lifetime access
30-day refund. Instant access after payment.
Who these AI and machine learning practice tests are for
These practice tests suit students before a university exam, aspiring data scientists and developers before a technical interview, and ML engineers who want to find gaps.
| Learner | How to use the practice tests |
|---|---|
| Students | Check each topic after lectures; take a timed test before the module exam. |
| Aspiring data scientists | Focus on supervised learning, evaluation and data preparation. |
| Software developers | Build vocabulary, then go deeper on NLP and generative AI. |
| ML engineers | Use deep learning, MLOps and responsible AI questions to find gaps. |
Is there an AI and machine learning certification?
There is no single official certification for the whole subject, and these practice tests are knowledge tests, not a copy of any vendor exam. Vendors offer machine learning certifications that also test their own services. If you plan one, read our guides to the AWS Machine Learning Engineer Associate exam and the Databricks Machine Learning Associate exam, or our overview of machine learning certification prep.
Next on your AI and machine learning path
- Machine Learning Fundamentals practice tests: a gentler start if you are new to models, metrics and data splits.
- Artificial Intelligence practice tests: go deeper on classic AI such as search, logic and planning.
- Natural Language Processing (NLP) practice tests: more practice on tokenisation, Transformers and LLMs.
How to prepare for an AI and ML test in 2–3 weeks
If you already know basic Python and statistics, two to three weeks of steady study is enough to cover the topic areas once and practise under time pressure.
- Days 1–3: search and core learning ideas Trace A* by hand on a small graph. Write one-line definitions of classification, regression, clustering and reinforcement learning.
- Days 4–6: supervised and unsupervised learning Train a logistic regression and a k-means model in scikit-learn. Work out precision, recall and F1 from a confusion matrix without a calculator.
- Days 7–9: data preparation and evaluation Rebuild your models inside a Pipeline with a scaler and an encoder, run cross-validation, and compare with a version that scales before splitting.
- Days 10–12: neural networks and reinforcement learning See dropout’s effect in training and evaluation mode. Write the Sarsa and Q-learning updates side by side.
- Days 13–15: NLP, generative AI and responsible AI Summarise attention, RAG, LoRA and RLHF in a paragraph each. Then list the four NIST AI RMF functions and the main EU AI Act dates.
- Days 16–18: timed practice Take the Artificial Intelligence and Machine Learning practice tests in timed Exam Mode. Read every explanation and revise your weakest areas.
Tip
For every method, learn three things: what it does, when you would use it, and how it fails. Most hard questions test the third.
Planning more than one exam?
Studying for several tests or certifications? The All-Access Pass covers every practice test on Exametics, including new exams as they are added, with lifetime access. It costs less than buying about six single practice tests.
Free AI and machine learning practice questions (10 with answers)
Try these 10 free practice questions before you open the answers. They are original sample questions, each labelled with its topic area. The full Exametics practice tests have 240 questions in the same style.
Practice question 1 · AI foundations and search
An A* tree search orders nodes by f(n) = g(n) + h(n). Which property of the heuristic h guarantees that the first goal it returns is optimal?
- A. h(n) is never zero for any node.
- B. h(n) never overestimates the true cost from n to the nearest goal.
- C. h(n) is always equal to g(n), the cost of the path so far.
- D. h(n) is always larger than the true remaining cost, so the search expands fewer nodes.
Show answer
Answer: B. A heuristic that never overestimates the remaining cost is admissible, and A* tree search with an admissible heuristic returns an optimal solution.
A is wrong: h(n) = 0 everywhere is admissible and turns A* into uniform-cost search, which is still optimal. C confuses the heuristic with the path cost; the heuristic estimates the cost ahead, not behind. D describes an overestimating heuristic, which can make A* skip the cheapest path and return a worse one.
Practice question 2 · Supervised learning
A fraud classifier is tested on 1,000 transactions, of which 20 are fraud. It flags 25 transactions, and 15 of those are fraud. What is its recall for the fraud class?
- A. 0.60
- B. 0.985
- C. 0.667
- D. 0.75
Show answer
Answer: D. Recall is tp / (tp + fn). There are 15 true positives, and 5 fraud cases were missed (20 − 15), so recall = 15 / 20 = 0.75.
A is precision: 15 / 25 = 0.60. B is accuracy: 15 true positives plus 970 true negatives (980 legitimate minus 10 false alarms) gives 985 / 1,000. C is the F1 score, the harmonic mean of 0.60 and 0.75, which is about 0.667.
Practice question 3 · Unsupervised learning
You run k-means on customer data with two features: annual income (tens of thousands) and visits per month (0 to 20). The clusters split customers almost only by income. What should you try first?
- A. Standardise both features before clustering, for example with StandardScaler.
- B. Increase the number of k-means restarts (n_init).
- C. Replace k-means with logistic regression.
- D. Increase the maximum number of iterations.
Show answer
Answer: A. K-means minimises squared Euclidean distances. A feature with a variance many times larger than the others dominates that objective, so income drowns out visits. Standardising both features to zero mean and unit variance lets each one contribute.
B helps when k-means stops at a poor local minimum, but every restart still sees the same unscaled distances. C is a supervised classifier and needs labels, which a segmentation task does not have. D only matters if the algorithm has not converged; it does not change which feature dominates.
Practice question 4 · Model training and evaluation
A data scientist fits a StandardScaler on the whole dataset, then runs 5-fold cross-validation on the scaled data. The cross-validation score is higher than the score later seen on new data. What is the best fix?
- A. Use 10 folds instead of 5 to reduce variance.
- B. Tune the hyperparameters on the test set instead.
- C. Cross-validate a Pipeline of the scaler and the model.
- D. Shuffle the rows before fitting the scaler.
Show answer
Answer: C. Fitting the scaler on all the data lets statistics from each validation fold leak into training. That is data leakage. Inside a Pipeline, the scaler is fitted only on the training folds of each split and then applied to the validation fold.
A changes the number of splits but keeps the leak. B makes things worse: tuning on the test set makes the model fit the test set’s quirks. D changes the row order, but the scaler still learns from the validation rows.
Practice question 5 · Model training and evaluation
While training a model, the training loss falls steadily for 40 epochs. The validation loss falls until epoch 12, then rises every epoch after that. What is the most likely explanation?
- A. The model is overfitting after about epoch 12.
- B. The model is underfitting and needs more epochs.
- C. The learning rate is too low for the model to learn.
- D. The validation set is too large.
Show answer
Answer: A. Training loss that keeps falling while validation loss rises is the classic sign of overfitting: the model is memorising the training data rather than learning patterns that generalise. Typical fixes are early stopping near epoch 12, regularisation or more data.
B is wrong because an underfitting model has high training loss too. C is unlikely because training loss is falling steadily, so the model is learning. D is wrong: a larger validation set gives a more reliable estimate; it does not make validation loss rise.
Practice question 6 · Neural networks and deep learning
A PyTorch model contains nn.Dropout(p=0.5). After training, a developer runs predictions without calling model.eval(), and the same input gives slightly different outputs on each run. Why?
- A. Each prediction updates the weights, so they change between runs.
- B. Dropout adds random noise to the input data at prediction time.
- C. The model is still in training mode, so dropout uses a new random mask each pass.
- D. PyTorch re-initialises the weights before every forward pass.
Show answer
Answer: C. In training mode, dropout zeroes each activation with probability p and scales the rest by 1/(1 − p), so every forward pass uses a different random mask. model.eval() makes dropout an identity function, so outputs repeat.
A is wrong: weights change only when an optimiser step runs, which prediction code does not do. B is wrong: dropout zeroes activations; it does not add noise to the inputs. D is wrong: PyTorch does not re-initialise weights during a forward pass.
Practice question 7 · Reinforcement learning
Sarsa and Q-learning are both temporal-difference control methods. Which statement correctly describes the difference between them?
- A. Q-learning needs a model of the transition probabilities; Sarsa does not.
- B. Sarsa updates towards the best next action; Q-learning towards the action actually taken.
- C. Q-learning is a policy-gradient method; Sarsa is a value-based method.
- D. Q-learning is off-policy: its target uses the best next action.
Show answer
Answer: D. Q-learning’s target uses the maximum action value in the next state. Sutton and Barto explain that its learned Q directly approximates the optimal action-value function, independent of the policy being followed. Sarsa is on-policy: its target uses the next action the agent actually chooses.
A is wrong: both methods update from sampled transitions and need no model of the environment. B swaps the two methods. C is wrong: both methods learn action values; neither adjusts a parameterised policy by gradient ascent.
Practice question 8 · NLP and generative AI
A company wants a chatbot that answers questions about internal policies, which change every week. Answers must show which document they came from. Which approach fits best?
- A. Fully fine-tune the language model on the latest policies every week.
- B. Retrieval-augmented generation: fetch relevant policy passages at query time.
- C. Raise the sampling temperature so the model gives more varied answers.
- D. Train a new LoRA adapter on the latest policies every week.
Show answer
Answer: B. RAG keeps the knowledge in an external index (non-parametric memory). Updating the index updates what the chatbot knows without retraining, and the retrieved passages show which document each answer came from.
A is costly to repeat weekly and hides the source inside the weights. C only changes how varied the output is; it adds no knowledge. D is cheaper than full fine-tuning, but it still puts the facts into weights and gives no document trail.
Practice question 9 · Data preparation
A feature “city” has the values London, Paris and Madrid. A colleague encodes them as 0, 1 and 2 for a linear regression model. What is the main problem, and the usual fix?
- A. The codes are too small; rescale them to the range 0 to 100.
- B. Linear regression cannot use categories at all; drop the feature.
- C. The codes imply a false order (Madrid > Paris); use one-hot encoding.
- D. The codes are fine as they are if the target is standardised.
Show answer
Answer: C. Integer codes make the model treat the categories as numbers with an order and equal spacing, which means nothing for city names. One-hot encoding creates one binary column per city, so no false order is implied.
A keeps the false order and only changes its scale. B is wrong: categorical features are useful once encoded properly. D is wrong because scaling the target does nothing about the meaningless order in the input feature.
Practice question 10 · Responsible AI and MLOps
A monitoring job compares this month’s production input data with earlier months of production data and finds that one feature’s distribution has changed significantly. In Google Cloud Model Monitoring terms, what has it detected?
- A. Training-serving skew
- B. Data leakage
- C. Overfitting
- D. Inference drift
Show answer
Answer: D. Google Cloud’s Model Monitoring overview defines inference drift as a significant change over time in the feature distribution in production. Here the comparison is between production periods, so it is drift.
A, training-serving skew, compares production data with the training data, not with earlier production data. B is a training-time error, not a change in production data. C describes a model that fits its training data too closely.
How did you score?
8–10 correct: you are ready for a full timed test, so try Exam Mode next. Under 8: revise the topic areas you missed, then practise them again. The Artificial Intelligence and Machine Learning practice tests have 240 questions like these, each with a hint and a full explanation.
Common mistakes on AI and machine learning tests
Most lost marks come from knowing a term but not its limits.
- Trusting accuracy on rare classes. A model that never predicts fraud can still score highly on accuracy. Check precision, recall, F1 or balanced accuracy instead.
- Preprocessing before the split. Fitting a scaler, imputer or feature selector on all the data leaks test information. Split first and use a Pipeline.
- Forgetting evaluation mode. Dropout behaves differently in training and evaluation mode. Switch the model to evaluation mode before you predict.
- Quoting old regulation dates. Use the European Commission’s current EU AI Act timeline; the high-risk dates changed in 2026.
For interview-style practice, see our guide to AI practice exams for job seekers.
AI and machine learning practice test: FAQs
What does an AI and machine learning practice test cover?
A good one covers search, supervised and unsupervised learning, model evaluation, deep learning, reinforcement learning, NLP and generative AI, data preparation, and responsible AI and MLOps. Questions should test reasoning about scenarios, not just definitions.
Are there free AI and machine learning practice questions?
Yes. This post includes 10 free AI and machine learning sample questions with answers and explanations. For full timed practice, the Exametics Artificial Intelligence and Machine Learning practice tests have 240 questions across 6 tests.
How many questions are in the Exametics AI and machine learning practice tests?
There are 6 practice tests with 40 questions each, 240 questions in total, including a timed Exam Mode test. Every question explains why the right answer is right and why the others are wrong, includes a hint, and is tagged with one of nine topic areas.
Is there an official AI and machine learning exam or passing score?
No. No single official exam covers the whole AI and machine learning syllabus, so there is no official question count or passing score. Vendor certifications such as Google Professional Machine Learning Engineer also test the vendor’s own cloud services.
Which should I take first: Machine Learning Fundamentals or AI and machine learning practice tests?
If you are new to models, metrics and data splits, start with the Exametics Machine Learning Fundamentals practice tests. If you know the basics, go straight to the AI and machine learning practice test set, which adds search, deep learning, reinforcement learning, generative AI and MLOps.
Is machine learning hard, and how long should I prepare?
It is hard if you learn only definitions, because good questions ask when a method fails and why. With basic Python and statistics, two to three weeks of focused study is a realistic plan.
Official sources: the documentation and papers linked in each section above, including the scikit-learn user guide and the NIST AI Risk Management Framework. Checked on 9 November 2026.
Practise AI and machine learning with full explanations
Work through 240 AI and machine learning questions in six practice tests, from search to RAG and AI governance, with a hint and a full explanation for every answer.
✓ Every answer explained · ✓ Timed exam mode · ✓ 30-day refund