AWS ML Engineer Associate study materials
AWS ML Engineer Associate study resources

AWS ML Engineer Associate practice questions

One question at a time. Build your AWS ML Engineer Associate understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Data Preparation for Machine Learning

A data engineer needs a fully managed, petabyte-scale data catalog and ETL service that can discover schemas automatically and run Apache Spark jobs without managing servers. Which AWS service should they choose?

  1. AWS Data Pipeline
  2. AWS Glue Correct answer.
  3. Amazon Kinesis Data Streams
  4. Amazon Athena

Explanation

AWS Glue is the managed extract, transform, and load service that also provides a centralized Data Catalog with crawlers that infer schemas automatically. It runs serverless Apache Spark jobs, so no cluster provisioning is required.

Question 2Data Preparation for Machine Learning

Which Amazon S3 feature should be enabled to keep an immutable, time-stamped record of every object-level write and delete for ML training data auditing?

  1. S3 Versioning with Object Lock Correct answer.
  2. S3 Cross-Region Replication
  3. S3 Transfer Acceleration
  4. S3 Intelligent-Tiering

Explanation

S3 Versioning retains prior object versions, and Object Lock adds write-once protection so records cannot be altered or deleted for a retention period. Together they provide an auditable, tamper-evident history of object changes.

Question 3Data Preparation for Machine Learning

A dataset contains a numeric feature whose values are heavily right-skewed with a long tail. A model using gradient descent converges slowly. Which transformation most directly reduces the skew and stabilizes the scale?

  1. Min-max scaling to [0,1]
  2. Log transformation Correct answer.
  3. Removing the median value
  4. One-hot encoding

Explanation

A log transform compresses large values far more than small ones, which pulls in a long right tail and makes the distribution closer to symmetric. Reducing skew helps gradient-based optimization and linear models behave better.

Question 4Data Preparation for Machine Learning

Which format is best suited for columnar analytics where a query reads only a few of many wide columns from data stored in Amazon S3?

  1. Uncompressed XML
  2. CSV
  3. Apache Parquet Correct answer.
  4. JSON lines

Explanation

Parquet stores data by column, so a query can read only the columns it references and skip the rest. It also carries schema metadata and compresses well, which lowers scan volume and cost.

Question 5Data Preparation for Machine Learning

An ML team wants a fully managed feature store that supports online low-latency serving and offline training datasets with point-in-time correctness. Which AWS service provides this?

  1. AWS Lake Formation
  2. AWS Glue DataBrew
  3. Amazon SageMaker Feature Store Correct answer.
  4. Amazon EMR

Explanation

SageMaker Feature Store provides an online store for low-latency inference lookups and an offline store for training, with event-time tracking that supports point-in-time joins. This prevents label leakage from future feature values.

Question 6Data Preparation for Machine Learning

Which AWS service is designed for real-time streaming ingestion of clickstream events that multiple consumer applications must read independently?

  1. Amazon Kinesis Data Streams Correct answer.
  2. AWS Database Migration Service
  3. Amazon Kinesis Data Firehose
  4. Amazon S3 Batch Operations

Explanation

Kinesis Data Streams retains records for a configurable period and lets multiple independent consumers read the same stream at their own pace. Firehose instead delivers data to a destination and is not built for many parallel readers.

Question 7Data Preparation for Machine Learning

A data scientist must split a highly imbalanced fraud dataset for training. Which practice best preserves the class ratio in both the training and validation sets?

  1. Using only the first 80 percent of rows
  2. Stratified split on the label Correct answer.
  3. Random split without stratification
  4. Splitting by row order

Explanation

A stratified split samples within each class so the minority and majority proportions are preserved in every subset. This keeps validation metrics representative when one class is rare.

Question 8Data Preparation for Machine Learning

Which practice best protects training data against leakage of sensitive personal identifiers before it is used to fit a model?

  1. Increasing the number of training epochs
  2. Storing the raw data in a public S3 bucket
  3. Duplicating the identifier column for redundancy
  4. Detecting and masking or removing PII during preparation Correct answer.

