All 37 ML & Data Science quiz questions below come with a short explanation, visible right on the page — no sign-in needed. They're grouped by beginner and intermediate levels and 8 subtopics, so you can revise one part at a time. Choose Try ML & Data Science quiz above to take a scored run and review the questions you got wrong.
What the ML & Data Science quiz covers
Model Evaluation9
ML Foundations7
Data Processing7
Deep learning4
Evaluation4
Statistics3
Feature Engineering2
NLP1
Beginner level — 10 ML & Data Science questions
Question 1·ML Foundations
How does supervised learning differ from unsupervised learning?
A.Supervised learning needs labelled data
B.Supervised learning is only for classification problems
C.Supervised learning needs far more data
D.Unsupervised learning always gives more accurate results
Answer: A
Supervised learns from labeled data (this image is a cat, this order was cancelled) to predict labels for new data. Unsupervised works with unlabeled data, finding hidden structure — customer clustering, dimensionality reduction, anomaly detection.
A model scores 99% on training data but 62% on new data. What is this?
A.Data leakage between the two sets
B.Overfitting
C.Class imbalance in the dataset
D.Underfitting
Answer: B
Overfitting: the model memorized both the noise and specifics of the training set, so it doesn't generalize to new data. The telltale sign is a large gap between training and test scores.
What is a validation set for, and how does it differ from a test set?
A.Validation is for selecting the model while test is the final measurement
B.The two can be used interchangeably
C.Validation is for training while test is for selecting the model
D.Validation is only needed when the data is very small
Answer: A
Validation is used to select hyperparameters and compare models. Test is used only once at the end to estimate true performance. If you keep tuning against test-set scores, you've effectively trained on it and the final number is no longer trustworthy.
Fraud detection with 99.8% legitimate transactions: a model always predicting "legitimate" gets what accuracy, and what does it show?
A.0% — because it detects no fraud at all
B.99.8% — accuracy is meaningless under imbalance
C.50% — because it only gets one of the two classes right
D.99.8% — and it is a good model because the error rate is tiny
Answer: B
99.8% — and that's exactly the problem: the model is useless because it misses all fraud, yet the metric looks great. With imbalanced data you must read precision, recall and the confusion matrix instead of accuracy.
A.Precision measures coverage while recall measures correctness
B.Precision is for regression and recall for classification
C.Precision measures correctness while recall measures coverage
D.The two metrics always move in the same direction
Answer: C
Precision = of the cases the model flags as positive, what percentage are actually correct. Recall = of the truly positive cases, what percentage the model catches. Lowering the threshold raises recall but lowers precision, and vice versa.
The input variable the model uses to make predictions — each data column is a feature. What the model needs to predict is called the label or target variable.
Ice cream sales and drowning incidents rise and fall together. What is the correct conclusion?
A.Eating ice cream raises the risk of drowning
B.There is a correlation, but causation is not proven
C.Drowning increases the demand for ice cream
D.The data must be wrong since the two are unrelated
Answer: B
Correlation is not causation. Here there's a hidden variable — hot weather: when it's hot, people both eat more ice cream and go swimming more. To conclude causation you need a controlled experiment or causal inference methods.
Which family does the k-means algorithm belong to?
A.Reinforcement learning, used to optimize a sequence of actions
B.Supervised learning, used for classification
C.Unsupervised learning, used for clustering
D.Supervised learning, used for regression
Answer: C
Unsupervised learning — clustering. k-means partitions data into k clusters so that points within the same cluster are close together, with no labels needed. Widely used for customer segmentation and data compression.
Predicting house price from size and location is which kind of problem?
A.Regression, because the output is a continuous value
B.Clustering, because similar houses must be grouped
C.Dimensionality reduction, because there are many input variables
D.Classification, because houses must be sorted into price bands
Answer: A
Regression — the output is a continuous value. If the problem were changed to predict whether the house is in a cheap, mid-range, or premium segment, it would become classification.
Question 10·Data Processing
Why is a categorical variable like "city" usually one-hot encoded rather than numbered?
A.Because one-hot always performs better with every model
B.Because models cannot handle numeric data
C.Because one-hot reduces the data's dimensionality
D.Because numbering creates an ordering that does not exist
Answer: D
Because assigning numbers creates a fake ordering and distance: a linear model would read Hanoi = 1, Da Nang = 2, HCMC = 3 as meaning HCMC is "three times bigger" than Hanoi. One-hot splits it into independent binary columns, so no ordering is imposed.
Intermediate level — 27 ML & Data Science questions
Question 1·Model Evaluation
What does the bias-variance trade-off describe?
A.The training metric always tracks real-world performance
B.Too simple gives bias while too complex gives variance
C.A complex model is always better than a simple one
D.More data always reduces the error evenly
Answer: B
Model error has two opposing sources: bias (the model is too simple and misses the true pattern) and variance (the model is too sensitive to the particular training data). Reducing one usually increases the other, so you have to find a balance point.
What does k-fold cross-validation give over a single train-test split?
A.It removes overfitting entirely
B.Faster training because the data is split up
C.A more stable estimate of performance
D.You no longer need a separate test set
Answer: C
A more stable performance estimate: the data is split into k parts, each part takes a turn as the validation set while the rest is used for training, then the results are averaged. This way the result doesn't depend on whether a single random split happened to be lucky.
D.The model sees information that will not exist at prediction time
Answer: D
The model gets access to information it could not have at real prediction time. The result is artificially good evaluation scores, then the model collapses in production — one of the most costly mistakes in a data project.
How does L1 (Lasso) regularisation differ from L2 (Ridge)?
A.L1 can drive coefficients exactly to zero
B.L1 is for classification and L2 for regression
C.The two give identical results in practice
D.L2 can drive coefficients to zero while L1 cannot
Answer: A
L1 penalises by absolute value, so it can push some coefficients to exactly 0 — i.e. it does feature selection on its own. L2 penalises by square, so it only shrinks the coefficients, keeping all of them but reducing their influence.
The model cannot distinguish the two classes, equivalent to random guessing. AUC is the probability that the model scores a random positive sample higher than a random negative one — 1.0 is perfect, 0.5 is useless.
Tree-based models (decision trees, random forests, gradient boosting): they split data by thresholds on each individual column, so the unit of measurement doesn't matter. Algorithms based on distance or using gradient descent must have scaling.
How does random forest differ from gradient boosting in how trees are built?
A.A forest is only for classification and boosting for regression
B.The two are the same, differing only in name
C.A forest builds its trees in parallel while boosting builds them sequentially
D.A forest builds sequentially and boosting in parallel
Answer: C
Random forest builds many trees independently, in parallel on random samples and feature subsets, then averages them — reducing variance. Gradient boosting builds trees sequentially, each tree learning the remaining error of the previous ones — reducing bias.
A.It reduces the network's layer count to train faster
B.It stops training when the validation score stops improving
C.It removes anomalous samples from the training set
D.It randomly switches off a portion of the neurons during training
Answer: D
It randomly turns off some neurons at each training step, forcing the network not to depend on a few fixed paths — a form of regularisation against overfitting. At inference time all neurons are turned back on.
What happens when the learning rate is too large during training?
A.The loss oscillates wildly or diverges
B.The model is guaranteed to overfit
C.The training data loses its ordering
D.The model converges more slowly than usual
Answer: A
The loss oscillates wildly or blows up because each update step jumps too far, repeatedly overshooting the optimum. Conversely, a learning rate that is too small converges very slowly and easily gets stuck in flat regions.
Question 10·Data Processing
For time series data, why must you not split train and test randomly?
A.Because a random split destroys the other columns' values
B.Because time series always have too little data
C.Because algorithms cannot handle date-type data
D.Because the model would see the future during training
Answer: D
Because a random split lets the model see the future: it learns from December data and is then evaluated on June. The evaluation score will be artificially high, since in real use the model only has past data. You must split by time order.
A.Reducing dimensionality while retaining most of the variance
B.Classifying data into labelled groups
C.Filling in missing values in the data
D.Adding features so the model learns better
Answer: A
Dimensionality reduction: project data onto a small number of new axes that preserve most of the variance. Used for data compression, noise reduction, and visualizing high-dimensional data in two or three dimensions.
B.A learned dense vector representation of an object
C.A technique for embedding a model into a mobile app
D.A way of splitting data into batches for training
Answer: B
A dense numeric vector representing an object (word, product, user) such that objects close in meaning have vectors that are also close. Learned from data rather than assigned by hand.
B.Graph data with arbitrary relationships between nodes
C.Tabular data with independent columns
D.Data with spatial structure such as images
Answer: D
Data with spatial structure — mainly images. Convolution exploits the fact that nearby points are related, and sharing filters across the whole image means a feature is recognized no matter where it appears.
A.The truth is positive but the model predicted negative
B.The truth is negative and the model predicted negative
C.The truth is positive and the model predicted positive
D.The truth is negative but the model predicted positive
Answer: A
Actually positive but the model predicts negative — a miss. In fraud detection, this is a fraudulent transaction let through; in disease screening, this is a missed case.
How do hyperparameters differ from model parameters?
A.Hyperparameters are set by a person while parameters are learned by the model
B.Both are learned by the model from the data
C.Hyperparameters are learned by the model and parameters set by a person
D.The two differ only in name
Answer: A
Hyperparameters are set by a person before training: learning rate, tree depth, regularization strength, number of clusters. Parameters are what the model learns from data: weights, coefficients, the split threshold at each tree node.
A column is missing 30% of its values. What should you consider first?
A.Drop the column entirely
B.Understand why the values are missing before deciding how to handle it
C.Immediately fill them with the column's mean
D.Delete every row with a missing value
Answer: B
First find out why it is missing. If missing at random, imputing a value is reasonable; if missing systematically (only new customers are missing it, only canceled orders are missing it) then the missingness itself is a signal and you should add a flag column.
Why build a simple baseline before trying complex models?
A.Because complex models cannot run without a baseline
B.To make the process look proper when reporting results
C.Because simple models always perform better in practice
D.To know whether the complex model is genuinely better
Answer: D
To have a baseline for comparison. Without a baseline, 87% says nothing — predicting the majority class might already give 85%. A baseline also shows whether the problem is easy or hard and helps catch data pipeline bugs early.
Offline metrics improve but the online A/B test shows no gain. Most likely cause?
A.The training data has too many features
B.The offline metric does not reflect the business goal
C.A/B tests are always less reliable than offline measurement
D.The model has not been trained for enough epochs
Answer: B
The offline metric does not connect to the business objective. A recommendation model that is 3% more accurate does not mean users click more — they may still pick exactly what they already intended. There is also a mismatch between training data and real-world data.
Question 19·ML Foundations
What benefit does ensembling provide?
A.Reducing training time compared with a single model
B.Removing the need to choose hyperparameters
C.Making the model easier to explain to users
D.Combining several models to reduce the error below any single one
Answer: D
Combining predictions from multiple models to reduce overall error: when models make mistakes in different places, their individual errors partly cancel out. The trade-off is higher resource cost and harder explainability.
An A/B test returns a p-value of 0.03. What does that mean?
A.The result is certainly correct because it is below 0.05
B.B is about 3% better than A
C.If there were no real difference, data like this is 3%
D.There is a 97% probability that B is better than A
Answer: C
It means: if there really were no difference, the probability of observing a gap this large (or larger) is 3%. It does not say the probability that B is better than A is 97%, and it says nothing about whether the effect is large or small.
How does min-max scaling differ from standardization?
A.One is for numeric data and the other for categorical
B.One squeezes into a fixed range while the other does not
C.One raises the accuracy while the other lowers it
D.Both give identical results after training
Answer: B
Min-max scaling squeezes values into a fixed range but is very sensitive to outliers — one extreme value pushes everything else close to zero. Standardization by mean and standard deviation has no bounded range but is less affected by outliers.
A classification task has 2% positive samples. What is the sensible first step?
A.Duplicate the minority class samples to balance them
B.Change the evaluation metric and the decision threshold
C.Collect more data until the two classes are balanced
D.Drop majority class samples to balance them
Answer: B
First change the evaluation metric: use precision, recall, and the area under the precision-recall curve instead of overall accuracy. Then adjust the decision threshold according to the real cost of each type of error. Intervening in the data comes later.
A categorical variable has thousands of distinct values. What problem does one-hot encoding cause?
A.The dimensionality explodes and the feature matrix becomes very sparse
B.New values appearing later will cause errors
C.The values' order is wrongly interpreted as meaningful
D.The model cannot read categorical data
Answer: A
The number of dimensions grows with the number of values, producing a very sparse matrix: the model struggles to learn because each column has very few positive samples, and memory and training time increase sharply. For high-cardinality variables, other encodings are more suitable.
What should guide the choice of a regression metric?
A.How much more large errors matter than small ones
B.The number of features in the model
C.The size of the training dataset
D.The algorithm used for training
Answer: A
Base it on the cost of error by magnitude: if large deviations are far more serious, use a squared-error metric; if every deviation has proportional cost, use an absolute-value metric, which is also more robust to outliers.
What differs when preparing Vietnamese text for machine learning versus English?
A.Modern language models cannot be used
B.There is no need to remove very frequent words
C.Upper and lower case do not affect the result
D.Word boundaries do not coincide with whitespace
Answer: D
The biggest difference: word boundaries do not match whitespace. Many words consist of two syllables written separately, so splitting on whitespace cuts the wrong meaningful unit. You also need to normalize diacritic encoding, since the same character can be stored in several different byte forms.
Data contains many records per user. How should train and test be split?
A.Split so each set has the same number of records per person
B.Split by user, keeping them out of both sets
C.Split by the record's creation time
D.Split randomly by record
Answer: B
Split by group: all records for one user go into only one set. Splitting randomly by record lets the model learn each person's individual characteristics and recognize them in the test set — the evaluation result comes out far higher than reality.
A model outputs 0.8 but only 60% of such cases are positive. What is this called?
A.The probabilities are not calibrated
B.The wrong evaluation metric was chosen for the problem
C.The training data is class-imbalanced
D.The model is overfitted to the training data
Answer: A
This is a probability calibration problem: the model separates the two classes well but its output values don't match the actual frequencies. This matters when the number is used to make decisions — for example computing expected value or setting a cost-based threshold.