Practice Library
All MCQs
Browse exam-wise, subject-wise, and country-wise MCQs with explanations.
Choose an option to check your answer.
A.
A Spark engine for processing unbounded data using DataFrame and SQL semantics
B.
A file format for HDFS
C.
A YARN scheduling policy
D.
A Scala compiler mode
Show Answer
Correct Answer: A. A Spark engine for processing unbounded data using DataFrame and SQL semantics
Explanation:
Structured Streaming treats a live stream conceptually as an ever-growing table.
Queries are executed incrementally as new data arrives.
Choose an option to check your answer.
A.
To preserve executor processes permanently
B.
To avoid storing input schemas
C.
To change training labels later
D.
To apply the identical learned transformations and model in deployment
Show Answer
Correct Answer: D. To apply the identical learned transformations and model in deployment
Explanation:
Persisting the fitted pipeline records category mappings, scaling parameters, and model weights.
Loading it helps maintain consistent prediction behavior.
Choose an option to check your answer.
A.
HDFS block placement
B.
Streaming watermark calculation
C.
Collaborative-filtering recommendations
D.
SQL schema inference
Show Answer
Correct Answer: C. Collaborative-filtering recommendations
Explanation:
ALS factorizes a sparse user-item interaction matrix into latent factors.
It scales through alternating distributed optimization steps.
Choose an option to check your answer.
A.
Classification precision
B.
A silhouette-based measure of cluster cohesion and separation
C.
HDFS block balance
D.
SQL query latency only
Show Answer
Correct Answer: B. A silhouette-based measure of cluster cohesion and separation
Explanation:
Silhouette compares within-cluster similarity with separation from other clusters.
Higher values generally indicate clearer assignments.
Choose an option to check your answer.
A.
BinaryClassificationEvaluator
B.
RegressionEvaluator
C.
ClusteringEvaluator only
D.
FileFormatEvaluator
Show Answer
Correct Answer: A. BinaryClassificationEvaluator
Explanation:
It evaluates score-based binary classification metrics such as area under ROC or PR.
The metric should match the application's priorities.
Choose an option to check your answer.
A.
Building a grid of HDFS blocks
B.
Creating SQL table partitions
C.
Allocating executors
D.
Defining combinations of hyperparameter values to evaluate
Show Answer
Correct Answer: D. Defining combinations of hyperparameter values to evaluate
Explanation:
The grid supplies candidate parameter maps to validation tools.
Large grids can be computationally expensive.
Choose an option to check your answer.
A.
To increase HDFS replication
B.
To choose MapReduce partitions only
C.
To compare hyperparameter settings using held-out performance
D.
To remove model evaluation
Show Answer
Correct Answer: C. To compare hyperparameter settings using held-out performance
Explanation:
These tools fit candidate pipelines on training subsets and score validation data.
They help select settings that generalize.
Choose an option to check your answer.
A.
A continuous target value
B.
A sparse binary vector representing categorical levels
C.
A sorted list of categories
D.
A cluster centroid
Show Answer
Correct Answer: B. A sparse binary vector representing categorical levels
Explanation:
One-hot encoding avoids imposing arbitrary numeric order on categories.
Sparse storage is efficient when there are many levels.
Choose an option to check your answer.
A.
Mapping categorical string labels to numeric indices
B.
Converting numeric features to text
C.
Sorting strings globally
D.
Creating an HDFS index
Show Answer
Correct Answer: A. Mapping categorical string labels to numeric indices
Explanation:
Many machine-learning algorithms require numeric representations.
The fitted indexer preserves a consistent category mapping.
Choose an option to check your answer.
A.
Scaling adds more training examples
B.
It guarantees perfect accuracy
C.
It removes all categorical variables
D.
Features with large numeric ranges can dominate distances or optimization
Show Answer
Correct Answer: D. Features with large numeric ranges can dominate distances or optimization
Explanation:
Comparable scales improve numerical behavior and feature balance.
Tree-based algorithms are generally less sensitive to scaling.
Choose an option to check your answer.
A.
Splits one vector into separate files
B.
Assigns class labels
C.
Combines multiple input columns into one feature vector
D.
Creates YARN containers
Show Answer
Correct Answer: C. Combines multiple input columns into one feature vector
Explanation:
Many MLlib algorithms expect a single vector-valued features column.
VectorAssembler constructs it from selected fields.
Choose an option to check your answer.
A.
To replicate HDFS blocks
B.
To organize multiple feature and model stages into one reproducible workflow
C.
To allocate executor cores
D.
To sort MapReduce keys
Show Answer
Correct Answer: B. To organize multiple feature and model stages into one reproducible workflow
Explanation:
Pipelines preserve the sequence of transformations and model fitting.
They reduce training-serving inconsistencies.