Explanation

Identifying PII and then masking, tokenizing, or removing it during preparation keeps sensitive values out of the training set and downstream artifacts. This reduces regulatory and privacy risk before the model ever sees the data.

Question 9Data Preparation for Machine Learning

A team stores raw training data in Amazon S3 and needs column-level and row-level access control that integrates with AWS Glue Data Catalog tables. Which service should they use?

  1. Amazon SageMaker Ground Truth
  2. AWS Lake Formation Correct answer.
  3. AWS Glue DataBrew
  4. Amazon Macie

Explanation

Lake Formation centralizes fine-grained permissions, including column-level and row-level filters, on Data Catalog tables and underlying S3 data. It enforces those permissions for integrated analytics engines.

Question 10Data Preparation for Machine Learning

A Glue crawler keeps creating duplicate tables because the same dataset is written under many partition-like prefixes with slightly different schemas. Which approach most directly fixes the catalog duplication?

  1. Run the crawler once per file
  2. Disable the Data Catalog
  3. Convert all files to CSV
  4. Point the crawler at the dataset root and enable partition discovery Correct answer.

Explanation

Crawling the dataset root with partition discovery lets the crawler register one table whose partitions are inferred from the folder layout. Crawling individual prefixes or files instead produces separate tables per path.

Question 11Data Preparation for Machine Learning

A feature has 3 percent missing values that appear to be missing completely at random. Which imputation strategy is generally the safest default when no domain knowledge is available?

  1. Replace missing values with the maximum value
  2. Impute the mean or median of the observed values Correct answer.
  3. Replace missing values with zero
  4. Delete every row containing the feature

Explanation

When values are missing completely at random, imputing the mean or median preserves the central tendency and keeps all rows without inventing extreme values. The median is preferred for skewed distributions.

Question 12Data Preparation for Machine Learning

A pipeline joins a features table to a labels table using event timestamps. Which join condition prevents future feature values from leaking into the training set?

  1. Join where feature event time is less than or equal to label event time Correct answer.
  2. Join where feature event time is greater than label event time
  3. Join on the latest available feature row regardless of time
  4. Join on row number equality

Explanation

A point-in-time join takes, for each label, only feature values that existed at or before the label's event time. This mirrors what would be known at inference and prevents label leakage.

Question 13Data Preparation for Machine Learning

A team needs to convert a large set of raw JSON logs in S3 into partitioned Parquet, running the transformation on a schedule with minimal operational overhead. Which combination is most appropriate?

  1. A single EC2 instance running a cron script
  2. Amazon Kinesis Data Firehose with no transformation
  3. AWS Glue job with a scheduled trigger writing partitioned Parquet Correct answer.
  4. Amazon Athena queries saved as CSV exports

Explanation

A Glue Spark job handles the JSON-to-Parquet conversion at scale and can write partitioned output, while a scheduled trigger runs it without managing servers. This matches the batch, low-overhead requirement.

Question 14Data Preparation for Machine Learning

A model trained on a dataset with a categorical feature having 5,000 distinct values shows poor generalization. Which encoding approach best limits dimensionality while retaining information?

  1. Target or frequency encoding with rare-category grouping Correct answer.
  2. Dropping the feature entirely
  3. Ordinal encoding by alphabetical order
  4. One-hot encoding all 5,000 categories

Explanation

Grouping rare categories and using frequency or target encoding condenses high-cardinality features into a small number of informative columns. One-hot encoding would instead create thousands of sparse columns.

Question 15Data Preparation for Machine Learning

A data scientist notices that a feature has a correlation of 0.99 with the target in the training set but near zero in production. What is the most likely data preparation problem?

  1. The model used too few epochs
  2. The feature was standardized incorrectly
  3. The training set was too small
  4. The feature was computed using the target or post-outcome data Correct answer.

Explanation

An almost perfect training correlation that vanishes in production is a classic sign of target leakage, where the feature encodes information only available after the outcome. The fix is to recompute the feature using only pre-outcome inputs.

