DA0-002 Data Analysis Practice Question
A data analyst is performing K-means clustering on customer data. Which THREE of the following are steps in the K-means algorithm?
⚠ Common exam trap
Candidates often confuse K-means with other algorithms like PCA or correlation-based clustering, leading candidates to select eigenvalue decomposition or correlation matrix calculation as steps.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Initialize k centroids randomly.
Option C is correct because the standard K-means algorithm begins by initializing k centroids, typically at random positions in the feature space, before any assignment occurs. Option E is correct because after initialization, each data point is assigned to the nearest centroid, usually measured by Euclidean distance, forming the initial clusters. Option D is correct because the algorithm then recomputes each centroid as the mean (average) of all points assigned to it, and this assignment-and-update cycle repeats until convergence. Options A and B are not steps in K-means: eigenvalue decomposition is used in dimensionality-reduction techniques such as PCA, and calculating a correlation matrix is a preprocessing or exploratory analysis step, not part of the iterative K-means procedure.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Perform eigenvalue decomposition.
Why it's wrong here
Eigenvalue decomposition belongs to dimensionality-reduction techniques such as principal component analysis, which projects data onto eigenvectors; K-means instead assigns points to the nearest centroid and recomputes centroids iteratively. It is tempting because PCA is often applied to customer data before clustering, but it is a separate preprocessing step, not part of the K-means algorithm itself.
- ✗
Calculate the correlation matrix.
Why it's wrong here
A correlation matrix quantifies linear relationships between numeric variables for feature selection or exploratory analysis; K-means partitions observations by Euclidean distance to centroids and never computes pairwise variable correlations. It is tempting because correlation analysis commonly precedes clustering during data preparation, but it is not one of the algorithm's iterative assignment and update steps.
- ✓
Initialize k centroids randomly.
Why this is correct
K-means begins by choosing k initial centroids, typically at random positions in the feature space, before any assignment occurs. This initialisation step satisfies the stem's requirement to identify actual algorithm steps, establishing the starting points that subsequent assignment and update iterations refine.
- ✓
Update centroids by computing the mean of all points assigned to each centroid.
Why this is correct
After assignment, each centroid is recomputed as the mean of all points in its cluster, moving it to the cluster's centre. This update step satisfies the stem's requirement to identify K-means algorithm steps, and repeating assignment and update until centroids stabilise produces convergence.
- ✓
Assign each data point to the nearest centroid.
Why this is correct
Each data point is assigned to the centroid nearest it, usually by Euclidean distance, forming k temporary clusters. This assignment step satisfies the stem's requirement to list K-means algorithm steps, and it directly precedes the centroid recalculation that drives convergence.
Go deeper
Related to this question
About these practice questions
One of 1,004 original DA0-002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.