CompTIA certification · Exam DY0-001

DY0-001 Mock Exam Page 3

CompTIA DataAI

Free DY0-001 mock exam questions 21–26, each with the answer and an explanation.

20 questions · 39 minutes · free, no sign-up

Free DY0-001 questions

21–26 of 26 free
Question 21 Choose 1
Which of the following modeling tools is appropriate for solving a scheduling problem?
Show answerHide answer

Correct answer: B Constrained optimization

Explanation

Explanation:
A scheduling problem involves allocating limited resources (e.g., machines, employees, time slots) to tasks over time while satisfying a set of constraints.

What is Constrained Optimization? This is a mathematical framework designed to find the best solution (the optimum) from all feasible alternatives, subject to a set of restrictions (constraints).

Why it fits perfectly:
Objective Function:
The goal of the schedule (e.g., "minimize total completion time," "maximize resource utilization," "minimize costs") is expressed as a mathematical function to be minimized or maximized.
Constraints: The real-world limits of the problem (e.g., "a person cannot be in two meetings at once," "Task B must start only after Task A is finished," "only three machines are available") are expressed as mathematical inequalities or equations that any valid solution must satisfy.
Solving a scheduling problem means finding values for decision variables (e.g., start times, assignments) that satisfy all constraints and yield the best possible value for the objective function. This is the exact definition of constrained optimization.

Why the Other Options Are Not Correct
A. One-armed bandit
Purpose: This refers to a classic problem in probability and reinforcement learning, often solved by strategies like the Multi-Armed Bandit algorithm. It is used for exploration vs. exploitation trade-offs, such as A/B testing website layouts or optimizing click-through rates.
Why it's wrong: It is not used for creating schedules. It is concerned with sequentially choosing between options with uncertain rewards to maximize a cumulative reward over time. It does not handle the complex constraints inherent in scheduling problems.
C. Decision tree
Purpose: A decision tree is a predictive modeling tool used for classification and regression (e.g., predicting if a loan applicant will default, estimating the value of a house).
Why it's wrong: While a decision tree could be used to make a single binary decision within a larger scheduling system (e.g., "is this employee qualified for this task?"), it is not a tool for creating an entire optimized schedule. It cannot natively handle the complex web of constraints and objectives that define a scheduling problem.
D. Gradient descent
Purpose: Gradient descent is an optimization algorithm used to find the minimum of a function. It is the core engine behind training many machine learning models, like neural networks and linear regression.
Why it's wrong: This is a subtle but important distinction. Gradient descent is an algorithm for solving optimization problems. Constrained optimization is the type of problem or framework. Furthermore, standard gradient descent is designed for smooth, unconstrained problems. While there are variants for constrained problems, it is not the overarching "modeling tool" itself. You would use a constrained optimization model and then might use a specific algorithm (which could be gradient-based or not) to solve it. Gradient descent alone cannot handle hard constraints without significant modification.