Question 16Data Preparation for Machine Learning

Which SageMaker capability lets a team run a reproducible, versioned data preparation workflow that tracks inputs, outputs, and parameters across runs?

  1. SageMaker Pipelines Correct answer.
  2. SageMaker Model Monitor
  3. SageMaker JumpStart
  4. SageMaker Debugger

Explanation

SageMaker Pipelines defines processing, training, and evaluation steps as a versioned DAG, and lineage tracking records the inputs, outputs, and parameters of each run. This makes data preparation reproducible and auditable.

Question 17Data Preparation for Machine Learning

A team must anonymize names and account numbers in a large text corpus stored in S3 before labeling. Which AWS service is purpose-built to detect and classify such sensitive data at scale?

  1. Amazon Macie Correct answer.
  2. Amazon Polly
  3. Amazon Comprehend Medical only
  4. AWS Glue DataBrew only

Explanation

Amazon Macie uses managed classifiers and pattern matching to discover and classify sensitive data such as personal identifiers in S3. It produces findings that guide masking or removal before the data reaches labeling.

Question 18Data Preparation for Machine Learning

A dataset has a numeric feature with extreme outliers that are known to be data-entry errors. Which preparation step is most defensible?

  1. Cap or remove the erroneous values and document the rule Correct answer.
  2. Replace all values with the mean
  3. Square the values to reduce their relative size
  4. Leave them unchanged to avoid bias

Explanation

When outliers are confirmed errors, capping at a plausible bound or removing them corrects the data, and documenting the rule keeps the process reproducible. This preserves the rest of the distribution instead of distorting it.

Question 19Data Preparation for Machine Learning

A team wants to query training data directly in S3 with standard SQL and pay per query without loading it into a database. Which service fits best?

  1. Amazon Redshift provisioned cluster
  2. Amazon Athena Correct answer.
  3. Amazon ElastiCache
  4. Amazon DynamoDB

Explanation

Athena runs SQL over data in S3 through the Glue Data Catalog and charges per amount of data scanned. It requires no cluster provisioning or data loading.

Question 20Data Preparation for Machine Learning

During preparation, a team must reduce the storage footprint of a Parquet dataset in S3 while keeping it splittable and readable by Spark. Which approach is most appropriate?

  1. Store each row as a separate small file
  2. Convert to a single uncompressed CSV
  3. Compress with Snappy or Gzip inside Parquet Correct answer.
  4. Base64-encode every column

Explanation

Parquet supports block compression with codecs such as Snappy or Gzip, which shrink files while keeping them splittable and directly readable by Spark. This lowers storage and scan cost without changing the schema.

Question 21Data Preparation for Machine Learning

A features table is updated continuously, and a training job must use exactly the feature values that were available at each historical label timestamp. Which mechanism guarantees this?

  1. Reading the current online store snapshot for all rows
  2. Using the average of all feature values per entity
  3. A point-in-time join against the offline store using event times Correct answer.
  4. Joining on the highest feature version number

Explanation

A point-in-time join retrieves, for each label, the feature values whose event time is at or before that label's timestamp. This reconstructs the historical state and avoids leakage from later updates.

Question 22Data Preparation for Machine Learning

A team must enforce that only approved columns of a Glue table are visible to one analytics group while other groups see all columns, across Athena and Redshift Spectrum. Which approach satisfies this?

  1. Lake Formation column-level permissions on the catalog table Correct answer.
  2. Glue crawler schedules per group
  3. Athena workgroup query limits
  4. S3 bucket policies alone

Explanation

Lake Formation applies column-level and row-level permissions to Data Catalog tables and enforces them across integrated engines such as Athena and Redshift Spectrum. Bucket policies act at the object level and cannot hide individual columns.

Question 23Data Preparation for Machine Learning

