Courseiva

DA0-002 Data Acquisition and Preparation Practice Question

A data analyst is profiling a dataset of customer orders. The 'order_date' column contains dates in various formats, including 'YYYY-MM-DD', 'DD/MM/YYYY', and 'MM-DD-YYYY'. The analyst needs to standardize these dates into a single format for time-series analysis. Which approach should the analyst take?

⚠ Common exam trap

The trap here is assuming that a single date format string can handle all variations, which leads to parsing errors.

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

✓

Use a regular expression to extract year, month, and day, then reconstruct the date in a standard format.

The dates are stored in multiple formats, so a one-size-fits-all parsing function will fail. Using regular expressions to extract the year, month, and day components allows the analyst to handle each pattern systematically and then reconstruct a standardized date. This method is robust and does not depend on locale settings.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Sort the dates lexicographically and then apply a standard format.

    Why it's wrong here

    Lexicographic sorting does not change the format of the dates; it only orders them as strings. Different formats will sort inconsistently, and applying a standard format afterward would still require parsing each format. Sorting is not a parsing technique and does not resolve the format inconsistency.

  • ✗

    Apply a single date parsing function with a fixed format string.

    Why it's wrong here

    A single format string cannot correctly parse all the varied date formats present. It would misinterpret dates that do not match the specified pattern, leading to incorrect dates or errors. Multiple formats require either multiple parsing attempts or a more flexible extraction method.

  • ✗

    Convert the dates to Unix timestamps using a generic conversion function.

    Why it's wrong here

    Generic conversion functions often assume a specific input format. Without knowing the format, the conversion may fail or produce incorrect timestamps. Unix timestamps also lose the original date representation and may not be suitable if the analysis requires date components. The core issue is parsing, not conversion to epoch time.

  • ✓

    Use a regular expression to extract year, month, and day, then reconstruct the date in a standard format.

    Why this is correct

    Regular expressions can parse the different date patterns by identifying the position and separators of year, month, and day. Once extracted, the components can be reassembled into a consistent format like ISO 8601. This approach handles variability without relying on locale-specific parsing.

About these practice questions

Courseiva writes every DA0-002 question from scratch — 1,004 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.