Curated

Data Preparation for ML and AI 1 (1.1–1.2)

0 votes

Questions60

  1. Question 1

    Data Preparation for ML and AI

    An ML engineer needs a point-in-time copy of a large DynamoDB table in Amazon S3 without consuming the table's read capacity. Point-in-time recovery is enabled. Which extraction method should the engineer use?

    Show the answer

    Correct answerC. Export the table to S3 at the required timestamp.

    AWhy not this: DynamoDB Streams captures changes, not a complete point-in-time copy of the existing table.

    BWhy not this: Parallel Scan consumes table read capacity and does not provide table-wide snapshot isolation.

    CWhy this is right: Point-in-time export uses the backup system to extract table data without consuming read capacity.

    DWhy not this: The scan connector reads the live table and consumes its read capacity.

    DynamoDB export to S3 produces a point-in-time dataset without consuming read capacity. A parallel Scan consumes read capacity and does not provide a consistent snapshot across the entire scan.

    Open this question
  2. Question 2

    Data Preparation for ML and AI

    Which AWS Glue capability reads rows from an Amazon RDS for PostgreSQL database into an ETL job?

    Show the answer

    Correct answerD. A JDBC source connection

    AWhy not this: A crawler discovers schemas and creates catalog metadata rather than extracting rows into the ETL job.

    BWhy not this: An S3 target receives job output; it does not read rows from PostgreSQL.

    CWhy not this: A Kafka source reads event records from Kafka topics, not relational tables through a database connection.

    DWhy this is right: A JDBC source lets an AWS Glue job connect to PostgreSQL and read relational data.

    An AWS Glue JDBC source connects to a relational database and reads its rows for processing. A crawler discovers metadata and populates the Data Catalog; it does not load the rows into an ETL job.

    Open this question
  3. Question 3

    Data Preparation for ML and AI

    Training workers in multiple Availability Zones must concurrently read and update the same files through standard POSIX file operations. Which storage configuration should the engineer choose?

    Show the answer

    Correct answerD. An Amazon EFS Regional file system

    AWhy not this: S3 provides object operations rather than native shared POSIX file operations.

    BWhy not this: EBS Multi-Attach does not span Availability Zones and is not a managed shared file system.

    CWhy not this: Instance store is local to an EC2 instance and cannot provide the required shared file system.

    DWhy this is right: EFS Regional supports shared file-system access by workers across multiple Availability Zones.

    Amazon EFS Regional provides shared file access across Availability Zones using file-system operations. EBS Multi-Attach is limited to instances in the same Availability Zone and requires appropriate concurrent-write coordination.

    Open this question
  4. Question 4

    Data Preparation for ML and AI

    An engineer must extract millions of documents from a changing OpenSearch Service index using deep pagination. The extraction must reflect a fixed index state and support retrying a page while its search context remains valid. Which approach meets these requirements?

    Show the answer

    Correct answerA. Use search_after pagination with a point-in-time context.

    AWhy this is right: A point-in-time context preserves the view, while search_after permits deep pagination and repeatable page requests.

    BWhy not this: Deep from-and-size pagination is resource-intensive, and live searches do not preserve a fixed index view.

    CWhy not this: search_after supports deep pagination, but live index changes can alter results between requests.

    DWhy not this: Independently refreshed views do not provide one consistent index state for the complete extraction.

    A point-in-time context preserves an index view, and search_after supports deep pagination within it. Using search_after against the live index does not preserve a fixed view as documents change.

    Open this question
  5. Question 5

    Data Preparation for ML and AI

    An organization must retain training archives for seven years, preventing even the root user from deleting retained versions or shortening their retention. Archives are rarely accessed, and standard restores taking approximately 3–5 hours are acceptable; which configuration minimizes storage cost while meeting these requirements?

    Show the answer

    Correct answerC. S3 Object Lock compliance mode with S3 Glacier Flexible Retrieval

    AWhy not this: Authorized users can bypass governance retention, so it does not provide the required protection from the root user.

    BWhy not this: Compliance mode meets retention requirements, but Deep Archive standard restores typically take 12 hours.

    CWhy this is right: Compliance mode enforces immutable retention, and Flexible Retrieval offers standard restores typically taking 3–5 hours.

    DWhy not this: Versioning preserves versions but does not prevent privileged users from permanently deleting them.

    Object Lock compliance mode prevents deletion or shortened retention even by the root user. Glacier Flexible Retrieval standard restores typically take 3–5 hours; Deep Archive standard restores typically take 12 hours, while governance retention can be bypassed with permission.

    Open this question
  6. Question 6

    Data Preparation for ML and AI

    A provisioned Kinesis Data Streams stream throttles writes on one shard while other shards are lightly used; most records share one partition key. Record ordering is unnecessary, and adding shards has not helped; which change best resolves the bottleneck?

    Show the answer

    Correct answerB. Distribute records across more partition keys

    AWhy not this: Enhanced fan-out provides dedicated consumer read throughput, not additional producer write capacity.

    BWhy this is right: More evenly distributed partition keys spread incoming writes across shards; ordering is not required here.

    CWhy not this: Aggregation retains partition-key routing and does not resolve the concentration of traffic on one shard.

    DWhy not this: Longer retention changes how long records remain available, not the capacity of the overloaded shard.

    A partition key maps to one shard, so a dominant key can overload that shard despite spare capacity elsewhere. Using more partition keys distributes writes; producer aggregation can reduce record-count pressure but does not distribute a hot key across shards.

    Open this question
  7. Question 7

    Data Preparation for ML and AI

    Writes to a provisioned DynamoDB table are throttled although the table has spare write capacity. Monitoring shows that a global secondary index has exhausted its provisioned write capacity; what should the engineer do?

    Show the answer

    Correct answerB. Increase the index's provisioned write capacity

    AWhy not this: The table already has spare write capacity, and its capacity allocation does not increase the index's allocation.

    BWhy this is right: Additional index write capacity supports index updates and removes the identified source of back pressure.

    CWhy not this: Read capacity does not support the index updates required by incoming writes.

    DWhy not this: The exhausted resource is index write capacity, not index read capacity.

    Insufficient write capacity on a global secondary index can throttle writes to its base table. Increasing the table's write capacity does not resolve the index's independent write-capacity bottleneck.

    Open this question
  8. Question 8

    Data Preparation for ML and AI

    Which Amazon S3 features provide encryption at rest and prevent object-version deletion during a mandatory retention period? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. S3 Object Lock in compliance modeB. Server-side encryption with AWS KMS keys

    AWhy this is right: Compliance mode prevents deletion of protected object versions during their retention period, including by the root user.

    BWhy this is right: Server-side encryption with AWS KMS keys encrypts object data at rest.

    CWhy not this: Lifecycle expiration manages object retention costs; it does not enforce protection against deletion.

    DWhy not this: Versioning preserves object versions but does not prevent authorized users from permanently deleting unprotected versions.

    Server-side encryption with AWS KMS keys encrypts stored objects, and Object Lock compliance mode prevents deletion of protected versions during retention. Versioning alone preserves versions but does not prevent their permanent deletion.

    Open this question
  9. Question 9

    Data Preparation for ML and AI

    An ingestion worker's gp3 volume consistently reaches its configured throughput limit while IOPS remain below their limit. The EC2 instance has spare EBS bandwidth; what should the engineer change?

    Show the answer

    Correct answerD. Increase the volume's provisioned throughput

    AWhy not this: Additional memory does not raise the EBS volume's configured throughput limit.

    BWhy not this: Increasing gp3 capacity alone does not increase its configured throughput.

    CWhy not this: The workload is below its IOPS limit, so additional IOPS do not address the measured throughput bottleneck.

    DWhy this is right: Provisioning additional throughput raises the limit that the workload is reaching.

    A gp3 volume supports independently provisioned throughput, IOPS, and capacity. Increasing throughput addresses the observed bottleneck; increasing IOPS does not resolve a throughput ceiling when the IOPS limit has not been reached.

    Open this question
  10. Question 10

    Data Preparation for ML and AI

    An ingestion worker's EBS-backed file system is full and reports “No space left on device.” What should the engineer do to add usable space?

    Show the answer

    Correct answerB. Enlarge the volume and extend the file system

    AWhy not this: Throughput controls transfer rate and does not increase file-system capacity.

    BWhy this is right: A larger volume supplies capacity, and extending the file system makes that capacity available for files.

    CWhy not this: IOPS controls operation rate and does not add space to a full file system.

    DWhy not this: Memory and file-cache changes do not expand persistent storage capacity.

    Increasing the EBS volume size and extending the file system makes additional storage usable by the worker. Increasing IOPS changes storage performance, not the amount of space available for files.

    Open this question
  11. Question 11

    Data Preparation for ML and AI

    An analyst uses AWS Glue DataBrew to preview trimming whitespace and splitting address columns in an S3 dataset. What should the analyst use to apply the same transformations to the full dataset without writing code?

    Show the answer

    Correct answerA. A recipe job using the published recipe

    AWhy this is right: A recipe job runs the published transformation steps against the dataset without custom code.

    BWhy not this: A crawler discovers schema and populates catalog metadata rather than cleaning the records.

    CWhy not this: A profile job analyzes data characteristics rather than executing the recipe's transformations.

    DWhy not this: A labeling job creates annotations for training data rather than executing DataBrew transformations.

    A DataBrew recipe job applies the recipe's transformation steps to the dataset and writes the results. A profile job computes data quality and statistical information rather than applying the cleaning steps.

    Open this question
  12. Question 12

    Data Preparation for ML and AI

    A Spark job on Amazon EMR enriches a multi-terabyte fact dataset with a lookup table that fits comfortably in each executor's memory. A shuffle join stalls on one heavily skewed key, and all matching rows must be retained without changing cluster capacity. Which change BEST addresses the bottleneck?

    Show the answer

    Correct answerD. Broadcast the lookup table for the join.

    AWhy not this: More hash partitions do not distribute a single hot key across multiple partitions.

    BWhy not this: Hash partitioning by the same skewed key still places that key's fact records in one partition.

    CWhy not this: Deduplicating by join key discards fact records and violates the retention requirement.

    DWhy this is right: The lookup fits in executor memory, allowing a broadcast join without the skewed fact-side shuffle.

    Broadcasting the small lookup table avoids shuffling the large fact dataset by the skewed key while preserving matching rows. Increasing shuffle partitions does not split records sharing one hash-partitioned key across partitions.

    Open this question
  13. Question 13

    Data Preparation for ML and AI

    What is a feature group in SageMaker AI Feature Store?

    Show the answer

    Correct answerC. A logical collection of features defined by a common schema

    AWhy not this: An embedding is a numerical representation that could be stored as feature data, not the feature group itself.

    BWhy not this: Document chunks are retrieval inputs rather than the definition of a Feature Store feature group.

    CWhy this is right: A feature group organizes feature definitions under a common schema for storing and retrieving records.

    DWhy not this: A saved cleaning sequence describes a transformation recipe rather than a feature group.

    A feature group is the main Feature Store resource containing features defined by a schema. A saved cleaning sequence is a transformation recipe, not a feature storage resource.

    Open this question
  14. Question 14

    Data Preparation for ML and AI

    A SageMaker AI Feature Store feature group has online and offline storage enabled. Two updates for the same record identifier arrive out of order, with the older event arriving last. Which value determines which update remains in the online store?

    Show the answer

    Correct answerD. The record's configured event time

    AWhy not this: Feature group creation time describes the resource, not the relative freshness of its records.

    BWhy not this: Arrival or completion order does not supersede the record's event time when determining the latest online value.

    CWhy not this: Offline S3 object creation time does not determine which record is retained online.

    DWhy this is right: The event-time feature determines which record is most recent for the same record identifier.

    Feature Store uses the configured event time to retain the latest record for an identifier in the online store. Request completion time does not make a late-arriving older event the latest feature value.

    Open this question
  15. Question 15

    Data Preparation for ML and AI

    An AWS Glue ETL job reads JSON records whose amount field contains both numbers and numeric strings. The job must retain all records and write amount as a numeric Parquet column. Which transformation BEST meets these requirements?

    Show the answer

    Correct answerB. Use a DynamicFrame resolveChoice transformation to cast amount to double.

    AWhy not this: Partitioning separates output records but does not convert amount to a consistent numeric type.

    BWhy this is right: Casting the choice field to double produces a consistent numeric type while retaining the records.

    CWhy not this: Removing amount loses a required output field rather than resolving its mixed types.

    DWhy not this: Crawler schema updates change metadata, not the types of values written by the transformation job.

    DynamicFrame resolveChoice can resolve mixed types by casting numeric strings and numbers to double. A crawler schema policy changes catalog metadata; it does not convert values in the output records.

    Open this question
  16. Question 16

    Data Preparation for ML and AI

    An Amazon Data Firehose stream delivers sensor records to Amazon S3. The team needs to convert temperature units in each record before delivery without managing a streaming cluster. What should the team configure?

    Show the answer

    Correct answerA. An AWS Lambda transformation in the delivery stream

    AWhy this is right: Firehose can invoke Lambda to convert field values before delivering the transformed records.

    BWhy not this: Feature Store ingestion stores features but does not configure transformations within the Firehose delivery path.

    CWhy not this: A crawler discovers schemas and updates catalog metadata rather than transforming incoming records.

    DWhy not this: Lifecycle rules manage object retention and storage classes, not record values.

    Amazon Data Firehose can invoke Lambda to transform records before delivering them. An AWS Glue crawler discovers schemas and creates catalog metadata; it does not change incoming record values.

    Open this question
  17. Question 17

    Data Preparation for ML and AI

    A Lambda function transforms Kinesis records and writes derived features to a database. Retried batches sometimes apply the same feature update twice. Which change BEST prevents duplicate effects?

    Show the answer

    Correct answerC. Make writes idempotent using a stable event identifier.

    AWhy not this: Longer retention increases replay availability rather than preventing duplicate updates.

    BWhy not this: Reserved concurrency controls available execution capacity, not duplicate effects from retried records.

    CWhy this is right: A stable event identifier lets the destination recognize an already-applied update and avoid applying it again.

    DWhy not this: A larger batch changes invocation grouping but does not prevent records from being processed again.

    Kinesis event source mappings provide at-least-once processing, so the same record can be processed again. Idempotent writes prevent repeated processing from applying an update twice; changing batch size does not eliminate retries.

    Open this question
  18. Question 18

    Data Preparation for ML and AI

    A Spark Structured Streaming job calculates five-minute event-time aggregates; records can arrive up to ten minutes late. The job must incorporate these late records while eventually removing old aggregation state. Which configuration BEST meets these requirements?

    Show the answer

    Correct answerD. Use event-time windows with a ten-minute watermark.

    AWhy not this: Processing-time windows group by arrival processing time, and a trigger controls execution frequency rather than allowed lateness.

    BWhy not this: Processing-time grouping does not assign delayed records to their original event-time windows.

    CWhy not this: Checkpoints preserve recovery information but do not define when old aggregation state can be removed.

    DWhy this is right: An event-time watermark accommodates late records within the threshold and permits cleanup of older window state.

    An event-time watermark allows bounded late arrival and enables cleanup of old window state as event time advances. Checkpointing supports recovery but does not establish a lateness policy or bound aggregation state.

    Open this question
  19. Question 19

    Data Preparation for ML and AI

    A team needs low-latency access to current customer features and historical training datasets that exclude feature values recorded after each prediction time. Which design choices meet these requirements in Amazon SageMaker Feature Store? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. Enable the online store for current feature retrieval.E. Select offline records by identifier and event time for each prediction.F. Enable the offline store to retain historical feature records.

    AWhy this is right: The online store supports low-latency retrieval of the latest feature record for an identifier.

    BWhy not this: Ingestion time describes arrival, which can differ from when a feature value became applicable.

    CWhy not this: A stable customer identifier groups updates; unique identifiers per update prevent current-state retrieval by customer.

    DWhy not this: The online store maintains current records, not the historical versions needed to reconstruct past feature states.

    EWhy this is right: Identifier and event-time filtering selects the appropriate historical features without using future values.

    FWhy this is right: The offline store retains historical records for training and analytical queries.

    The online store serves current features, while the offline store retains history for point-in-time training queries. Select historical values by customer identifier and event time; online lookups cannot reconstruct historical states.

    Open this question
  20. Question 20

    Data Preparation for ML and AI

    Several applications consume the same Kinesis Data Streams stream using shared-throughput consumers, and competing reads cause latency spikes despite adequate write capacity. Which change provides dedicated read throughput for each application without changing the stream's shard count?

    Show the answer

    Correct answerA. Register each application as an enhanced fan-out consumer.

    AWhy this is right: Enhanced fan-out gives each registered consumer dedicated read throughput per shard.

    BWhy not this: Partition keys distribute producer records across shards; they do not allocate throughput to consumers.

    CWhy not this: Retention extends the replay window but does not isolate consumer read throughput.

    DWhy not this: More frequent polling still uses shared read capacity and can encounter API limits.

    Enhanced fan-out provides dedicated read throughput per registered consumer per shard. Increasing GetRecords polling frequency does not remove shared read-throughput limits and can increase throttling.

    Open this question
  21. Question 21

    Data Preparation for ML and AI

    Which text format natively represents named fields, nested objects, and arrays without flattening records?

    Show the answer

    Correct answerC. JSON

    AWhy not this: CSV has no native object or array structure; nested content requires additional encoding conventions.

    BWhy not this: ORC supports complex types but is a binary columnar format, not a text format.

    CWhy this is right: JSON natively represents named properties, nested objects, and arrays in text.

    DWhy not this: Parquet supports nested data but is a binary columnar format, not a text format.

    JSON is a text format with native objects and arrays. CSV represents rows of delimited fields and needs additional conventions to encode nested structures; Parquet and ORC support complex types but are binary formats.

    Open this question
  22. Question 22

    Data Preparation for ML and AI

    An Amazon Managed Service for Apache Flink application computes five-minute event-time features from Kinesis records, but records can arrive up to two minutes out of order. The application must include these records before finalizing windows and recover consistent operator state after failures; which configuration meets both requirements?

    Show the answer

    Correct answerA. Use event-time windows with two-minute watermark delay and enable checkpointing.

    AWhy this is right: The watermark delay accommodates the stated disorder, and checkpointing supports consistent operator-state recovery.

    BWhy not this: Checkpointing supports recovery, but processing-time windows do not group records by their event timestamps.

    CWhy not this: Delayed watermarks address ordering, but disabling checkpointing removes the required state-recovery mechanism.

    DWhy not this: Immediate watermarks can close windows before out-of-order records arrive.

    Delayed watermarks accommodate out-of-order event timestamps before windows close, while checkpoints support consistent state recovery. Processing-time windows group records by arrival-time processing rather than the events' timestamps.

    Open this question
  23. Question 23

    Data Preparation for ML and AI

    An ML pipeline repeatedly reads a few numeric columns from a wide dataset in Amazon S3. Which output format best reduces unnecessary column reads while providing compression and typed schemas?

    Show the answer

    Correct answerB. Apache Parquet

    AWhy not this: Uncompressed CSV requires row parsing and provides neither embedded types nor compression.

    BWhy this is right: Parquet supports column projection, compression, and typed schemas for analytical reads.

    CWhy not this: Newline-delimited JSON supports record-oriented ingestion but does not provide columnar reads.

    DWhy not this: Gzip reduces file size, but CSV remains row-oriented and lacks embedded column types.

    Apache Parquet stores data by column, enabling readers to scan selected columns with compression and schema information. Gzip-compressed CSV reduces storage size but remains row-oriented and requires parsing rows to extract columns.

    Open this question
  24. Question 24

    Data Preparation for ML and AI

    An ML team needs to deliver incoming application events to Amazon S3 with managed buffering and minimal operational work. It does not need custom stream processing or consumer-controlled replay; which service should it choose?

    Show the answer

    Correct answerA. Amazon Data Firehose

    AWhy this is right: Data Firehose provides managed buffering and delivery of streaming records to Amazon S3.

    BWhy not this: Managed Flink runs stream-processing applications; custom processing is unnecessary for managed delivery alone.

    CWhy not this: Managed Kafka supports streaming applications but requires additional delivery components and operational decisions.

    DWhy not this: Data Streams provides a replayable stream, but an additional consumer must deliver its records to S3.

    Amazon Data Firehose buffers streaming records and delivers them to destinations such as Amazon S3. Kinesis Data Streams supports custom consumers and replay, but requires a delivery consumer for this use case.

    Open this question
  25. Question 25

    Data Preparation for ML and AI

    A semantic search service is replacing its embedding model with an independently trained model that produces the same vector dimensions. Search must remain available during corpus re-embedding, and each query must use a consistent embedding space. Which migration approach BEST meets these requirements?

    Show the answer

    Correct answerA. Build a separate new-model index; switch query encoding and index together.

    AWhy this is right: A separate index permits backfilling without interrupting service and keeps query and corpus embeddings model-consistent.

    BWhy not this: Normalization changes vector magnitude, not the semantic coordinate system learned by a different model.

    CWhy not this: Incremental replacement mixes embedding spaces, so new-model queries are compared with incompatible old-model vectors.

    DWhy not this: Averaging vectors from unaligned spaces does not produce a query representation compatible with either model.

    Keep the old model and index serving while building a complete index with the new model, then switch the query encoder and index together. Equal dimensions do not align independently trained embedding spaces, so incremental replacement would mix incompatible representations.

    Open this question
  26. Question 26

    Data Preparation for ML and AI

    An engineer uses five-fold cross-validation to evaluate a model that requires standardized numerical features. Each validation fold must represent unseen data, including during preprocessing. How should the engineer calculate and apply the scaling statistics?

    Show the answer

    Correct answerA. Fit on each training fold; transform its training and validation data.

    AWhy this is right: Training-only statistics avoid leakage and give training and validation data the same transformation within each fold.

    BWhy not this: Independent fitting uses validation information and gives validation data a different feature transformation.

    CWhy not this: The first training partition contains records used for validation in other folds, causing leakage in those folds.

    DWhy not this: Whole-dataset statistics expose preprocessing to the validation values before evaluation.

    Each fold must learn its mean and standard deviation only from its training partition, then apply them to both partitions. Fitting before splitting leaks validation information into preprocessing and compromises the evaluation.

    Open this question
  27. Question 27

    Data Preparation for ML and AI

    Which feature engineering technique converts numerical ages into categories such as 18–29, 30–44, and 45–64?

    Show the answer

    Correct answerC. Binning

    AWhy not this: Tokenization divides text into units such as words or subwords, rather than grouping numerical ages.

    BWhy not this: Standardization expresses values relative to a mean and standard deviation, not as intervals.

    CWhy this is right: Binning groups numerical values into discrete intervals such as age ranges.

    DWhy not this: Normalization rescales numerical values or vectors rather than assigning them to age intervals.

    Binning assigns numerical values to discrete intervals. Standardization rescales numerical values using their mean and standard deviation rather than creating age categories.

    Open this question
  28. Question 28

    Data Preparation for ML and AI

    A transaction amount feature contains zeros and has a long right tail. An engineer wants to compress large values while preserving ordering and retaining zeros. Which transformation is MOST appropriate?

    Show the answer

    Correct answerA. Apply a log(1 + x) transformation.

    AWhy this is right: Adding one makes the logarithm defined at zero, while the logarithm compresses large nonnegative values.

    BWhy not this: Standardization changes the mean and scale but preserves the distribution's skewness.

    CWhy not this: Binning groups distinct values together, losing their individual ordering within each bin.

    DWhy not this: Min-max scaling preserves the relative spacing of values rather than compressing the right tail.

    For nonnegative amounts, log(1 + x) compresses large values, preserves ordering, and maps zero to zero. Min-max scaling changes the range but does not reduce the distribution's skewness.

    Open this question
  29. Question 29

    Data Preparation for ML and AI

    A retailer wants shoppers to retrieve product images using natural-language descriptions, including concepts absent from product metadata. Which embedding approach BEST supports direct similarity comparisons between queries and images?

    Show the answer

    Correct answerC. Use a multimodal model with aligned text and image embeddings.

    AWhy not this: Matching dimensions alone does not align the semantic coordinates of independently trained models.

    BWhy not this: Filename embeddings cannot capture visual concepts that are absent from the filenames.

    CWhy this is right: Aligned text and image embeddings represent related concepts near one another in a shared vector space.

    DWhy not this: Token identifiers and pixel values are not aligned semantic representations suitable for direct similarity search.

    An aligned multimodal model places text and images in a shared semantic space, enabling cross-modal similarity search. Equal vector dimensions from unrelated models do not make their representations semantically comparable.

    Open this question
  30. Question 30

    Data Preparation for ML and AI

    A Spark training pipeline reads all columns from a few very large S3 objects. The output must remain compressed while allowing multiple tasks to read different portions of each object; which layout should the engineer write?

    Show the answer

    Correct answerA. Parquet with Snappy compression

    AWhy this is right: Parquet row groups support parallel reads even when their column chunks are compressed with Snappy.

    BWhy not this: Gzip-compressed CSV is not splittable, limiting parallel reading within each large object.

    CWhy not this: A gzip-compressed JSON array does not support independent parallel reads of portions of the object.

    DWhy not this: Line-delimited records do not make a gzip-compressed object splittable.

    Parquet allows Spark to process separate row groups in parallel while retaining compression. A single gzip-compressed text file is not splittable, so adding workers does not parallelize reading different portions of that file.

    Open this question
  31. Question 31

    Data Preparation for ML and AI

    A Spark job merges labeled events with customer risk-score history containing multiple timestamped versions per customer. Each event must receive the most recent score available at its event time; which merge rule prevents future information from entering training data?

    Show the answer

    Correct answerB. Join by customer and select the latest score at or before the event

    AWhy not this: The nearest timestamp can fall after the event, making that score unavailable at prediction time.

    BWhy this is right: Restricting timestamps to the event time or earlier and selecting the latest preserves historical availability.

    CWhy not this: The latest score overall may have been created after the event and leak future information.

    DWhy not this: Averaging all versions incorporates future scores and does not return the applicable historical version.

    A point-in-time join selects the latest score whose timestamp does not exceed the event timestamp. Selecting the nearest score can use a future version and introduce data leakage.

    Open this question
  32. Question 32

    Data Preparation for ML and AI

    An AWS Glue Spark job receives a daily batch of new and changed customer records and must merge it into an Apache Iceberg table in Amazon S3 so that each customer ID keeps exactly one current row. Which operation should the job use?

    Show the answer

    Correct answerB. MERGE INTO the table on customer ID

    AWhy not this: Appending adds changed customers as second rows, so IDs are duplicated.

    BWhy this is right: A merge on customer ID updates existing rows and inserts new ones, leaving one current row per customer.

    CWhy not this: Overwriting replaces the whole table, losing every customer who is not in the day's batch.

    DWhy not this: An inner join drops new customers and unchanged customers, and it does not write the result back as an update.

    MERGE INTO matches incoming rows to existing ones on customer ID, updating matches and inserting new customers in one transaction on the Iceberg table. Appending creates duplicate IDs, overwriting drops customers missing from the batch, and an inner join keeps only customers present in both.

    Open this question
  33. Question 33

    Data Preparation for ML and AI

    Which Spark operation appends rows from datasets with identical schemas while retaining duplicate rows?

    Show the answer

    Correct answerC. Union

    AWhy not this: An inner join combines records based on matching conditions instead of stacking rows.

    BWhy not this: Distinct removes duplicate records rather than combining datasets.

    CWhy this is right: Spark DataFrame union appends records without automatically removing duplicates.

    DWhy not this: Intersection returns records shared by the datasets rather than appending all records.

    Spark DataFrame union appends rows and retains duplicates. An inner join combines matching rows across datasets rather than appending their records.

    Open this question
  34. Question 34

    Data Preparation for ML and AI

    An AWS Glue job enriches S3 transaction records with an RDS customer table containing one row per customer ID. Every transaction must remain, even when no customer matches; which operation should the engineer use?

    Show the answer

    Correct answerC. Left outer join transactions to customers on customer ID

    AWhy not this: A full outer join also includes unmatched customers, introducing rows without transactions.

    BWhy not this: A cross join pairs every transaction with every customer rather than matching customer IDs.

    CWhy this is right: A left outer join preserves all transactions and adds customer attributes where a match exists.

    DWhy not this: An inner join discards transactions whose customer IDs have no match.

    A left outer join preserves every transaction and supplies null customer attributes when no match exists. A full outer join also introduces customer-only rows, which are not transaction records.

    Open this question
  35. Question 35

    Data Preparation for ML and AI

    A search application replaces its text embedding model with another model that produces the same number of dimensions. Retrieval quality drops when new query vectors search existing document vectors. What should the engineer do?

    Show the answer

    Correct answerD. Re-embed the documents with the model used for new queries

    AWhy not this: Retrieving more candidates does not repair similarity scores calculated across incompatible spaces.

    BWhy not this: Zero padding changes dimensionality without aligning the models' learned representations.

    CWhy not this: Standardization changes scale but does not align the semantic coordinates learned by different models.

    DWhy this is right: Using the same model for queries and documents restores a compatible embedding space.

    Queries and documents must use compatible embedding spaces. Equal dimensionality does not make independently trained models' coordinates comparable; standardization cannot align their learned meanings.

    Open this question
  36. Question 36

    Data Preparation for ML and AI

    An engineer fine-tunes a pretrained language model in Amazon SageMaker AI. A custom tokenizer assigns different token IDs from those used during pretraining. Which preprocessing choice BEST preserves compatibility?

    Show the answer

    Correct answerD. Use the tokenizer and vocabulary supplied with the model checkpoint

    AWhy not this: Alphabetical ordering creates a mapping unrelated to the model's learned token associations.

    BWhy not this: Token IDs are discrete lookup indices, not continuous features to standardize.

    CWhy not this: Batch-dependent frequency ranks give tokens inconsistent meanings and break the pretrained mapping.

    DWhy this is right: The checkpoint tokenizer preserves the token-to-ID mapping expected by the pretrained embedding table.

    A pretrained model's embedding table associates specific token IDs with learned representations. Its checkpoint tokenizer preserves those associations; alphabetically reassigning IDs changes which representations the model receives.

    Open this question
  37. Question 37

    Data Preparation for ML and AI

    Which tasks can embedding models support through learned numerical representations? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. Detecting visually similar product imagesB. Matching text descriptions to images using a multimodal modelE. Finding semantically similar support tickets

    AWhy this is right: Image embeddings represent visual characteristics that can be compared for similarity.

    BWhy this is right: A suitable multimodal embedding model maps text and images into a shared representation space.

    CWhy not this: Passage splitting establishes text boundaries; it does not generate learned numerical representations.

    DWhy not this: Reversible pseudonymization replaces identifiers; it is not an embedding operation.

    EWhy this is right: Text embeddings support comparisons based on meaning rather than exact word matches.

    Embeddings represent learned characteristics numerically, supporting semantic text search, visual similarity, and cross-modal matching. Pseudonymization changes identifiers, while passage splitting prepares document boundaries rather than learning representations.

    Open this question
  38. Question 38

    Data Preparation for ML and AI

    Which text preprocessing technique represents an unfamiliar word as smaller vocabulary units?

    Show the answer

    Correct answerC. Subword tokenization

    AWhy not this: Sentence segmentation separates sentences rather than representing parts of individual words.

    BWhy not this: Word-level tokenization uses whole words and does not split them into smaller vocabulary units.

    CWhy this is right: Subword tokenization decomposes words into vocabulary units smaller than whole words.

    DWhy not this: Stop-word removal discards selected common words rather than decomposing unfamiliar words.

    Subword tokenization represents words using smaller units, helping handle unfamiliar words with an existing vocabulary. Word-level tokenization treats complete words as units and can require an unknown-word token.

    Open this question
  39. Question 39

    Data Preparation for ML and AI

    A clinical text classifier needs more training examples, but generic paraphrasing changes medication doses and removes negation. Which augmentation approach BEST preserves the existing labels?

    Show the answer

    Correct answerD. Use clinically reviewed substitutions while protecting doses and negation

    AWhy not this: Unvalidated back-translation can alter clinical facts and invalidate the original labels.

    BWhy not this: Doses and negation carry clinical meaning; removing them can change the classification target.

    CWhy not this: Semantic proximity does not establish clinical interchangeability or preserve the original label.

    DWhy this is right: Clinically validated substitutions and protected spans preserve meaning while adding linguistic variation.

    Domain-specific augmentation must preserve label-relevant clinical meaning, including doses and negation. General-purpose embedding neighbors may be related terms rather than clinically interchangeable terms, so substitutions can invalidate labels.

    Open this question
  40. Question 40

    Data Preparation for ML and AI

    Which operation removes detected email addresses from training text and replaces them with an [EMAIL] marker?

    Show the answer

    Correct answerB. PII redaction

    AWhy not this: Embedding converts text into numerical representations rather than selectively removing email addresses.

    BWhy this is right: Redaction removes the detected email address and substitutes a marker without retaining its value in the text.

    CWhy not this: Case normalization changes capitalization rather than removing sensitive values.

    DWhy not this: Subword tokenization divides text into smaller units while retaining its information.

    PII redaction removes sensitive content and can replace it with a type-specific marker. Subword tokenization splits text into model input units but does not remove the sensitive information.

    Open this question
  41. Question 41

    Data Preparation for ML and AI

    An engineer must remove customer identifiers from training records while preserving joins across daily files. Authorized investigators must be able to recover the original identifiers through a separately controlled mapping. Which approach BEST meets these requirements?

    Show the answer

    Correct answerC. Assign stable tokens and protect the token-to-identifier mapping.

    AWhy not this: A shared marker removes the distinctions needed to join records belonging to different customers.

    BWhy not this: Per-record random identifiers prevent consistent customer linkage across daily files.

    CWhy this is right: Stable tokens support joins, and the protected mapping enables controlled recovery.

    DWhy not this: A one-way hash without a mapping does not support authorized recovery of the original identifier.

    Stable tokenization preserves joins, while a protected mapping supports authorized recovery. Hashing without a mapping can preserve linkage but does not provide a controlled way to recover the original identifiers.

    Open this question
  42. Question 42

    Data Preparation for ML and AI

    A RAG application misses answers when a definition ends one fixed-size chunk and its qualifying exception begins the next. Both passages together fit within the embedding model's input limit. Which preparation change BEST addresses this failure without greatly increasing chunk size?

    Show the answer

    Correct answerB. Add limited overlap between adjacent chunks.

    AWhy not this: Padding adds no source information and cannot reconnect separated passages.

    BWhy this is right: Overlap makes boundary-spanning definitions and exceptions available together for retrieval.

    CWhy not this: Removing common words can damage qualifications and does not preserve boundary context.

    DWhy not this: Vector normalization does not restore text separated by a chunk boundary.

    Limited overlap preserves context that would otherwise be separated at chunk boundaries. Embedding normalization changes vector magnitude, not which source text is available together in a retrieved chunk.

    Open this question
  43. Question 43

    Data Preparation for ML and AI

    A RAG corpus contains multipage pricing tables with column headers on the first page and unit definitions in table notes. Each table exceeds the embedding input limit, but queries require individual product prices with correct units. Which preparation strategy BEST preserves retrievable meaning within the limit?

    Show the answer

    Correct answerC. Split tables into row groups, attaching relevant headers and unit definitions to each group.

    AWhy not this: Truncation drops rows or notes beyond the input limit, making some prices unavailable.

    BWhy not this: Category summaries and averages discard the individual product prices needed by queries.

    CWhy this is right: Bounded row groups retain exact prices and carry the labels and units needed to interpret them.

    DWhy not this: Page boundaries can separate prices from their headers and unit definitions.

    Row groups with relevant headers and unit definitions preserve the context needed to interpret individual prices while respecting the input limit. Page-based splitting can leave later rows disconnected from their headers and units.

    Open this question
  44. Question 44

    Data Preparation for ML and AI

    A team prepares PDF manuals for a RAG application that must cite the original file and page for each retrieved passage. What should the team preserve with each chunk?

    Show the answer

    Correct answerC. The source document identifier and page number

    AWhy not this: Processing statistics do not establish where the passage appeared in the source.

    BWhy not this: A summary and language label cannot identify the original page containing the passage.

    CWhy this is right: Document and page metadata let the application trace a retrieved passage to its original location.

    DWhy not this: Model details describe vector generation, not the passage's location in its source.

    Source identifiers and page numbers provide provenance for citations back to the original passage. A document summary describes content but does not locate the cited passage.

    Open this question
  45. Question 45

    Data Preparation for ML and AI

    An application stores product records in Amazon RDS for PostgreSQL. It needs similarity searches over product embeddings and transactional updates to embeddings and product attributes together; which configuration best meets these requirements?

    Show the answer

    Correct answerD. Enable pgvector in the existing PostgreSQL database.

    AWhy not this: OpenSearch supports vector search, but updates across OpenSearch and RDS do not share one database transaction.

    BWhy not this: Parquet supports analytical storage, not transactional vector similarity queries alongside PostgreSQL records.

    CWhy not this: A separate DynamoDB table does not provide native vector similarity search or a shared transaction with RDS.

    DWhy this is right: pgvector supports similarity search while keeping embeddings and product attributes within PostgreSQL transactions.

    pgvector provides vector storage and similarity search within PostgreSQL, allowing embeddings and product attributes to share database transactions. OpenSearch Service supports vector search but does not share an atomic database transaction with RDS.

    Open this question
  46. Question 46

    Data Preparation for ML and AI

    An ML application ingests images and audio files ranging from 2 MB to 30 MB, with searchable labels and processing status. Which storage design supports these payloads and low-latency metadata lookups by asset ID?

    Show the answer

    Correct answerD. Store payloads in S3 and keyed metadata with S3 references in DynamoDB.

    AWhy not this: OpenSearch is suited to searchable metadata and derived content, not storage of original binary media payloads.

    BWhy not this: These payloads exceed DynamoDB's 400 KB item limit, and Base64 encoding makes them larger.

    CWhy not this: Feature Store stores ML feature records; it is not a repository for multi-megabyte binary media.

    DWhy this is right: S3 accommodates large media objects, while DynamoDB supports keyed metadata lookups without storing the payloads.

    S3 stores large binary assets, while DynamoDB provides low-latency access to asset metadata and object references. Embedding these payloads in DynamoDB items exceeds its 400 KB item limit, and Base64 encoding increases their size.

    Open this question
  47. Question 47

    Data Preparation for ML and AI

    An OpenSearch Service Faiss HNSW index applies a tenant post_filter after approximate nearest-neighbor retrieval, often returning fewer than 20 results despite many eligible documents. Which change best supports finding 20 tenant-eligible neighbors without an exhaustive vector scan?

    Show the answer

    Correct answerD. Move the tenant condition into the k-NN query's supported filter.

    AWhy not this: A larger response size alone does not make the retrieved nearest-neighbor candidates tenant-eligible.

    BWhy not this: Script-score vector search evaluates eligible vectors exhaustively, conflicting with the stated constraint.

    CWhy not this: More shards do not correct the separation between neighbor selection and tenant filtering.

    DWhy this is right: Efficient filtering incorporates tenant eligibility into nearest-neighbor retrieval instead of discarding results afterward.

    Efficient k-NN filtering applies eligibility constraints during vector search rather than discarding neighbors afterward. Filtered script-score search can evaluate eligible documents exactly, but it introduces the exhaustive vector scan the workload must avoid.

    Open this question
  48. Question 48

    Data Preparation for ML and AI

    An embedding model produces 768 values per document. What dimension should the corresponding OpenSearch Service knn_vector field specify?

    Show the answer

    Correct answerC. 768

    AWhy not this: Token count describes model input length, not embedding output dimensionality.

    BWhy not this: The number of neighbors controls result count rather than vector dimensionality.

    CWhy this is right: Each embedding contains 768 components, so the vector field must use dimension 768.

    DWhy not this: Document count determines index population, not the number of components in each vector.

    The vector field dimension must match the number of components in each embedding: 768. The requested number of neighbors controls how many matches a query seeks, not the length of stored vectors.

    Open this question
  49. Question 49

    Data Preparation for ML and AI

    A training corpus pairs audio segments with transcripts and video frames; annotations are revised, and S3 objects can be overwritten. The team must reproduce each released corpus and preserve segment alignment without duplicating media for every release; which design best meets these requirements?

    Show the answer

    Correct answerA. Retain S3 versions; freeze manifests with asset IDs, object version IDs, annotation revisions, and segment offsets.

    AWhy this is right: Exact versions and annotation revisions reproduce content, while asset IDs and offsets preserve cross-modal alignment.

    BWhy not this: Latest-modified selection changes over time, and filenames do not reliably encode segment-level temporal relationships.

    CWhy not this: Current keys can resolve to newer content, and annotation timestamps alone do not identify exact media versions or segment alignment.

    DWhy not this: Version IDs preserve content, but ingestion order does not establish which audio, transcript, and frame segments correspond.

    A fixed manifest must identify exact media versions, annotation revisions, and temporal alignment. S3 versioning retains overwritten content without requiring a separate full media copy per release; current object keys alone do not identify which retained versions belong to a release.

    Open this question
  50. Question 50

    Data Preparation for ML and AI

    A feature group has online and offline stores enabled, and its online record for customer 42 has event time 12:00. A successful PutRecord targeting both stores supplies the same identifier with event time 11:00; what happens?

    Show the answer

    Correct answerD. The online record stays at 12:00, and the offline store receives the incoming record.

    AWhy not this: The online store does not select this older event, and offline ingestion does not replace the entire history.

    BWhy not this: An older event time does not prevent the record from being added to the offline store.

    CWhy not this: Online replacement is determined by event time, not by which write arrives last.

    DWhy this is right: The older event does not replace the online record but is ingested into offline history.

    The online store retains the record with the latest event time, while the offline store receives historical records asynchronously. A later ingestion time does not make an older event replace the current online record.

    Open this question