A pipeline ingests streaming events and must deliver them to S3 in Parquet with near-real-time latency and automatic partitioning by date, without writing custom consumer code. Which service configuration fits best?

  1. Kinesis Data Streams with a custom Lambda consumer writing CSV
  2. S3 Batch Operations with a Lambda function
  3. AWS DMS with full load plus CDC to S3 as CSV
  4. Kinesis Data Firehose with AWS Glue schema conversion and dynamic partitioning Correct answer.

Explanation

Firehose can convert records to Parquet using Glue schema conversion and route them into date-based prefixes with dynamic partitioning. It handles delivery without custom consumer code.

Question 24Data Preparation for Machine Learning

A training dataset contains 40 percent duplicates across train and validation splits, inflating validation accuracy. Which preparation change most directly corrects the evaluation?

  1. Deduplicate records before splitting and split by group or entity Correct answer.
  2. Standardize features after splitting
  3. Increase the validation split to 50 percent
  4. Train for more epochs

Explanation

Near-duplicate records spanning splits let the model memorize and inflate validation scores. Deduplicating before splitting, and grouping by entity when duplicates share a source, keeps the validation set genuinely unseen.

Question 25Data Preparation for Machine Learning

A feature pipeline computes a rolling seven-day average of transactions, but the window includes the current day's transactions that also determine the label. Which correction removes the leakage while keeping the feature meaningful?

  1. Shorten the window to one day including the current day
  2. Compute the average over the entire dataset
  3. Replace the average with the raw current-day count
  4. Shift the window to end before the label event time Correct answer.

Explanation

Shifting the rolling window so it ends before the label event ensures the feature uses only information available prior to the outcome. The feature stays informative while no longer encoding the label period.

Question 26Data Preparation for Machine Learning

A data engineer needs a fully managed, serverless extract-transform-load service that can run Python-based Apache Spark jobs to prepare training data without provisioning clusters. Which AWS service fits this requirement?

  1. Amazon EMR on EC2
  2. AWS Database Migration Service
  3. Amazon Kinesis Data Streams
  4. AWS Glue Correct answer.

Explanation

AWS Glue is a serverless data integration service whose jobs run on managed Apache Spark infrastructure, so teams write transformation scripts without provisioning or scaling clusters. It also provides a Data Catalog and scheduling for repeatable preparation pipelines.

Question 27Data Preparation for Machine Learning

A machine learning engineer wants a central metadata repository that stores table definitions, schema versions, and partition information for datasets in Amazon S3 so that Athena, Redshift Spectrum, and Glue jobs can all query the same tables. Which component provides this?

  1. AWS Glue Data Catalog Correct answer.
  2. Amazon Athena workgroups
  3. AWS Lake Formation blueprints
  4. Amazon S3 Inventory

Explanation

The AWS Glue Data Catalog is a managed metastore holding databases, tables, schemas, and partition metadata that multiple analytics engines share. Defining a table once in the catalog lets Athena, Redshift Spectrum, and Glue ETL reference identical structure and location.

Question 28Data Preparation for Machine Learning

A team is choosing a columnar file format for a large training dataset in Amazon S3. They want efficient compression and the ability to read only the columns a query needs. Which format best meets this requirement?

  1. JSON Lines
  2. Plain text logs
  3. Apache Parquet Correct answer.
  4. CSV

Explanation

Parquet stores data column by column with embedded schema and compression, so engines can skip columns not referenced by a query and read far less data. Row-oriented text formats require reading entire records.

Question 29Data Preparation for Machine Learning

A data scientist wants a quick, code-light way to profile a CSV file, detect data types, and generate summary statistics before building a model. Which approach is the most direct fit?

  1. Load the file into Amazon Neptune and query it with Gremlin
  2. Write a custom Spark job to compute means and counts
  3. Run AWS Glue DataBrew profile jobs on the dataset Correct answer.
  4. Enable S3 Transfer Acceleration on the bucket

Explanation

Glue DataBrew provides visual profiling that computes column statistics, detects data types, and highlights data quality issues without writing transformation code. This shortens the exploratory step before formal pipeline development.

Question 30Data Preparation for Machine Learning

