All CompTIA exams

Free DY0-001 practice test: 30 questions with answers

30 original questions for CompTIA DataAI (formerly DataX), drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.

Free questions
30
Full bank
100 questions
Real exam
Maximum of 90 questions, 165 min
Passing score
Pass/fail only

DY0-001 exam guide: topics, cost and format

All 30 DY0-001 questions with answers

The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.

Machine learning (6 questions)

  1. Question 1

    A fully grown decision tree achieves near-perfect training accuracy but much lower accuracy on held-out data. Which action most directly reduces this overfitting?

    1. AReplace the classifier with a linear regression on the labels
    2. BIncrease the maximum depth to capture more splits
    3. CLimit the maximum depth or apply cost-complexity pruning
    4. DRemove the validation set from the pipeline
    Show answer and explanation
    Correct answer: C

    Limiting depth or pruning reduces the variance of a tree by restricting how closely it fits the training data. Increasing depth makes overfitting worse, and linear regression on class labels is not a fix for variance.

  2. Question 2

    Which statement best explains why a random forest usually generalizes better than a single deep decision tree trained on the same data?

    1. ABoosting sequentially reweights misclassified rows to reduce bias through additive shrinkage
    2. BBagging trains trees on bootstrap samples and averages them, which reduces variance
    3. CThe forest replaces the impurity measure with a linear kernel at each split node in every tree
    4. DEach tree uses every training row and every feature without randomness at each node during fitting
    Show answer and explanation
    Correct answer: B

    Random forests combine bagging with random feature selection, so averaging many decorrelated trees lowers variance. The second option describes the opposite of random forest, and boosting is a different ensemble method.

  3. Question 3

    In gradient boosted trees, what does each new tree typically learn to predict?

    1. AThe residual errors left by the current ensemble, scaled by the learning rate
    2. BThe cluster assignments from a k-means step computed on training data
    3. CA random subset of features with no reference to the target by design
    4. DThe original class labels with equal weight on every row per pass
    Show answer and explanation
    Correct answer: A

    Gradient boosting fits each new weak learner to the negative gradient of the loss, which for squared error is the residual. Training on labels directly, random features, or cluster assignments does not describe the method.

  4. Question 4

    A marketing team wants to group customers by purchasing behavior without labeled outcomes. The team must choose the number of clusters in advance for k-means. Which technique helps compare candidate values of k using the cohesion and separation of clusters?

    1. ALearning-rate scheduling during optimization
    2. BEarly stopping on the validation loss curve
    3. CSilhouette analysis across several values of k
    4. DConfusion matrix on the training labels for each fold
    Show answer and explanation
    Correct answer: C

    Silhouette scores measure how well each point fits its own cluster compared with the nearest other cluster, which helps compare values of k. Confusion matrices and early stopping need labels or a supervised training loop.

  5. Question 5

    Which two techniques add a penalty that discourages large model coefficients? (Choose two.)

    1. AL1 regularization, which can shrink some coefficients to zero
    2. BL2 regularization, which shrinks coefficients toward zero without eliminating them
    3. CAdding polynomial terms up to degree ten
    4. DRemoving the validation set to speed up training
    Show answer and explanation
    Correct answer: A, B

    L1 and L2 penalties both add a term to the loss that grows with coefficient size, with L1 producing sparsity. Adding polynomial terms increases complexity, and removing a validation set does not regularize anything.

  6. Question 6

    A medical screening model is used to decide which patients receive a follow-up test that is costly but not harmful. Missing a true case is considered much more serious than an unnecessary follow-up. Which metric should the team emphasize when selecting the threshold?

    1. ARecall
    2. BMean absolute error
    3. CPrecision
    4. DSpecificity
    Show answer and explanation
    Correct answer: A

    Recall measures the share of true cases caught, which matches a setting where false negatives are the costliest error. Precision emphasizes avoiding false alarms, and mean absolute error is a regression metric.

