AWS Machine Learning Specialty study materials
AWS Machine Learning Specialty study resources

AWS Machine Learning Specialty (AWS) practice questions

One question at a time. Build your AWS Machine Learning Specialty 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 Engineering

A company stores raw JSON clickstream events in Amazon S3 and queries them with Amazon Athena. Queries scan hundreds of gigabytes and return slowly. Which change most directly reduces both query latency and bytes scanned?

  1. Convert the data to Apache Parquet with columnar storage and Snappy compression Correct answer.
  2. Store the events as uncompressed CSV files sorted by timestamp
  3. Raise the per-query data-scanned limit on the Athena workgroup
  4. Move the bucket contents to the S3 Standard-IA storage class

Explanation

Columnar formats store values by column, so Athena reads only the columns referenced by the query, and compression further shrinks the bytes read from S3. JSON requires the engine to parse every row and every field, which is far more expensive. Changing storage class or query limits does not reduce the amount of data the engine must deserialize.

Question 2Data Engineering

A data engineer needs table definitions for a set of newly landed S3 prefixes so that Athena can query them, and wants the schema inferred automatically on a recurring basis. Which AWS Glue component performs this task?

  1. A Glue job bookmark
  2. An AWS Glue trigger
  3. An AWS Glue crawler Correct answer.
  4. A Lake Formation blueprint

Explanation

A crawler connects to a data store, infers the schema and partition structure, and writes table definitions into the Glue Data Catalog. It can be scheduled to pick up new prefixes and partitions over time. Triggers only start jobs or crawlers, bookmarks track processed data, and blueprints are workflow templates.

Question 3Data Engineering

A team must continuously deliver streaming records into Amazon S3 with automatic buffering, optional Lambda-based transformation, and built-in compression, writing no infrastructure code. Which service fits best?

  1. AWS Glue streaming ETL
  2. Amazon Kinesis Data Analytics
  3. Amazon Kinesis Data Firehose Correct answer.
  4. Amazon Kinesis Data Streams

Explanation

Kinesis Data Firehose is a fully managed delivery service that buffers incoming records by size or time, optionally invokes a Lambda function for transformation, compresses the output, and writes to destinations such as S3, Redshift, or OpenSearch. Kinesis Data Streams only stores records for consumers to read.

Question 4Data Engineering

A company wants continuous, near-real-time replication of ongoing changes from an on-premises Oracle database into Amazon S3 with minimal custom code. Which service should be used?

  1. AWS DataSync
  2. Amazon Kinesis Data Streams
  3. AWS Database Migration Service with change data capture Correct answer.
  4. AWS Glue crawler

Explanation

AWS DMS supports ongoing replication through change data capture, reading the source database's logs and applying changes to targets such as S3, Redshift, or another database. DataSync is for file and object transfer, and Kinesis requires custom producers.

Question 5Data Engineering

A single multi-terabyte text file in Amazon S3 is processed by an Amazon EMR MapReduce job. Which compression codec allows the file to be split so multiple mappers can read it in parallel?

  1. gzip
  2. Zstandard
  3. Snappy
  4. bzip2 Correct answer.

Explanation

bzip2 blocks carry markers that let Hadoop split a compressed file and assign blocks to separate mappers, enabling parallelism on one large file. gzip and Snappy streams are not splittable in Hadoop, so a single file is handled by a single mapper.

Question 6Data Engineering

An Amazon EMR cluster runs a nightly Spark job, and the engineer wants nodes that perform computation but do not hold HDFS data, so they can be added and removed freely and purchased as Spot capacity. Which node type meets this requirement?

  1. Task node Correct answer.
  2. Core node
  3. Master node
  4. Primary node

Explanation

Task nodes run tasks only and do not store HDFS blocks, so losing them does not cause data loss or under-replication. This makes them the right place for Spot capacity in a variable workload. Core nodes store HDFS data, and the master node coordinates the cluster.

Question 7Data Engineering

Which AWS service lets analysts run standard SQL directly against data in Amazon S3, using table definitions from the Glue Data Catalog, with no cluster to provision or manage?

  1. Amazon Redshift
  2. Amazon EMR
  3. AWS Glue
  4. Amazon Athena Correct answer.

Explanation

Athena is a serverless query service that reads data in place from S3 and uses the Glue Data Catalog for schema and partition metadata. Billing is based on data scanned, and there is no cluster to size or operate.