A feature stores customer ages, and several records contain negative values that are impossible. Which data preparation action is most appropriate?

  1. Replace the entire column with its mean
  2. Leave the values unchanged because models are robust to any numeric range
  3. Convert the column to a string type
  4. Flag and correct or remove the invalid records before training Correct answer.

Explanation

Values that violate known domain constraints are data quality errors, so they should be identified and either corrected at the source or excluded from training. Training on impossible values teaches the model patterns that cannot occur in production.

Question 31Data Preparation for Machine Learning

A team must store raw training data so that every object is encrypted at rest with a key they manage and can audit separately from other AWS accounts. Which Amazon S3 configuration satisfies this?

  1. Client-side encryption with a key stored in the source code repository
  2. Default server-side encryption with AWS KMS customer managed keys Correct answer.
  3. No encryption because the bucket is private
  4. Server-side encryption with Amazon S3 managed keys

Explanation

SSE-KMS with a customer managed key lets the team control key policy, rotation, and audit trails through AWS CloudTrail independently of other accounts. S3 managed keys are convenient but do not give the same key-level control.

Question 32Data Preparation for Machine Learning

A pipeline must ingest files dropped into an S3 bucket and start a Glue job automatically whenever a new object arrives. Which mechanism accomplishes this with minimal custom code?

  1. Poll the bucket every minute with a script on an EC2 instance
  2. Manually start the job after each upload
  3. Schedule the job to run once per day regardless of new files
  4. Configure an S3 event notification that triggers the job via EventBridge Correct answer.

Explanation

S3 event notifications can publish object-created events to Amazon EventBridge, which routes them to a target that starts the Glue job. This event-driven design reacts to each arrival without polling infrastructure.

Question 33Data Preparation for Machine Learning

A data scientist needs to read a large Parquet dataset stored in S3 into a SageMaker notebook for exploration while minimizing data transfer and keeping the data in place. Which approach is most appropriate?

  1. Download the entire dataset to the notebook's local disk first
  2. Query and load the data with Athena or the S3 read APIs directly from the notebook Correct answer.
  3. Copy the data into the notebook's root volume each session
  4. Export the data to a CSV on a personal laptop

Explanation

Reading directly from S3 through Athena or the S3 APIs keeps storage and compute separate, so the notebook only pulls the columns and rows it needs. This avoids duplicating large datasets onto limited local storage.

Question 34Data Preparation for Machine Learning

A dataset contains a categorical feature with values such as 'red', 'green', and 'blue'. A model requires numeric inputs. Which preparation step is required?

  1. Sort the rows alphabetically by category
  2. Drop the feature because it is not numeric
  3. Normalize the string lengths of the category names
  4. Encode the categories as numeric values such as one-hot vectors Correct answer.

Explanation

Most algorithms require numeric matrices, so categorical values must be transformed, for example with one-hot or ordinal encoding. Encoding preserves the category information in a form the model can consume.

Question 35Data Preparation for Machine Learning

A feature representing annual income ranges from about 20,000 to 2,000,000, while another feature ranges from 0 to 1. A distance-based model performs poorly. Which preparation step most directly addresses this?

  1. Add more rows to the dataset
  2. Remove the 0-to-1 feature
  3. Scale or standardize the numeric features to comparable ranges Correct answer.
  4. Convert both features to strings

Explanation

Distance-based algorithms are dominated by features with larger numeric ranges, so scaling or standardizing puts features on comparable footing. This lets each feature contribute proportionally to the distance computation.

Question 36Data Preparation for Machine Learning

A team stores training data in S3 with a partition layout of year, month, and day. Analysts frequently filter on a single day. Which benefit does this layout provide?

  1. It guarantees the data is deduplicated across partitions
  2. It converts the files to a row-based format
  3. Queries can skip partitions that do not match the filter, reducing scanned data Correct answer.
  4. It automatically encrypts each partition with a separate key

Explanation

Partitioning by commonly filtered columns lets query engines prune directories that cannot satisfy the predicate, so less data is read. This lowers query cost and latency for selective filters.