Operations and processes (6 questions)

  1. Question 7

    A retailer wants its analytics warehouse to reflect inserts, updates, and deletes from its transactional database continuously, without repeated full extracts. Which ingestion approach fits this requirement?

    1. AChange data capture from the database transaction log
    2. BNightly full table dumps copied to a file share via a cron trigger
    3. CScraping the application user interface through screen text
    4. DManual CSV exports by business users on a weekly schedule
    Show answer and explanation
    Correct answer: A

    Change data capture reads committed changes from the transaction log and streams them downstream, so only deltas move. Full dumps and manual exports are batch processes that repeat full loads, and UI scraping is fragile and unreliable.

  2. Question 8

    A team needs to track which model version was trained on which data snapshot, record its evaluation metrics, and promote an approved version to production. Which MLOps component is designed for this purpose?

    1. AA dashboard theme library that stores chart colors and fonts for styling
    2. BA model registry with versioned artifacts and stage transitions
    3. CA message broker with topic partitions that buffers events for consumers
    4. DA columnar file format with compression that stores column chunks and metadata
    Show answer and explanation
    Correct answer: B

    A model registry stores versioned model artifacts, lineage, metrics, and lifecycle stages such as staging and production. A message broker, file format, and dashboard library do not manage model promotion.

  3. Question 9

    A data engineer must join a customer table to an orders table, but the customer table contains duplicate rows for the same customer ID. Which problem does this create, and what is the best fix?

    1. AThe join is slower but correct, so no change is needed since the engine dedupes rows
    2. BDuplicates are removed automatically by a standard SQL join when the ON clause is used
    3. CJoin fan-out inflates aggregates, so deduplicate the customer records on the key before joining
    4. DThe join drops most orders, so switch to a cross join whenever the key counts differ
    Show answer and explanation
    Correct answer: C

    Duplicate keys on one side multiply matching rows, which inflates sums and counts. Deduplicating or otherwise enforcing a unique key before the join fixes the fan-out, while cross joins make the problem much worse.

  4. Question 10

    In the CRISP-DM process model, which phase normally comes first and defines the decision the analysis must support?

    1. AModeling and evaluation
    2. BBusiness understanding
    3. CDeployment and monitoring
    4. DData preparation work
    Show answer and explanation
    Correct answer: B

    CRISP-DM begins with business understanding, which clarifies objectives and success criteria before any data work. Preparation, modeling, and deployment all depend on that framing.

  5. Question 11

    Which two practices reduce the risk when releasing a new model version to production? (Choose two.)

    1. ATraining the new model on production data with no version record
    2. BHard-coding decision thresholds directly inside a notebook
    3. CShadow deployment that scores live traffic without affecting decisions
    4. DCanary release that routes a small share of traffic to the new version
    Show answer and explanation
    Correct answer: C, D

    Shadow deployments and canary releases let teams compare a new model against live behavior before full rollout and roll back quickly. Untracked training and hard-coded notebook thresholds make releases less reproducible and riskier.

  6. Question 12

    A nightly pipeline starts failing because an upstream system changed the data type of a revenue column from decimal to text. Which control would have caught this change at ingestion before it corrupted downstream tables?

    1. AAdding a dashboard filter for revenue values in the executive report
    2. BIncreasing the number of rows sampled for exploratory analysis of the warehouse extracts
    3. CSchema validation against a data contract that specifies column names and types
    4. DCompressing the source files more aggressively using gzip level nine
    Show answer and explanation
    Correct answer: C

    A data contract with schema validation checks names, types, and constraints at the boundary, so drift is rejected or flagged immediately. Sampling, compression, and dashboard filters do not enforce the structure of incoming data.