Question 8Data Engineering

Which component provides a centralized, Hive-compatible metastore that Amazon Athena, Amazon EMR, and Redshift Spectrum can all share?

  1. AWS Glue DataBrew
  2. The AWS Glue Data Catalog Correct answer.
  3. An Athena workgroup
  4. An AWS Lake Formation permissions table

Explanation

The Glue Data Catalog stores databases, tables, partitions, and schemas in a Hive-compatible form, letting multiple analytics engines reference the same metadata. Engines such as Athena, EMR, and Redshift Spectrum query it directly.

Question 9Data Engineering

An S3 table used by Athena is physically organized as s3://bucket/table/year=2024/month=05/day=17/... with one prefix per day. What is the primary query benefit of this layout?

  1. Athena prunes partitions so only the prefixes matching the filter are read Correct answer.
  2. Amazon S3 automatically compresses each partition before the query runs
  3. Parquet files inside each partition are rewritten as ORC on read
  4. The Glue Data Catalog encrypts each partition separately with its own key

Explanation

When a filter targets partition columns, Athena and the Glue Data Catalog resolve the matching S3 prefixes and skip everything else, which sharply reduces bytes scanned. Partitioning does not change file format, compression, or encryption behavior.

Question 10Data Engineering

A nightly AWS Glue ETL job keeps reprocessing every object in an S3 prefix, causing duplicated output rows. Which Glue feature makes the job process only files added since the last successful run?

  1. The Glue FindMatches transform
  2. AWS Glue job bookmarks Correct answer.
  3. AWS Glue DataBrew recipes
  4. An AWS Glue crawler schedule

Explanation

Job bookmarks persist state about which source data a job has already consumed, so subsequent runs read only new or changed objects. This is the standard mechanism for incremental Glue jobs on S3 sources.

Question 11Data Engineering

A Kinesis Data Stream with four shards is receiving ProvisionedThroughputExceededException errors as producer throughput grows. Which action addresses the root cause?

  1. Enable enhanced fan-out on the stream
  2. Enable server-side encryption on the stream
  3. Extend the stream's data retention period to 365 days
  4. Increase the shard count to add write capacity Correct answer.

Explanation

Each shard has a fixed write capacity of 1 MB/s and 1,000 records/s, so producers throttled at peak throughput need more shards. Resharding spreads the write load across additional shards. Enhanced fan-out affects read throughput only.

Question 12Data Engineering

A 1 TB dataset of gzipped CSV files must be loaded nightly into an Amazon Redshift table. Which approach gives the best load performance?

  1. Run individual INSERT statements from an EC2 instance
  2. Use AWS DMS with a single full-load task and one thread
  3. Use the COPY command with a manifest over many equally sized files Correct answer.
  4. Create a Redshift Spectrum external table over the S3 data

Explanation

COPY loads data in parallel across all slices of the cluster, and splitting the input into many similarly sized files plus a manifest maximizes that parallelism and gives precise control over which files are loaded. Row-by-row inserts and single-threaded tools cannot saturate the cluster.

Question 13Data Engineering

A data lake on S3 is cataloged in the Glue Data Catalog, and different analysts must see different rows and columns of the same table based on their IAM identity. Which service provides this without maintaining separate copies or hand-written bucket policies?

  1. IAM permission boundaries
  2. VPC endpoint policies
  3. Amazon S3 bucket policies
  4. AWS Lake Formation Correct answer.

Explanation

Lake Formation manages fine-grained grants, including column-level and row-level filters, on cataloged tables and enforces them for integrated engines. It centralizes access control instead of requiring per-object policies.

Question 14Data Engineering

A company needs to run continuous SQL queries over records arriving in Amazon Kinesis Data Streams and write aggregated results to Kinesis Data Firehose, without managing any servers. Which service should be used?

  1. Amazon Kinesis Data Analytics for Apache Flink Correct answer.
  2. Amazon Athena
  3. AWS Glue crawler
  4. Amazon QuickSight

Explanation

Kinesis Data Analytics provides a managed Apache Flink environment where SQL or Flink applications transform and aggregate streaming records continuously and send results to downstream destinations. Athena queries data at rest, and crawlers and QuickSight do not process streams.

Question 15Data Engineering

