MLA-C01 Data Preparation for Machine Learning Practice Question
A data engineer is processing a large dataset in Amazon S3 with AWS Glue ETL. The dataset contains timestamps in multiple time zones. The engineer needs to create a feature for hour-of-day consistent across all records. Which approach ensures correctness?
⚠ Common exam trap
AWS often tests the confusion between `from_utc_timestamp` and `to_utc_timestamp` in Spark, where candidates mistakenly choose the function that converts away from UTC instead of to UTC, leading to incorrect hour-of-day features.
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
✓
Convert all timestamps to UTC during the ETL process, then extract hour
Converting all timestamps to UTC during the ETL process ensures a consistent time zone reference before extracting the hour-of-day feature. This avoids ambiguity from mixed time zones and aligns with best practices for machine learning feature engineering. AWS Glue ETL with Apache Spark provides built-in functions like `to_utc_timestamp()` to perform this conversion reliably.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Convert all timestamps to UTC in the ETL script using Spark's from_utc_timestamp
Why it's wrong here
from_utc_timestamp converts from UTC, not to UTC; the function name is misleading and can cause incorrect conversions.
- ✗
Use AWS Glue's built-in transform to parse timestamps with timezone offsets
Why it's wrong here
While Glue can parse timestamps, it does not automatically normalize to a common timezone for consistent hour extraction.
- ✗
Use Python's datetime.strptime with tzlocal
Why it's wrong here
tzlocal uses the system time zone, which is not reliable for multiple time zones.
- ✓
Convert all timestamps to UTC during the ETL process, then extract hour
Why this is correct
Normalizing to UTC before extracting hour guarantees consistency across time zones.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every MLA-C01 question from scratch — 835 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This MLA-C01 practice question is part of Courseiva's free Amazon Web Services 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 MLA-C01 exam.