Question 37Data Preparation for Machine Learning

A data scientist must join a small reference table of product categories to a very large transaction table in a Spark-based Glue job. Which technique best reduces shuffle overhead?

  1. Broadcast the small table to each executor for a map-side join Correct answer.
  2. Collect the large table to the driver and join in memory
  3. Convert both tables to CSV before joining
  4. Repartition both tables by a random key before joining

Explanation

Broadcasting the small table avoids shuffling the large table across the network because each executor holds a local copy for the join. This is a standard optimization when one side fits comfortably in executor memory.

Question 38Data Preparation for Machine Learning

A team wants to catalog a dataset whose schema evolves over time, adding new columns each quarter, and still query all historical files. Which approach handles schema evolution most cleanly?

  1. Use a format and catalog configuration that merges schema changes, such as Parquet with schema merging enabled Correct answer.
  2. Reject any new columns to keep the schema constant
  3. Rewrite all historical files to a fixed schema on every change
  4. Store each quarter's data in a separate bucket with no catalog entry

Explanation

Formats such as Parquet combined with schema merging in the query engine or catalog allow new columns to be added while older files remain readable with nulls for absent fields. This preserves history without rewriting data.

Question 39Data Preparation for Machine Learning

A team must ensure that a Glue job processing personal data masks email addresses before writing results to a curated bucket. Which built-in capability should they use?

  1. Glue DataBrew or Glue transforms with PII detection and masking recipes Correct answer.
  2. S3 versioning on the curated bucket
  3. Athena query result encryption
  4. CloudWatch Logs retention policies

Explanation

Glue DataBrew and Glue provide PII detection and masking transformations that can replace or hash sensitive fields during the job. Applying masking in the transformation step ensures sensitive values never reach the curated output.

Question 40Data Preparation for Machine Learning

A machine learning engineer needs to version datasets so that each training run references an immutable snapshot and can be reproduced later. Which approach best satisfies this?

  1. Rely on the file modification timestamp as the version identifier
  2. Overwrite the same S3 prefix for each new dataset version
  3. Register datasets in SageMaker Feature Store or use S3 versioning with recorded object versions Correct answer.
  4. Keep only the latest file on a notebook's local disk

Explanation

Immutable snapshots, whether through a feature store or recorded S3 object versions, let a training run point to exact data that can be retrieved again. This is the foundation of reproducible experiments.

Question 41Data Preparation for Machine Learning

A data engineer must convert a numeric feature with a heavily right-skewed distribution so that a linear model behaves better. Which transformation is commonly appropriate?

  1. Reverse the order of the rows
  2. Multiply the feature by a large constant
  3. Apply a logarithmic transformation to the feature Correct answer.
  4. Round the feature to the nearest thousand

Explanation

A log transform compresses large values and can make a right-skewed distribution more symmetric, which often improves linear model assumptions. It should be applied only to strictly positive values or after an offset.

Question 42Data Preparation for Machine Learning

A team wants to validate incoming training data against expected column types, allowed ranges, and null thresholds before a pipeline proceeds. Which AWS service provides configurable data quality rules that can fail a job when violations occur?

  1. AWS Glue Data Quality Correct answer.
  2. AWS Config
  3. Amazon GuardDuty
  4. Amazon Macie

Explanation

Glue Data Quality lets teams define rules such as completeness, uniqueness, and range checks, and can stop a job when results fall below thresholds. This enforces data contracts before bad data reaches training.

Question 43Data Preparation for Machine Learning

A pipeline writes many small Parquet files to S3, and downstream queries are slow because of per-file overhead. Which preparation step most directly improves query performance?

  1. Convert the files to uncompressed CSV
  2. Add more partitions to split each small file further
  3. Increase the number of small files to improve parallelism
  4. Compact small files into larger files of a target size Correct answer.

Explanation

Query engines pay fixed overhead per file, so many tiny files slow scans even when total bytes are small. Compaction into larger files reduces that overhead and improves throughput.

Question 44Data Preparation for Machine Learning