A team already operates Apache Kafka producers and consumers on premises and wants to move them to AWS with minimal application changes. Which service is the appropriate target?

  1. Amazon Kinesis Data Streams
  2. Amazon Managed Streaming for Apache Kafka (Amazon MSK) Correct answer.
  3. Amazon MQ for RabbitMQ
  4. Amazon Kinesis Data Firehose

Explanation

Amazon MSK runs Apache Kafka natively, so existing Kafka producers, consumers, and tooling such as Kafka Connect work with minimal change. Kinesis services and Amazon MQ use different APIs and protocols.

Question 16Data Engineering

A machine learning team wants a single repository that serves feature values with low latency at inference time and also provides historical feature data for training, keeping the online and offline views consistent. Which SageMaker capability provides this?

  1. SageMaker Ground Truth
  2. SageMaker Pipelines
  3. SageMaker Data Wrangler
  4. SageMaker Feature Store Correct answer.

Explanation

SageMaker Feature Store maintains feature groups with an online store for low-latency real-time retrieval and an offline store for batch training, both fed from the same ingested records. This keeps training and inference features consistent.

Question 17Data Engineering

A query selects 3 of 50 columns from a Parquet table in Athena, yet the same query over an equivalent JSON table scans far more data. Why does the columnar layout reduce scanning?

  1. Parquet stores rows contiguously, reducing the number of storage seeks
  2. Parquet creates a Hive metastore entry that filters unselected columns
  3. Parquet disables compression so records can be skipped during parsing
  4. Only the column chunks for the referenced columns are read from S3 Correct answer.

Explanation

In a columnar file each column is stored in separate chunks with its own metadata, so the engine reads only the chunks needed for the projected and filtered columns. Row-oriented JSON forces a full record parse. Compression and metastore entries are unrelated to projection pruning.

Question 18Data Engineering

A Glue job must process nested JSON where field sets vary between records, and the pipeline requires the Relationalize transform before writing to a relational target. Which data abstraction should the job use?

  1. A Glue DynamicFrame Correct answer.
  2. A Glue crawler classifier
  3. An Athena CTAS statement
  4. A plain Apache Spark DataFrame

Explanation

DynamicFrames are designed for semi-structured data: they carry schema information per record, offer transforms such as Relationalize and ResolveChoice, and can handle inconsistent fields without failing the job. Spark DataFrames require a fixed schema.

Question 19Data Engineering

A data lake keeps raw source files indefinitely. About 90% of reads occur within 30 days of a file landing, and after that the data is rarely accessed but must remain queryable within hours. Which approach is most cost-effective?

  1. Enable S3 Transfer Acceleration on the bucket
  2. Move every object to S3 Glacier Deep Archive on arrival
  3. Apply a lifecycle policy that transitions objects to lower-cost tiers after 30 days Correct answer.
  4. Keep every object in S3 Standard permanently

Explanation

A lifecycle rule moves objects out of S3 Standard once the access pattern cools off, matching cost to usage while keeping the data available. Deep Archive retrieval takes hours and would be inappropriate for data still needed on short notice.

Question 20Data Engineering

A nightly Amazon EMR job completes in about two hours and can tolerate worker interruptions without losing output. Which cluster design minimizes cost?

  1. A persistent cluster with all On-Demand core nodes running 24 hours a day
  2. An EMR on EKS cluster using only On-Demand capacity
  3. A transient cluster with On-Demand core nodes and Spot task nodes, terminated after the job Correct answer.
  4. Reserved Instances for the master node on a long-running cluster

Explanation

A transient cluster bills only for the job's duration, and placing non-HDFS work on Spot task nodes captures large discounts while On-Demand core nodes protect HDFS data. Persistent all-On-Demand clusters pay for idle hours.

Question 21Data Engineering

A Kinesis Data Firehose stream delivers enriched records to Amazon S3, but during off-peak hours records sit for a long time before objects appear. What is the most likely explanation?

  1. Firehose requires at least 1,000 records before it can invoke the transformation Lambda function
  2. Kinesis Data Streams shards must be resharded before Firehose delivers any objects
  3. S3 server-side encryption with KMS keys blocks writes until a key rotation completes
  4. The configured buffer size and buffer interval have not been reached, so Firehose waits before flushing Correct answer.

Explanation