Valid References
Operations Research (OR):
Scheduling is a foundational problem in the field of Operations Research. OR textbooks and courses universally treat scheduling problems as applications of constrained optimization, specifically Integer Programming or Mixed-Integer Programming (MIP), where solutions must include whole numbers (e.g., you can't assign half a person to a task).
Software Tools:
Commercial and open-source solvers like Gurobi, CPLEX, and Google's OR-Tools are designed to solve constrained optimization problems and are the industry standard for complex scheduling applications, from airline crew scheduling to manufacturing plant flow.
Question 22 Choose 1
A data scientist is standardizing a large data set that contains website addresses. A specific string inside some of the web addresses needs to be extracted. Which of the following is the best method for extracting the desired string from the text data?
Show answerHide answer

Correct answer: A Regular expressions

Explanation

Explanation
Regular expressions (regex) are the best method for extracting specific patterns or substrings from text data—especially in structured formats like website URLs. Regex allows you to define flexible search patterns to locate and extract strings such as domain names, query parameters, or file paths.
Ideal for pattern matching and string extraction
Efficient for large datasets
Can handle complex formats like URLs, emails, and IP addresses
📚 References:
Regular Expressions – MDN Web Docs
Regex in Python – Real Python

❌ Why Other Options Are Incorrect
B. Named-entity recognition (NER)
Designed to identify entities like names, locations, and organizations—not substrings in URLs.
C. Large language model
Overkill for simple string extraction; slower and less precise than regex for this task.
D. Find and replace
Useful for substitutions, not for dynamic pattern-based extraction.
Question 23 Choose 1
Which of the following environmental changes is most likely to resolve a memory constraint error when running a complex model using distributed computing?
Show answerHide answer

Correct answer: D Adding nodes to a cluster deployment

Explanation

Explanation:

Option Analysis
A. Converting an on-premises deployment to a containerized deployment
Containerization improves portability, scalability, and environment consistency.
But it does not inherently add memory capacity — it just packages the model.
❌ Not a direct solution to memory constraints.
B. Migrating to a cloud deployment
Moving to the cloud gives access to scalable resources, but unless more memory or nodes are actually provisioned, the memory error will remain.
This could help indirectly, but it’s not the most direct or guaranteed solution.
❌ Not the best answer.
C. Moving model processing to an edge deployment
Edge deployments are designed for local, lightweight processing closer to data sources.
Typically have less memory and compute than centralized clusters.
❌ This would worsen memory constraints.
D. Adding nodes to a cluster deployment
Distributed computing spreads workloads across multiple nodes.
By adding more nodes, you increase total available memory and allow parallel distribution of data and computation.
This directly addresses memory constraint errors when handling large models or datasets.
✅ Best solution.

📖 References:
Dean, J., & Ghemawat, S. (2008). MapReduce: Simplified Data Processing on Large Clusters.
Zaharia, M., et al. (2016). Apache Spark: A Unified Engine for Big Data Processing.
Question 24 Choose 1
A data scientist is using the following confusion matrix to assess model performance:
Actually Fails
Actually Succeeds
Predicted to Fail
80%
20%
Predicted to Succeed
15%
85%

The model is predicting whether a delivery truck will be able to make 200 scheduled delivery stops.
Every time the model is correct, the company saves 1 hour in planning and scheduling.
Every time the model is wrong, the company loses 4 hours of delivery time.
Which of the following is the net model impact for the company?
Show answerHide answer

Correct answer: D 165 hours saved

Explanation

Explanation:

Step-by-Step Breakdown
We’re given a confusion matrix with percentages and a total of 200 predictions (delivery stops). Let’s calculate the number of correct and incorrect predictions, then apply the time savings and losses.
📊 Confusion Matrix Recap (Percentages):
Actually Fails Actually Succeeds
Predicted to Fail 80% 20%
Predicted to Succeed 15% 85%

1️⃣ Convert Percentages to Counts (out of 200)
Actually Fails Actually Succeeds Row Total
Predicted to Fail 80% of 200 = 160 20% of 200 = 40 200
Predicted to Succeed 15% of 200 = 30 85% of 200 = 170 200
Wait—this adds up to 400 predictions, which means the percentages are relative to row totals, not the full dataset. Let's reframe:

Let’s assume:
100 predictions were “Predicted to Fail”
100 predictions were “Predicted to Succeed”
Then:
Predicted to Fail: 80% correct → 80 correct, 20 incorrect
Predicted to Succeed: 85% correct → 85 correct, 15 incorrect
✅ Total correct predictions = 80 + 85 = 165 ❌ Total incorrect predictions = 20 + 15 = 35

2️⃣ Apply Time Impact
Correct prediction → saves 1 hour → 165 × 1 = 165 hours saved
Incorrect prediction → loses 4 hours → 35 × 4 = 140 hours lost

3️⃣ Net Impact
165 hours saved − 140 hours lost = 25 hours saved
Question 25 Choose 1
Which of the following is a key difference between KNN and k-means machine-learning techniques?
Show answerHide answer

Correct answer: D KNN is used for classification, while k-means is used for clustering.

Explanation

Explanation:

Option Analysis
A. KNN operates exclusively on continuous data, while k-means can work with both continuous and categorical data
Incorrect.
KNN can work with both continuous and categorical variables (distance metrics can be adjusted).
K-means, however, works best with continuous data because it relies on Euclidean distance and means.
B. KNN performs better with longitudinal data sets, while k-means performs better with survey data sets
Incorrect.
This statement is arbitrary and not a standard distinction in ML theory.
C. KNN is used for finding centroids, while k-means is used for finding nearest neighbors
Incorrect.
That’s reversed.
K-means finds centroids (cluster centers).
KNN finds nearest neighbors for classification/regression.
D. KNN is used for classification, while k-means is used for clustering
Correct.
KNN (supervised learning): Used for classification and regression, predicts labels based on the majority class of neighbors.
K-means (unsupervised learning): Used for clustering, partitions data into k groups based on centroid distances.

References:
Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning.
Géron, A. (2019). Hands-On Machine Learning with Scikit-Learn, Keras & TensorFlow.
Question 26 Choose 1
Which of the following is the naive assumption in Bayes' rule?
Show answerHide answer

Correct answer: B Independence

Explanation

Explanation:

Option Analysis
A. Normal distribution
Incorrect.
Some Naive Bayes variants (like Gaussian NB) assume features follow a normal distribution, but this is a distributional assumption, not the naive assumption itself.
B. Independence ✅
Correct.
The naive assumption = conditional independence of features given the class.
This simplification makes the algorithm computationally efficient and practical even with large feature sets.
C. Uniform distribution
Incorrect.
No uniform distribution assumption is made in Naive Bayes.
D. Homoskedasticity
Incorrect.
Homoskedasticity (equal variance across groups) is an assumption in regression models, not in Naive Bayes.

📖 References:
Murphy, K. P. (2012). Machine Learning: A Probabilistic Perspective.
Jurafsky, D., & Martin, J. H. (2023). Speech and Language Processing (3rd ed.).

That's the last free question

You've seen the free 30% (26 of 89 questions). Full access unlocks every question and full-length DY0-001 mock exams (85 questions, 165 minutes), a different mock on every attempt.

Unlock full mock exam
Full mock exam

Sit the DY0-001 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real DY0-001 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full DY0-001 mock exam
  • 85questions per mock
  • 165 mintime limit
  • 89questions in the bank
  • Newmock on every attempt