A data scientist is preparing image data for a computer vision model and must ensure that augmented copies of the same image never appear in both training and validation sets. Which practice achieves this?

  1. Randomly split the augmented images into training and validation
  2. Use a larger batch size during training
  3. Apply augmentation only to the validation set
  4. Group all derived copies of an image and split by group before augmenting Correct answer.

Explanation

Augmented variants of one source image are near-duplicates, so splitting after augmentation leaks information across sets. Splitting by source group first and then augmenting within each split keeps validation independent.

Question 45Data Preparation for Machine Learning

A team must ingest records from an on-premises relational database into S3 incrementally, capturing only rows changed since the last run, without modifying the source application. Which approach is most appropriate?

  1. Use AWS Database Migration Service with ongoing replication based on change data capture Correct answer.
  2. Export the whole database once and never refresh it
  3. Manually copy changed rows with a spreadsheet
  4. Run a full table export every hour and overwrite the S3 prefix

Explanation

DMS supports change data capture so only inserts, updates, and deletes since the last checkpoint are replicated, reducing load on the source. This keeps the S3 copy current without repeated full exports.

Question 46Data Preparation for Machine Learning

A feature engineering job computes aggregates over a customer's entire history, including events that occur after the label timestamp. Validation accuracy is high but production performance is poor. What is the most likely cause?

  1. Insufficient feature scaling for the model
  2. Too few partitions in the output dataset
  3. Target leakage from features that incorporate post-label information Correct answer.
  4. Incorrect file compression settings

Explanation

When a feature is computed using events that happen after the prediction point, it encodes information unavailable at inference time, which inflates offline metrics. Feature windows must be bounded by the label timestamp to reflect production conditions.

Question 47Data Preparation for Machine Learning

A data engineer needs to process a dataset too large for a single machine using a Glue job, and the join keys are heavily skewed so a few executors do all the work. Which technique best mitigates the skew?

  1. Reducing the number of executors to lower contention
  2. Disabling compression on the shuffle data
  3. Salting the skewed keys to spread them across partitions before joining Correct answer.
  4. Increasing the driver instance size only

Explanation

Salting appends a random suffix to hot keys so their records distribute across more partitions, balancing the shuffle workload. After the join, the salt is removed to restore the original keys.

Question 48Data Preparation for Machine Learning

A team must ensure that a curated dataset in S3 is readable only by specific IAM principals and that column-level restrictions apply when queried through Athena. Which combination best meets both requirements?

  1. Public read access on the bucket with client-side filtering
  2. A single IAM role shared by all analysts
  3. S3 object tags alone without any policy enforcement
  4. AWS Lake Formation permissions for column and table access combined with S3 bucket policies Correct answer.

Explanation

Lake Formation enforces fine-grained table and column permissions for integrated analytics services, while bucket policies and IAM control direct S3 access. Using both layers covers catalog queries and raw object reads.

Question 49Data Preparation for Machine Learning

A pipeline produces a training dataset nightly. Reviewers notice that row counts dropped sharply on some nights with no schema change. Which preparation control best detects this regression before the dataset is published?

  1. Shorten the S3 object key prefix
  2. Increase the training job's instance count
  3. Add automated data quality checks on row count and distribution with alerts and gating Correct answer.
  4. Rely on reviewers to notice fewer rows in dashboards

Explanation

Automated quality rules comparing metrics such as row counts and distributions against expected baselines catch silent regressions and can block publication. Human dashboards alone are too slow and unreliable for nightly pipelines.

Question 50Data Preparation for Machine Learning

A data scientist must split a time-ordered sales dataset for forecasting. Which splitting strategy best reflects how the model will be used in production?

  1. Train on later periods and validate on earlier periods
  2. Assign rows alternately to train and validation
  3. Train on earlier periods and validate on later, non-overlapping periods Correct answer.
  4. Randomly shuffle all rows before splitting

Explanation

Forecasting models predict future values from past data, so validation should use periods that occur after the training window. Random or interleaved splits let the model see future information during training.