Firehose flushes when either the buffer size or the buffer interval is satisfied; with low traffic only the interval triggers delivery, which looks like latency. Lowering the buffer interval reduces that delay at the cost of more, smaller objects.

Question 22Data Engineering

An Athena table is partitioned by hour and new partitions land continuously. Running crawlers and MSCK REPAIR TABLE has become slow and expensive. Which feature removes the need to maintain partition metadata?

  1. Redshift Spectrum external tables
  2. Partition projection Correct answer.
  3. Glue job bookmarks
  4. Athena CTAS

Explanation

Partition projection lets Athena compute partition locations from a configured pattern and date range at query time, so new partitions are queryable without crawler runs or repair statements. It is especially effective for regularly arriving time-based data.

Question 23Data Engineering

Two large Amazon Redshift tables are joined frequently on customer_id, and the query plan shows large broadcast or redistribution steps. Which table design reduces that data movement?

  1. A SORTKEY on customer_id for both tables
  2. DISTKEY on customer_id for both tables Correct answer.
  3. DISTSTYLE ALL on both tables
  4. DISTSTYLE EVEN on both tables

Explanation

When both tables are distributed on the join column, matching rows already reside on the same slice, so the join can run locally without redistribution. Sort keys speed range scans and merge joins but do not co-locate rows.

Question 24Data Engineering

Several independent applications read the same Kinesis data stream, and each needs its own dedicated read throughput per shard with low propagation latency. Which capability should be enabled?

  1. Kinesis Data Firehose delivery to each consumer
  2. Enhanced fan-out with each application registered as a consumer Correct answer.
  3. Kinesis Client Library with a shared application name
  4. More shards on the stream

Explanation

Enhanced fan-out gives each registered consumer its own 2 MiB/s per-shard read throughput over HTTP/2 push, instead of sharing the 2 MiB/s per-shard limit across all polling consumers. That isolates consumers from each other's read load.

Question 25Data Engineering

A streaming pipeline writes Avro files to S3, and producers periodically add new optional fields. Downstream jobs must read both older and newer files without failing. Which design best supports this?

  1. Rewrite all historical Parquet files whenever the schema changes
  2. Rely on the schema embedded in each Avro file and resolve reader and writer schemas with default values for new fields Correct answer.
  3. Compress JSON records with gzip so missing fields can be skipped during parsing
  4. Convert the stream to CSV with a header row so column names travel with the data

Explanation

Avro files embed the writer schema, so a reader can resolve it against its own expected schema and supply defaults for newly added optional fields. This is the standard mechanism for backward-compatible schema evolution in file-based pipelines.

Question 26Data Engineering

A company must migrate an on-premises Oracle database to Amazon S3 and keep the S3 copy continuously synchronized with ongoing changes while cutover is planned. Which AWS service should be used?

  1. AWS DataSync
  2. AWS Glue
  3. AWS Database Migration Service (AWS DMS) Correct answer.
  4. AWS Snowball Edge

Explanation

AWS DMS is built for database migration and can perform continuous change data capture (CDC) so that ongoing source changes are replicated to the target until cutover. DataSync and Snowball Edge move files or physical data, and Glue is an ETL and catalog service rather than a database replication service.

Question 27Data Engineering

A data analyst who does not write code needs to profile a large CSV dataset, detect outliers and missing values, and apply transformations such as filtering and standardization before loading it into Amazon S3. Which AWS service provides this visual data preparation experience?

  1. AWS Glue DataBrew Correct answer.
  2. AWS Lake Formation
  3. AWS Glue Studio
  4. Amazon EMR Studio

Explanation

AWS Glue DataBrew provides a visual, no-code interface for profiling datasets and applying cleaning and transformation recipes. Glue Studio is primarily for authoring ETL jobs, EMR Studio is a notebook environment, and Lake Formation manages permissions rather than data preparation.

Question 28Data Engineering

A large CSV object in Amazon S3 contains millions of rows, but a reporting job needs only rows where region = 'EMEA' and only three of the forty columns. The engineer wants to avoid downloading the entire object. Which S3 capability should be used?

  1. Amazon S3 Inventory
  2. S3 Batch Operations
  3. S3 Transfer Acceleration
  4. Amazon S3 Select Correct answer.

Explanation

S3 Select runs a SQL-like selection over a single object and returns only the requested rows and columns, reducing data transferred to the client. Batch Operations performs bulk actions on objects, Transfer Acceleration speeds uploads and downloads, and Inventory produces object listings.