Mathematics and statistics (6 questions)

  1. Question 13

    A data scientist runs a two-sample t-test comparing conversion rates between two landing pages and obtains a p-value of 0.03 at a significance level of 0.05. Which interpretation is correct?

    1. AData this extreme would occur about 3% of the time if the two population means were equal
    2. BThere is a 97% probability that the alternative hypothesis is true given the observed data from this test
    3. CThe effect size is 3% of the baseline conversion rate, meaning the new page lifts conversions by that amount
    4. DThe test has a 3% chance of missing a real difference in this small sample size
    Show answer and explanation
    Correct answer: A

    A p-value is the probability of observing a result at least as extreme as the sample result assuming the null hypothesis is true. It does not give the probability that the null or alternative hypothesis is true, and it does not measure effect size.

  2. Question 14

    A call center logs the number of support tickets arriving in each hour. The tickets arrive independently at a roughly constant average rate. Which probability distribution is the most appropriate model for the count per hour?

    1. ABinomial with a fixed number of trials
    2. BExponential
    3. CNormal with a known variance of one
    4. DPoisson
    Show answer and explanation
    Correct answer: D

    The Poisson distribution models the number of independent events in a fixed interval at a constant average rate. The exponential distribution models the time between such events, and the binomial needs a fixed number of trials.

  3. Question 15

    In principal component analysis performed on a standardized feature matrix, which quantity identifies the direction of maximum variance in the data?

    1. AThe row with the largest Euclidean norm after standardization
    2. BThe eigenvector of the covariance matrix with the largest eigenvalue
    3. CThe gradient of the loss function at the origin of weight space
    4. DThe target vector after one-hot encoding for each class label
    Show answer and explanation
    Correct answer: B

    The principal components are the eigenvectors of the covariance matrix, ordered by eigenvalue, and the first one points along the direction of greatest variance. Row norms and gradients do not describe variance direction.

  4. Question 16

    A monthly revenue series shows a steady upward trend over three years. An analyst wants to fit an ARIMA model that assumes stationarity. Which preprocessing step is the most direct way to address the trend?

    1. ABootstrap resampling of the monthly rows
    2. BMin-max scaling of the revenue values
    3. COne-hot encoding of the month column
    4. DFirst-order differencing of the series
    Show answer and explanation
    Correct answer: D

    Differencing removes a stochastic or linear trend and is the d parameter in ARIMA. Scaling changes the range of values but leaves the trend intact, and one-hot encoding and bootstrapping do not address stationarity.

  5. Question 17

    A diagnostic test is 95% sensitive and 90% specific. The condition has a prevalence of 1%. Which expression gives the probability that a person has the condition given a positive result?

    1. ABayes theorem combining sensitivity, specificity, and prevalence
    2. BThe sensitivity alone, since it describes positives
    3. CThe prevalence multiplied by 95% sensitivity of the assay
    4. DThe specificity alone, since it describes negatives in the study cohort
    Show answer and explanation
    Correct answer: A

    The posterior probability of disease given a positive test follows from Bayes theorem and depends on prevalence as well as test characteristics. Sensitivity alone ignores false positives in a low-prevalence population.

  6. Question 18

    During gradient descent on a differentiable loss function, which direction should parameter updates move?

    1. APerpendicular to the gradient at every step
    2. BAlong the gradient, toward higher loss
    3. CRandomly, because the gradient is not used
    4. DOpposite the gradient, toward lower loss
    Show answer and explanation
    Correct answer: D

    The gradient points in the direction of steepest increase, so stepping against it reduces the loss locally. Moving along the gradient increases loss, and random steps are not gradient descent.

Modeling, analysis, and outcomes (6 questions)

  1. Question 19

    A model reports 99% validation accuracy but performs poorly in production. Which two findings most strongly suggest data leakage? (Choose two.)

    1. AA feature is computed using information recorded after the prediction time
    2. BImputation and scaling were fitted on the full dataset before the train-validation split
    3. CTraining accuracy is slightly higher than validation accuracy
    4. DThe learning rate was reduced during the final epoch
    Show answer and explanation
    Correct answer: A, B

    Features built from post-outcome data and preprocessing fitted before splitting both let information from the validation set or future leak into training. Slightly higher training accuracy and a lower learning rate are normal and do not indicate leakage.

  2. Question 20

    During exploratory data analysis, an analyst wants to see the shape of the distribution of a single continuous variable, including skew and possible outliers. Which visualization is the best choice?

    1. APie chart
    2. BNetwork graph
    3. CStacked area chart
    4. DHistogram
    Show answer and explanation
    Correct answer: D

    A histogram bins a continuous variable and shows its shape, skew, and tails. Pie charts and stacked areas are for parts of a whole or trends, and network graphs show relationships between entities.

  3. Question 21

    A customer dataset has missing income values, and the analyst finds that high-income customers are much more likely to leave income blank. Which missingness mechanism does this describe?

    1. AMissing not at random
    2. BMissing completely at random
    3. CStructurally missing by design
    4. DMissing at random after conditioning on region
    Show answer and explanation
    Correct answer: A

    When the probability of missingness depends on the unobserved value itself, the data is missing not at random. Simple mean imputation would bias the estimate in that case, so the analyst should model the missingness or collect more context.

  4. Question 22

    A data scientist must present a model's uncertainty to executives who do not study statistics. Which presentation is most appropriate?

    1. AA list of every hyperparameter tried during tuning with its validation score
    2. BA table of raw coefficients with eight decimal places for each feature and the intercept term
    3. CA range estimate with a plain-language statement of confidence and the main assumptions
    4. DA statement that the model is correct because accuracy is high on the stratified held-out test split
    Show answer and explanation
    Correct answer: C

    Stakeholders need the decision-relevant range and the assumptions behind it, stated in plain language. Raw coefficients, unqualified claims, and tuning logs do not communicate uncertainty clearly.

  5. Question 23

    A team builds a k-nearest-neighbors model on features measured in very different units, such as income in dollars and age in years. What preprocessing step is most important before fitting?

    1. ARemoving most numeric features from the dataset before fitting
    2. BFeature scaling so that no single feature dominates the distance calculation
    3. CConverting every feature to a binary indicator that splits values at the sample median
    4. DSorting the rows by the target variable in ascending label order
    Show answer and explanation
    Correct answer: B

    Distance-based models are sensitive to feature magnitude, so standardizing or normalizing features prevents income from dominating the distance. Binarizing or removing features loses information and sorting rows does not affect distances.

  6. Question 24

    A team repeatedly tunes hyperparameters and checks each change against the test set. The final test score is reported to executives as the expected production performance. What is the main problem?

    1. AThe test set has been used for model selection, so its score is optimistically biased
    2. BHyperparameter tuning should be avoided in a standard modeling workflow
    3. CThe team should have used the test set for training as well, using cross-validation folds
    4. DThe test set is too large for reliable evaluation, since a bulky split inflates variance across runs
    Show answer and explanation
    Correct answer: A

    Using the test set to choose among models leaks information into the selection, so the reported score overstates real performance. Tuning on a validation set or with nested cross-validation keeps the test set as an unbiased final check.