Question 29Data Engineering

A data pipeline must run an AWS Glue job, then an Amazon EMR step, then a Lambda validation, and pause for manual approval before continuing. Each step needs retries and conditional branching. Which service is designed to coordinate this workflow?

  1. Amazon EventBridge
  2. Amazon SNS
  3. AWS Step Functions Correct answer.
  4. AWS Glue triggers

Explanation

AWS Step Functions is a state machine service that coordinates multiple AWS services with retries, branching, waits, and manual approval steps. EventBridge routes events, Glue triggers start Glue resources, and SNS sends notifications; none provides the full workflow orchestration described.

Question 30Data Engineering

A very large Amazon Redshift table is most often queried with a range filter on order_date, and the query plan shows the scan reading most blocks in the table. Which table design change is most likely to reduce the blocks read?

  1. Set the table's DISTSTYLE to ALL
  2. Define a compound sort key on order_date Correct answer.
  3. Apply ZSTD encoding to every column
  4. Run VACUUM FULL more frequently

Explanation

A sort key stores rows in sorted order, so range filters on the sort column can skip blocks using zone maps. DISTSTYLE ALL affects join distribution, encoding reduces storage but not block skipping, and VACUUM reclaims space rather than improving range-filter pruning.

Question 31Data Engineering

Analysts repeatedly query a large CSV table in Amazon Athena, and each query scans hundreds of gigabytes. The table is static and is refreshed once per day. What is the most cost-effective way to reduce scan size for these repeated queries?

  1. Run a CREATE TABLE AS SELECT statement that writes the result as Parquet Correct answer.
  2. Run MSCK REPAIR TABLE on the CSV table
  3. Enable query result reuse in the Athena workgroup
  4. Create a view over the CSV table

Explanation

CTAS can rewrite the CSV data into a columnar format such as Parquet, so later queries read only the needed columns and benefit from compression. Views and result reuse do not convert the underlying storage format, and MSCK REPAIR TABLE only repairs partition metadata.

Question 32Data Engineering

A Kinesis Data Firehose stream delivers records to Amazon S3, and downstream jobs require objects to be organized by customer_id and event_date. The producer cannot be changed. Which Firehose feature should be configured?

  1. Increase the Firehose buffer size
  2. Use Kinesis Data Analytics
  3. Enable Lambda transformation
  4. Configure dynamic partitioning with partition keys Correct answer.

Explanation

Firehose dynamic partitioning extracts partition keys from each record and writes objects into S3 prefixes based on those keys. Buffer size and Lambda transformation affect batching and record content, while Kinesis Data Analytics performs stream processing rather than S3 prefix organization.

Question 33Data Engineering

An AWS Glue Spark job that performs large joins and aggregations runs out of memory with G.1X workers, and the job's shuffle operations spill heavily to disk. Which change directly increases memory per worker?

  1. Change the worker type from G.1X to G.2X Correct answer.
  2. Reduce the number of workers and keep G.1X
  3. Enable job bookmarks
  4. Increase the job timeout

Explanation

G.2X workers provide more memory and disk per worker than G.1X workers, which helps memory-intensive shuffles and joins. Reducing workers lowers total capacity, bookmarks track processed data, and timeout changes do not add memory.

Question 34Data Engineering

A consumer application needs to replay data from an Amazon Kinesis data stream up to five days after ingestion, but the stream currently allows replay only within the default retention window. What should be configured?

  1. Increase the data stream retention period beyond the default 24 hours Correct answer.
  2. Increase the stream's write capacity
  3. Enable enhanced fan-out
  4. Add more shards to the stream

Explanation

Kinesis Data Streams retention defaults to 24 hours and can be extended up to 365 days, allowing older records to remain readable for replay. Shards, enhanced fan-out, and write capacity affect throughput rather than how long records are retained.

Question 35Data Engineering

Multiple teams produce Avro records into a shared streaming pipeline, and the platform team must reject producer schema changes that would break existing consumers. Which AWS capability enforces schema compatibility for these records?

  1. AWS Glue Data Catalog
  2. Amazon Kinesis Data Analytics
  3. AWS Glue Schema Registry Correct answer.
  4. AWS Lake Formation

Explanation

AWS Glue Schema Registry stores schemas and validates producer schema changes against configured compatibility rules, rejecting incompatible versions. The Data Catalog stores table metadata, Kinesis Data Analytics processes streams, and Lake Formation governs permissions.

Question 36Data Engineering

A team wants to run Apache Spark jobs on AWS without provisioning or managing clusters or EC2 instances, and without paying for idle capacity. Which service best fits?

  1. Amazon ECS with Fargate
  2. AWS Glue with G.1X workers
  3. Amazon EMR on EC2 with automatic scaling
  4. Amazon EMR Serverless Correct answer.

Explanation

Amazon EMR Serverless runs Spark and Hive applications on a fully managed, serverless compute layer that scales with job demand. EMR on EC2 still requires cluster infrastructure management, Glue is an ETL service rather than a general EMR runtime, and ECS with Fargate is a container platform.

Question 37Data Engineering

A nightly Amazon Redshift load reads from an S3 prefix that contains both current files and archived files that must not be loaded. The set of valid files changes each day. Which COPY approach loads only the intended files?

  1. Use COPY with a manifest file that lists only the required objects Correct answer.
  2. Use UNLOAD to rewrite the prefix
  3. Load all objects and delete unwanted rows with DELETE
  4. Use COPY with a prefix and a file extension filter

Explanation

A Redshift COPY manifest explicitly lists the S3 objects to load, giving precise control when valid files vary and unwanted files share the prefix. Prefix and extension filters are too broad, while loading then deleting wastes work and UNLOAD exports data rather than selecting input.

Question 38Data Engineering

A compliance team needs a daily report of every object in an S3 bucket, including size, storage class, and encryption status, without issuing millions of LIST requests. Which S3 feature provides this?

  1. AWS CloudTrail data events
  2. Amazon S3 Event Notifications
  3. Amazon S3 Storage Lens
  4. Amazon S3 Inventory Correct answer.

Explanation

Amazon S3 Inventory produces scheduled reports listing objects and their metadata, such as size, storage class, and encryption status, without per-object LIST calls. Storage Lens provides usage metrics, event notifications report individual actions, and CloudTrail records API activity.

Question 39Data Engineering

Account A owns a Glue Data Catalog database backed by S3. Account B must query the tables with Lake Formation permissions while the data remains in Account A's bucket. What should be configured?

  1. Create an IAM role in Account A and share its credentials with Account B
  2. Grant cross-account permissions in Lake Formation and create a resource link in Account B Correct answer.
  3. Copy the S3 objects into Account B's bucket
  4. Attach an S3 bucket policy that allows Account B to read the bucket

Explanation

Lake Formation supports cross-account sharing by granting permissions to the external account and creating a resource link in that account, so data can remain in place. Sharing credentials is insecure, copying data defeats the purpose, and an S3 bucket policy alone bypasses Lake Formation catalog and table permissions.

Question 40Data Engineering

An AWS Glue job reads a prefix containing 50,000 JSON files of about 100 KB each, and most job time is spent opening files rather than processing data. Which change most directly addresses this bottleneck?

  1. Use G.1X workers instead of G.2X
  2. Compact the small files into larger Parquet files before the job Correct answer.
  3. Disable job bookmarks
  4. Increase the job timeout

Explanation

Many small files create high per-file overhead in Spark, so compacting them into fewer larger files improves throughput and can also reduce storage and scan costs with Parquet. Timeout, bookmarks, and worker size do not remove the per-file overhead caused by the file count.

Question 41Exploratory Data Analysis

A column in a dataset has missing values, and analysis shows that the probability of a value being missing is unrelated to any other variable in the dataset or to the value itself. Which description of the missingness mechanism applies?

  1. Values are missing only because of a fault in the collection pipeline
  2. The mechanism cannot be described without the target labels
  3. Missing entries occur only in columns supplied by an external vendor
  4. The probability of missingness is unrelated to any variable in the dataset Correct answer.

Explanation

Data is missing completely at random (MCAR) when the missingness has no systematic relationship to observed or unobserved values. Under MCAR, dropping incomplete rows does not bias summary statistics, apart from losing sample size.

Question 42Exploratory Data Analysis

A numeric feature is strongly right-skewed and contains missing values. Which single-value imputation preserves the typical value of that feature with the least distortion?

  1. Replacing missing values with the value zero
  2. Replacing missing values with the column median Correct answer.
  3. Replacing missing values with the column mean
  4. Dropping every row containing a missing value