Specialized applications of data science (6 questions)

  1. Question 25

    A card-fraud model flags 0.2% of transactions, and only a small fraction of flagged transactions are truly fraudulent. Which evaluation metric is most informative for this class-imbalanced problem?

    1. AR-squared on the raw transaction amount
    2. BOverall accuracy on the full test set
    3. CPrecision-recall curve and average precision
    4. DMean squared error of predicted transaction amounts
    Show answer and explanation
    Correct answer: C

    With heavy class imbalance, accuracy can be high even for a useless model, while precision-recall analysis shows how many flagged cases are fraud and how many fraud cases are caught. Mean squared error and R-squared are regression measures.

  2. Question 26

    A search team represents documents as TF-IDF vectors. Which statement describes how a term is weighted?

    1. AIt is replaced by a dense vector learned from a neural network through unsupervised training
    2. BIt receives a weight equal to one for every term in the vocabulary per document
    3. CIts frequency is multiplied by the length of the document and the total corpus size is ignored
    4. DIts frequency in a document is scaled down by how common it is across the whole corpus
    Show answer and explanation
    Correct answer: D

    TF-IDF multiplies term frequency in a document by an inverse document frequency that down-weights terms appearing in many documents. Dense learned vectors are word or sentence embeddings, not TF-IDF.

  3. Question 27

    In reinforcement learning, which two statements correctly describe the agent, reward, and policy? (Choose two.)

    1. AThe reward is a scalar feedback signal the agent uses to improve its policy
    2. BThe policy maps observed states to actions the agent takes
    3. CThe reward is a labeled correct answer copied for each state
    4. DThe learning rate is the list of states the environment can reach
    Show answer and explanation
    Correct answer: A, B

    The reward is scalar feedback received after actions, and the policy defines which action to take in each state. Labeled answers belong to supervised learning, and the learning rate is an optimizer hyperparameter, not a set of states.

  4. Question 28

    A computer vision team wants a model that classifies handwritten digits from small grayscale images. Which network component is designed to detect local spatial patterns such as edges and strokes?

    1. AA softmax layer placed at the very start of the network
    2. BConvolutional layers with learned filters
    3. CRecurrent layers that process pixels as a sequence of time steps
    4. DA decision tree applied to the flattened pixel vector
    Show answer and explanation
    Correct answer: B

    Convolutional layers slide learned filters across the image to detect local patterns, which is why they work well for images. Recurrent layers are designed for sequences, and a softmax at the input would have no features to classify.

  5. Question 29

    A retail team wants to recommend products to a shopper based on the purchase patterns of customers with similar histories, without modeling product attributes. Which approach fits best?

    1. ALinear programming to maximize shelf space in stores
    2. BPrincipal component regression on store floor plans
    3. CSurvival analysis on store closing dates using Kaplan-Meier hazard curves
    4. DCollaborative filtering based on user-item interaction data
    Show answer and explanation
    Correct answer: D

    Collaborative filtering predicts preferences from the behavior of similar users and items. The other options address unrelated problems such as resource allocation or store lifetimes.

  6. Question 30

    An object detection system must locate every vehicle in a traffic camera frame. Which output distinguishes object detection from simple image classification?

    1. ABounding boxes with a class label for each detected object
    2. BA cluster identifier for every pixel with no label
    3. CA probability curve over time for the whole video
    4. DA single class label for the entire image, regardless of object count
    Show answer and explanation
    Correct answer: A

    Object detection returns the location of each object, usually as a bounding box, together with its class. Image classification gives one label for the whole image, so it cannot localize individual vehicles.