Explanation

In a skewed distribution the mean is pulled toward the long tail, so the median better represents the center. Median imputation therefore keeps the imputed values close to the bulk of the observed data.

Question 43Exploratory Data Analysis

What does one-hot encoding accomplish when applied to a nominal categorical feature?

  1. It converts each category level into a binary indicator column Correct answer.
  2. It orders categories by their frequency in the training data
  3. It replaces each category with the mean of the target variable
  4. It reduces the number of columns created from a categorical feature

Explanation

One-hot encoding creates one binary column per category level, so the model can treat categories as unordered distinct states. It avoids implying a numeric ordering that does not exist in nominal data.

Question 44Exploratory Data Analysis

Which statement correctly describes the Pearson correlation coefficient between two numeric variables?

  1. It is unaffected by outliers in either of the two variables
  2. It can take any value between 0 and 1 regardless of the relationship
  3. It ranges from -1 to 1 and measures linear association Correct answer.
  4. It measures the strength of a monotonic relationship between two variables

Explanation

Pearson correlation is bounded between -1 and 1, with the sign giving the direction and the magnitude giving the strength of linear association. A value near zero means no linear relationship, not necessarily no relationship.

Question 45Exploratory Data Analysis

A histogram of a single numeric feature is most useful for which purpose?

  1. To compare the joint distribution of two categorical variables
  2. To view the shape and spread of that variable's distribution Correct answer.
  3. To display the exact value of every observation in the dataset
  4. To measure the linear association between two numeric variables

Explanation

A histogram bins one numeric variable and shows how observations are distributed across those bins, revealing skew, modes, and spread. It supports univariate analysis rather than relationships between variables.

Question 46Exploratory Data Analysis

Why is a dataset usually divided into training and holdout test sets before model fitting?

  1. It estimates performance on data the model was not fitted on Correct answer.
  2. It guarantees that the model will never overfit the training data
  3. It removes the need to perform any feature engineering
  4. It increases the number of rows that are available for model training

Explanation

A holdout set that is untouched during fitting provides an estimate of how the model behaves on unseen data. Performance measured on the training data is optimistically biased because the model has already seen those examples.

Question 47Exploratory Data Analysis

What does z-score standardization do to a numeric feature?

  1. It converts numeric features into ranked percentile values
  2. It removes features whose variance is below a fixed threshold
  3. It rescales each feature to the range [0, 1] using minimum and maximum
  4. It centers each feature to mean 0 and scales it to unit variance Correct answer.

Explanation

Z-score standardization subtracts the feature mean and divides by the standard deviation, producing a feature with zero mean and unit variance. The transformed values are not bounded to a fixed interval.

Question 48Exploratory Data Analysis

A binary target has only 1 percent positive examples. Why can accuracy be a misleading metric on this dataset?

  1. Accuracy requires the predicted probabilities rather than hard labels
  2. A model that always predicts the majority class still scores about 99 percent Correct answer.
  3. Accuracy cannot be computed when the test set contains missing values
  4. Accuracy is only defined for binary classification problems

Explanation

With severe imbalance, a trivial constant predictor already achieves accuracy close to the majority class share, so the metric hides the failure to detect the minority class. Metrics such as recall, precision, F1, and area under the precision-recall curve are more informative here.

Question 49Exploratory Data Analysis

A numeric feature has a first quartile of 20 and a third quartile of 50. Using the 1.5 x IQR rule, what is the upper fence above which values are flagged as outliers?

  1. 95 Correct answer.
  2. 110
  3. 65
  4. 80

Explanation

The interquartile range is 50 - 20 = 30, and the upper fence is Q3 + 1.5 x IQR = 50 + 45 = 95. Observations above that value are flagged as outliers under the Tukey rule.

Question 50Exploratory Data Analysis

A feature has a strong right skew caused by a long tail of large values. Which transformation is most likely to make the distribution closer to symmetric?

  1. Applying a logarithmic transformation to the feature Correct answer.
  2. Standardizing the feature to zero mean and unit variance
  3. Multiplying every value by a constant factor
  4. Squaring every value in the feature

Explanation

A logarithm compresses large values much more than small ones, pulling in a long right tail and reducing positive skew. This can also help linear models that assume roughly symmetric, additive effects.