CertSafari

    Free Cloudera Machine Learning Engineer (CDP-6001) Sample Questions

    35 free sample questions from our bank of 358+, covering every exam domain, with answers and detailed explanations. Updated August 2026.

    Domain 1: Cloudera Machine Learning

    Subdomain 1.6: Runtimes

    1.Which approach is most effective for ensuring that required Python packages are available without causing notebook restarts during package installation?

    1. A.Build a custom runtime with all necessary packages pre-installed in the Docker image.
    2. B.Develop a background script that pip-installs dependencies while the notebook loads.
    3. C.Adjust the project settings to extend the session timeout and avoid frequent restarts.
    4. D.Attach a persistent volume containing a virtual environment with pre-installed packages.
    Show answer & explanation

    Correct answer: ABuild a custom runtime with all necessary packages pre-installed in the Docker image.

    • A. Correct. Building a custom runtime with all necessary packages pre-installed in the Docker image ensures that the environment is consistent, reproducible, and ready for use without additional setup time during session startup. This is the recommended practice in Cloudera Machine Learning to avoid interruptions from package installation.
    • B. Incorrect. Developing a background script to pip-install dependencies during notebook load can lead to delays, inconsistencies, and potential failures if the installation process encounters issues. This is not a recommended practice for production environments and does not prevent restarts from interrupting installation.
    • C. Incorrect. Adjusting the project settings to extend the session timeout does not address the root issue of missing packages. It only delays the inevitable restart and does not ensure the required packages are available.
    • D. Incorrect. Attaching a persistent volume with a virtual environment may work but is less efficient and scalable compared to a custom runtime. It also introduces complexity in managing dependencies across different sessions or users. Runtime images are the intended place to define dependencies.

    Subdomain 1.6: Runtimes

    2.A data scientist can run notebooks that use only Spark or only TensorFlow successfully in a Cloudera Machine Learning workspace. However, when importing both libraries in the same notebook, the notebook fails. What is the most likely cause?

    1. A.Insufficient memory and CPU in the session for running both frameworks concurrently.
    2. B.The Docker image size exceeds the workspace limit, causing the container to time out.
    3. C.A conflict between Spark and TensorFlow’s Java libraries leads to kernel termination.
    4. D.The custom runtime is incompatible with the Jupyter kernel and cannot execute the notebooks.
    Show answer & explanation

    Correct answer: AInsufficient memory and CPU in the session for running both frameworks concurrently.

    • A. Correct. Running both Spark and TensorFlow in the same session significantly increases memory and CPU consumption. If the session's allocated resources are insufficient, the combined workload can cause the notebook process to fail, even though each framework works individually. This is the most common cause of such failures in Cloudera Machine Learning.
    • B. Incorrect. Docker image size limits typically affect container deployment or startup, not runtime execution. Since each framework works separately, the container has started successfully, ruling out image size issues.
    • C. Incorrect. While Java library conflicts can occur, they are not the most likely cause here. The fact that both libraries work individually suggests no fundamental incompatibility. Resource exhaustion is a more common and general explanation.
    • D. Incorrect. A custom runtime incompatibility with the Jupyter kernel would prevent any notebook from running, not just those using both frameworks. Since each framework works separately, the runtime is compatible.

    Subdomain 1.6: Runtimes

    3.An administrator is creating a custom runtime in Cloudera Machine Learning and wants to define default environment variables that will be available to all sessions and jobs using this runtime. What is the recommended way to set these environment variables?

    1. A.Declare them in a runtime.yaml file in the runtime definition.
    2. B.Use the ENV instruction in the runtime’s Dockerfile to define them.
    3. C.Add them to the project’s Environment tab configuration settings.
    4. D.Specify them in the session launch form at session startup.
    Show answer & explanation

    Correct answer: BUse the ENV instruction in the runtime’s Dockerfile to define them.

    • A. Incorrect. The runtime.yaml file is used for runtime metadata and configuration, but not for defining environment variables. Environment variables for a custom runtime should be set in the Dockerfile.
    • B. Correct. Using the ENV instruction in the runtime’s Dockerfile embeds environment variables into the container image, making them available to all sessions and jobs that use the runtime. This is the standard and recommended method.
    • C. Incorrect. The project-level Environment tab configures environment variables for the project as a whole, not for a specific runtime. Runtime-specific variables must be defined in the runtime Dockerfile.
    • D. Incorrect. Specifying environment variables at session launch is a per-session action and does not persist for all sessions or jobs using the runtime. It is not the recommended approach for custom runtime definitions.

    Subdomain 1.3: Experiments

    4.Which of the following statements about experiment runs in Cloudera Machine Learning are correct?(Select 2)

    1. A.An experiment run can only be initiated from a Workbench session.
    2. B.Metrics are streamed to the CML UI as they are logged during a run.
    3. C.Runs from different experiments cannot be compared side-by-side.
    4. D.Artifacts from a run are automatically stored in the project data directory.
    5. E.You can add custom tags to an experiment run after it has finished.
    Show answer & explanation

    Correct answers: B, EMetrics are streamed to the CML UI as they are logged during a run.; You can add custom tags to an experiment run after it has finished.

    • A. Incorrect. Experiment runs can be initiated from a Workbench session, but also via the CML API, CLI, or scheduled jobs. The statement is too restrictive.
    • B. Correct. Metrics logged during an experiment run are streamed in real-time to the CML UI, allowing users to monitor progress dynamically.
    • C. Incorrect. CML allows comparing experiment runs from different experiments side-by-side in the UI, enabling cross-experiment analysis.
    • D. Incorrect. Artifacts logged during a run are not automatically stored in the project's data directory; they are tracked as experiment outputs and must be explicitly persisted.
    • E. Correct. Custom tags can be added to an experiment run after it has finished via the CML UI or API, helping organize and filter runs.

    Subdomain 1.3: Experiments

    5.A data scientist notices that an artifact logging call did not result in the expected artifact appearing in the experiment run. Which of the following is the most likely cause of this silent failure?

    1. A.The local file path passed to log_artifact does not point to an existing file.
    2. B.The object store bucket configured for artifacts lacks write permissions for the service account.
    3. C.The experiment run exceeded the maximum artifact count, causing new writes to fail.
    4. D.The artifact logging was called after the run had already completed, so the write was ignored.
    Show answer & explanation

    Correct answer: BThe object store bucket configured for artifacts lacks write permissions for the service account.

    • A. Incorrect. In CML, log_artifact will raise an explicit error if the local file path does not exist, so this would not result in a silent failure.
    • B. Correct. If the service account lacks write permissions to the object store bucket, the artifact upload may fail silently, as the error is not always surfaced to the user's code in CML.
    • C. Incorrect. Cloudera Machine Learning does not enforce a hard limit on artifact count that would cause silent failures; such limits typically raise an error immediately.
    • D. Incorrect. If artifact logging is called after the run completes, CML will typically raise an error or warning, not fail silently.

    Subdomain 1.3: Experiments

    6.What is the default retention policy for experiment runs in Cloudera Machine Learning?

    1. A.30-day retention period
    2. B.90-day retention period
    3. C.No automatic deletion
    4. D.1-year retention period
    Show answer & explanation

    Correct answer: CNo automatic deletion

    • A. Incorrect. Experiment runs in Cloudera Machine Learning are not automatically deleted after 30 days. The default retention is indefinite unless manually deleted.
    • B. Incorrect. There is no standard 90-day automatic deletion policy for experiment runs. They are retained indefinitely by default.
    • C. Correct. By default, Cloudera Machine Learning does not automatically delete experiment runs. They are retained indefinitely unless a user or admin manually deletes them.
    • D. Incorrect. There is no default 1-year automatic deletion period for experiment runs. Retention is indefinite unless manually managed.

    Subdomain 1.2: Projects

    7.How can an administrator view resource usage across all projects in CML?

    1. A.The Workspace Usage Dashboard, which aggregates resource consumption metrics.
    2. B.Project-level Charts, accessed individually for each project's usage.
    3. C.The Resource Quota management page, showing allocations per project.
    4. D.The CML API metrics endpoint, which provides per-project usage data.
    Show answer & explanation

    Correct answer: AThe Workspace Usage Dashboard, which aggregates resource consumption metrics.

    • A. Correct. The Workspace Usage Dashboard in CML aggregates resource consumption metrics (e.g., CPU, memory, GPU) across all projects, providing a centralized view for administrators. It is the standard UI feature to inspect overall workspace usage.
    • B. Incorrect. Project-level charts are specific to individual projects and do not provide a consolidated view of resource usage across all projects. They are useful for per-project details, not cross-project aggregation.
    • C. Incorrect. The Resource Quota management page shows allocations or limits per project, not actual usage metrics. It is for governance and setting boundaries, not for viewing consumption.
    • D. Incorrect. While the CML API metrics endpoint can provide per-project usage data for automation or integration, it does not offer a centralized, user-friendly dashboard for all projects in the product interface.

    Subdomain 1.2: Projects

    8.How are project-level environment variables managed in Cloudera Machine Learning (CML)?

    1. A.They are configured globally in workspace settings and inherited by every project in that workspace.
    2. B.They are written into a startup script that executes automatically at the beginning of each session or job.
    3. C.They are defined in Project Settings > Environment Variables and are available to all sessions, jobs, and applications in the project.
    4. D.They are loaded from a .env file stored in the project's home directory and read at runtime.
    Show answer & explanation

    Correct answer: CThey are defined in Project Settings > Environment Variables and are available to all sessions, jobs, and applications in the project.

    • A. Incorrect. Environment variables in Cloudera Machine Learning are not configured globally in workspace settings. They are managed at the project level and are not inherited by all projects by default. Workspace-level settings may provide shared defaults in some areas, but project environment variables are project-specific.
    • B. Incorrect. While startup scripts can be used for initialization tasks, they are not the standard mechanism for defining project environment variables in CML. Environment variables intended for sessions, jobs, and applications are configured through the project's settings, not hardcoded in a startup script.
    • C. Correct. In Cloudera Machine Learning, project environment variables are defined in the Project Settings under the Environment Variables tab. Once set there, they are automatically available to all sessions, jobs, and applications associated with that project. This is the recommended and supported method for managing environment variables at the project level.
    • D. Incorrect. Although a .env file may be used in some development workflows, CML does not rely on a .env file in the project's home directory for environment variable configuration. Instead, environment variables are managed through the Project Settings UI, ensuring consistent and secure access across project resources.

    Subdomain 1.2: Projects

    9.Which of the following enable MLflow experiment tracking in a Cloudera Machine Learning project?(Select 2)

    1. A.Set the MLflow tracking URI to a shared tracking server in the project environment variables.
    2. B.Enable the experiment tracking toggle in the project's general settings to activate logging.
    3. C.Configure the project's output directory to a shared location for artifact storage.
    4. D.Write a post-run hook that copies metrics to a database after each experiment.
    5. E.Use a project runtime that includes the MLflow library and set the tracking URI variable.
    Show answer & explanation

    Correct answers: A, ESet the MLflow tracking URI to a shared tracking server in the project environment variables.; Use a project runtime that includes the MLflow library and set the tracking URI variable.

    • A. Correct. Setting the MLflow tracking URI to a shared tracking server in the project environment variables ensures all experiments log to the same backend, enabling centralized tracking. This is a standard method in CML.
    • B. Incorrect. CML does not have a dedicated 'experiment tracking toggle' in the project's general settings. MLflow tracking is enabled via environment variables or runtime configurations, not a simple toggle.
    • C. Incorrect. Configuring the project's output directory is useful for artifact storage but does not enable MLflow experiment tracking. MLflow requires explicit tracking URI configuration.
    • D. Incorrect. A post-run hook can copy metrics to a database, but it is a custom workaround and does not enable MLflow's native experiment tracking. The tracking must be configured in the runtime or environment.
    • E. Correct. Using a project runtime that includes the MLflow library and setting the tracking URI variable (e.g., MLFLOW_TRACKING_URI) is a valid way to enable MLflow experiment tracking in CML.

    Subdomain 1.5: Data Visualizations

    10.A data engineer needs to visualize the training and validation loss curves from a deep learning model trained in a CML session. The lists `epochs`, `train_loss`, and `val_loss` are given. Which code correctly plots both curves on the same axes with a legend?

    1. A.plt.plot(train_loss, val_loss) ; plt.legend(['Train', 'Val'])
    2. B.plt.plot(epochs, train_loss) ; plt.plot(epochs, val_loss) ; plt.legend(['Train', 'Val'])
    3. C.plt.plot(epochs, train_loss, label='Train') ; plt.plot(epochs, val_loss, label='Val') ; plt.legend()
    4. D.Both B and C above are correct.
    Show answer & explanation

    Correct answer: DBoth B and C above are correct.

    • A. Incorrect. This code plots $val\_loss$ against $train\_loss$ rather than plotting both loss curves against epochs. The legend labels are not attached to the plotted curves, and the x-axis would show training loss values, not epoch numbers.
    • B. Correct. This code explicitly plots both `train_loss` and `val_loss` against `epochs` on the same axes. The `plt.legend()` call with a list of labels provides a legend for the two curves.
    • C. Correct. This code also correctly plots both loss curves against epochs. By using the `label` parameter in each `plt.plot()` call, `plt.legend()` automatically generates the legend from these labels.
    • D. Correct. Both options B and C are valid ways to plot the training and validation loss curves with a legend. Option B uses explicit legend labels, while option C uses the `label` parameter and an automatic legend. Therefore, D is the correct choice.

    Subdomain 1.5: Data Visualizations

    11.In CML, the Experiments feature uses which Python library to log and visualize metrics?

    1. A.TensorBoard
    2. B.MLflow
    3. C.Matplotlib
    4. D.Plotly
    Show answer & explanation

    Correct answer: BMLflow

    • A. Incorrect. TensorBoard is a visualization toolkit for TensorFlow, but it is not the library used by CML's Experiments feature for logging and tracking metrics.
    • B. Correct. MLflow is the primary library used by CML Experiments to log parameters, metrics, and artifacts, and to visualize experiment runs. It is the standard tracking library integrated with Cloudera Machine Learning.
    • C. Incorrect. Matplotlib is a general-purpose plotting library for creating static charts, not the experiment tracking backend used by CML Experiments.
    • D. Incorrect. Plotly is used for interactive visualizations, but it is not the library CML Experiments uses to log and visualize experiment metrics.

    Subdomain 1.7: GPUs

    12.When a CML user selects an NVIDIA A100 GPU for their workload, which capability is unique to the A100 compared to the T4 or V100?

    1. A.Support for CUDA 11.0 or higher
    2. B.Multi-Instance GPU (MIG) support
    3. C.Hardware-accelerated video encoding
    4. D.NVLink for GPU-to-GPU communication
    Show answer & explanation

    Correct answer: BMulti-Instance GPU (MIG) support

    • A. Incorrect. While the A100 supports CUDA 11.0 or higher, this is not unique because both the T4 and V100 also support modern CUDA versions (depending on driver and software stack).
    • B. Correct. Multi-Instance GPU (MIG) is a distinctive capability of the NVIDIA A100 that allows a single physical GPU to be partitioned into multiple isolated instances, each with dedicated resources. This feature is not available on the T4 or V100.
    • C. Incorrect. Hardware-accelerated video encoding is supported by the T4 (via NVENC) and also by the V100, so it is not unique to the A100.
    • D. Incorrect. NVLink for GPU-to-GPU communication is supported by both the V100 and A100, so it is not unique to the A100. The T4 does not support NVLink.

    Subdomain 1.7: GPUs

    13.A developer is running an inference workload on a T4 GPU in CML and notices that FP16 (half-precision) operations perform significantly better than FP32. Which hardware feature of the T4 is responsible for this?

    1. A.Ray Tracing Cores
    2. B.Tensor Cores with FP16 support
    3. C.Increased L2 cache size
    4. D.Higher memory clock speed
    Show answer & explanation

    Correct answer: BTensor Cores with FP16 support

    • A. Incorrect. Ray Tracing Cores are specialized hardware for graphics rendering, such as real-time ray tracing, and do not accelerate FP16 or FP32 computations in machine learning inference. They are not relevant to the performance difference observed.
    • B. Correct. The NVIDIA T4 GPU includes Tensor Cores designed to accelerate mixed-precision matrix operations, including FP16. These cores provide significantly higher throughput for deep learning inference compared to standard FP32 execution, explaining the performance boost observed.
    • C. Incorrect. While a larger L2 cache can improve memory access efficiency in some workloads, it does not specifically enable or optimize FP16 operations. The speedup in FP16 inference is attributable to dedicated tensor acceleration hardware, not cache enhancements.
    • D. Incorrect. Higher memory clock speed increases memory bandwidth, which can benefit data transfer, but it does not selectively boost FP16 arithmetic over FP32. The superior FP16 performance on a T4 is due to Tensor Cores, not memory clock differences.

    Subdomain 1.7: GPUs

    14.In CML, what is the behavior when a GPU-attached session is idle for an extended period?

    1. A.The session remains active and the GPU is never released until the user terminates the session.
    2. B.The session is automatically suspended after the idle timeout, and the GPU is released to the pool.
    3. C.The GPU is switched to a shared mode to allow other users to utilize the remaining capacity.
    4. D.The session continues to run but the GPU is downgraded to a lower tier to save costs.
    Show answer & explanation

    Correct answer: BThe session is automatically suspended after the idle timeout, and the GPU is released to the pool.

    • A. Incorrect. CML does not retain GPU-attached sessions indefinitely. Idle sessions are automatically managed to free resources, not kept active until manual termination.
    • B. Correct. CML automatically suspends a GPU-attached session after a configurable idle timeout. The GPU is released back to the pool, making it available for other workloads.
    • C. Incorrect. CML does not dynamically switch to a shared GPU mode upon idleness. GPUs are either fully allocated or released; no on-demand sharing is implemented.
    • D. Incorrect. CML does not downgrade GPU tiers for idle sessions. The session is suspended entirely, not throttled to a lower tier.

    Domain 2: Spark

    Subdomain 2.3: Window Functions

    15.To select all employees who have one of the top three salaries in their department, including ties so that more than three may be selected if there are ties, which function should be used in a subquery with a WHERE clause filtering the ranking result to ≤ 3?

    1. A.row_number() — assigns a unique number, so exactly three rows may be selected even if ties exist
    2. B.rank() — assigns same rank to ties, but then filtering rank ≤ 3 will include all top three ranks, including ties
    3. C.dense_rank() — assigns same rank to ties without gaps, so filtering ≤ 3 includes all top three distinct salary values and their tied rows
    4. D.ntile(3) — distributes rows into three roughly equal buckets, not suitable for selecting exactly the top salaries
    Show answer & explanation

    Correct answer: Cdense_rank() — assigns same rank to ties without gaps, so filtering ≤ 3 includes all top three distinct salary values and their tied rows

    • A. Incorrect. row_number() assigns a unique sequential number to each row, arbitrarily breaking ties. Filtering row_number ≤ 3 would select exactly three rows per department, not all employees tied for the top three salaries.
    • B. Incorrect. rank() assigns the same rank to tied rows but leaves gaps. Filtering rank ≤ 3 may not include all employees with the top three distinct salary values if there are ties that cause ranks to skip (e.g., many ties at rank 1 would skip rank 2 and 3). It does not guarantee inclusion of all top three salaries.
    • C. Correct. dense_rank() assigns consecutive ranks to distinct values without gaps. Filtering dense_rank ≤ 3 includes all employees whose salaries are among the top three distinct salary values, including all tied rows, which matches the requirement of selecting more than three if ties exist.
    • D. Incorrect. ntile(3) divides rows into three roughly equal buckets and does not rank by salary value, so it cannot reliably select the top three salaries with ties.

    Subdomain 2.3: Window Functions

    16.When LAG(column, offset, default) is used in Spark SQL and the offset goes beyond the partition boundary, what does the function return?

    1. A.The function returns the specified default value, or NULL if no default is given.
    2. B.The function throws an error because the offset exceeds the partition bounds.
    3. C.The function returns the first non-null value within the current window frame.
    4. D.The function returns the value of the current row as a substitute for the missing row.
    Show answer & explanation

    Correct answer: AThe function returns the specified default value, or NULL if no default is given.

    • A. Correct. When the offset goes beyond the partition boundary, LAG returns the specified default value. If no default is provided, it returns NULL instead of failing.
    • B. Incorrect. LAG does not throw an error when the offset exceeds the partition bounds; it handles the missing row gracefully by returning the default value or NULL.
    • C. Incorrect. LAG is not a non-null search function; it looks back by the given offset and does not search for the first non-null value. That behavior is typical of functions like FIRST_VALUE with filtering.
    • D. Incorrect. LAG does not substitute the current row's value; it returns the provided default or NULL when the target row is outside the partition.

    Subdomain 2.3: Window Functions

    17.A data analyst has a table of employee salaries and wants to find the median salary within each department. Since Spark SQL does not have a built-in MEDIAN window function, they need to use a creative approach. Which approach would correctly compute the median per department?(Select 2)

    1. A.Use the percentile_approx() aggregate function with GROUP BY on department to compute an approximate median.
    2. B.Use row_number() and count() with a window partition to assign row numbers, then filter for the middle position(s).
    3. C.Use the cume_dist() window function and filter rows where the cumulative distribution reaches 0.5.
    4. D.Use the ntile(2) window function and filter to the first tile, which approximates the lower half of the data.
    Show answer & explanation

    Correct answers: A, BUse the percentile_approx() aggregate function with GROUP BY on department to compute an approximate median.; Use row_number() and count() with a window partition to assign row numbers, then filter for the middle position(s).

    • A. Correct. `percentile_approx(0.5)` with GROUP BY department computes the approximate median per department. It is an aggregate function, not a window function, but effectively solves the per-group median problem.
    • B. Correct. Using `row_number()` and `count()` over a window partitioned by department and ordered by salary allows identifying the middle row(s) based on row count. This is a standard exact method for computing the median.
    • C. Incorrect. `cume_dist()` gives the cumulative distribution, but filtering at 0.5 does not reliably isolate the median value, especially with even-sized groups or ties. It may include multiple rows or miss the exact median.
    • D. Incorrect. `ntile(2)` splits data into two buckets; the first tile represents the lower half only, not the median value. This does not compute the middle value(s) needed for a median.

    Subdomain 2.1: DataFrames

    18.You have a DataFrame with a date column 'event_date'. You want to filter rows where event_date is equal to the current date when the code runs. Which expression should you use?

    1. A.col('event_date') == current_date()
    2. B.col('event_date') == now()
    3. C.col('event_date') == today()
    4. D.col('event_date') == sysdate()
    Show answer & explanation

    Correct answer: Acol('event_date') == current_date()

    • A. Correct. `current_date()` is a built-in Spark function that returns the current date as a DateType without time, which is appropriate for comparing with a date column like 'event_date'.
    • B. Incorrect. `now()` returns the current timestamp (TimestampType), including time. Directly comparing a DateType column with a TimestampType may cause type mismatch or unexpected results.
    • C. Incorrect. `today()` is not a standard Spark SQL or PySpark function. Spark uses `current_date()` to obtain the current date.
    • D. Incorrect. `sysdate()` is not a standard Spark function. It exists in some databases (e.g., Oracle) but is not available in Spark for DataFrame operations.

    Subdomain 2.1: DataFrames

    19.In Spark, which of the following transformations are considered narrow transformations? (Select three.)(Select 3)

    1. A.map
    2. B.filter
    3. C.flatMap
    4. D.groupByKey
    5. E.reduceByKey
    6. F.join
    Show answer & explanation

    Correct answers: A, B, Cmap; filter; flatMap

    • A. Correct. map is a narrow transformation because each input partition contributes to exactly one output partition, meaning Spark can process it without shuffling data across the cluster. The one-to-one partition dependency avoids redistribution.
    • B. Correct. filter is a narrow transformation because it evaluates each row independently within the same partition. No data needs to be shuffled or exchanged between partitions, as the filter condition is applied locally.
    • C. Correct. flatMap is a narrow transformation because it preserves the one-to-one partition dependency pattern from input to output. Even though one input record can produce multiple output records, all output stays within the same partition, so no shuffle occurs.
    • D. Incorrect. groupByKey is a wide transformation because Spark must shuffle all values for the same key to the same reducer/partition to group them. This crosses partition boundaries and requires data redistribution.
    • E. Incorrect. reduceByKey is a wide transformation because it requires shuffling data to combine values with the same key across partitions. Although it can perform a map-side combine, it still involves a full shuffle to repartition by key.
    • F. Incorrect. join is generally a wide transformation because matching keys from different datasets usually requires shuffling data across partitions to co-locate records with the same key. It is not considered narrow.

    Domain 3: Spark MLLib

    Subdomain 3.1: Model Selection and Tuning

    20.What is the purpose of the ParamGridBuilder class in Spark MLlib?

    1. A.It generates all combinations of specified hyperparameter values for tuning.
    2. B.It creates a pipeline of transformers and estimators for model training.
    3. C.It performs model evaluation using cross-validation on a dataset.
    4. D.It splits a dataset into training and test subsets for evaluation.
    Show answer & explanation

    Correct answer: AIt generates all combinations of specified hyperparameter values for tuning.

    • A. ParamGridBuilder is used to define a grid of hyperparameter values and generate all combinations for tuning models. This parameter grid is then passed to tools like CrossValidator or TrainValidationSplit.
    • B. Incorrect. Creating a pipeline of transformers and estimators is the role of the Pipeline class, not ParamGridBuilder. ParamGridBuilder only defines hyperparameter search space.
    • C. Incorrect. Model evaluation with cross-validation is handled by CrossValidator. ParamGridBuilder may supply the parameter combinations used during that process, but it does not perform the evaluation itself.
    • D. Incorrect. Splitting a dataset into training and test subsets is typically done with functions like randomSplit. ParamGridBuilder has nothing to do with dataset splitting.

    Subdomain 3.1: Model Selection and Tuning

    21.When using a BinaryClassificationEvaluator, which parameter name specifies the metric to be used?

    1. A.metricName
    2. B.labelCol
    3. C.scoreCol
    4. D.evaluationMetric
    Show answer & explanation

    Correct answer: AmetricName

    • A. Correct. The BinaryClassificationEvaluator in Spark MLlib uses the 'metricName' parameter to specify the evaluation metric, such as 'areaUnderROC' or 'areaUnderPR'.
    • B. Incorrect. The 'labelCol' parameter specifies the column name for the true labels, not the metric to be used.
    • C. Incorrect. The 'scoreCol' parameter specifies the column name for the predicted scores, not the metric to be used.
    • D. Incorrect. There is no 'evaluationMetric' parameter in BinaryClassificationEvaluator; the correct parameter is 'metricName'.

    Subdomain 3.1: Model Selection and Tuning

    22.You are using TrainValidationSplit with trainRatio=0.8 on a dataset of 1,000,000 records. How many records will be used for validation?

    1. A.200,000
    2. B.800,000
    3. C.100,000
    4. D.500,000
    Show answer & explanation

    Correct answer: A200,000

    • A. Correct. TrainValidationSplit uses the trainRatio to split the dataset. With trainRatio=0.8, 80% (800,000 records) are used for training, leaving 20% (200,000 records) for validation.
    • B. Incorrect. 800,000 records represent the training set, not the validation set. The validation set is the remaining 20%, which is 200,000 records.
    • C. Incorrect. 100,000 records would correspond to a trainRatio of 0.9 (90% training, 10% validation). For trainRatio=0.8, the validation set should be 20% of the total.
    • D. Incorrect. 500,000 records would imply a 50-50 split (trainRatio=0.5), which does not match the given trainRatio of 0.8.

    Subdomain 3.2: Fitting and Evaluating Models

    23.You are building a logistic regression model on a dataset of 100,000 rows. You plan to use 5-fold cross-validation for hyperparameter tuning. After tuning, you want an unbiased estimate of the model's performance on new data. Which dataset split strategy should you use?

    1. A.Reserve 20% as holdout test set before tuning; use cross-validation on the remaining 80% for hyperparameter tuning; evaluate final model on the holdout set.
    2. B.Pass the entire dataset to the cross-validator and use the average cross-validation metric as the unbiased estimate of future performance.
    3. C.Use a 50/50 train-test split; tune on the training set with cross-validation, then retrain on combined data and evaluate on the test set.
    4. D.Perform 5-fold cross-validation on the whole dataset, then repeat with different random seeds for a more stable performance estimate.
    Show answer & explanation

    Correct answer: AReserve 20% as holdout test set before tuning; use cross-validation on the remaining 80% for hyperparameter tuning; evaluate final model on the holdout set.

    • A. Correct. This approach ensures the holdout test set is never used during hyperparameter tuning (cross-validation is only on the training set), providing an unbiased estimate of model performance on unseen data. The 80/20 split is standard and efficient for a dataset of 100,000 rows.
    • B. Incorrect. Using the entire dataset only within cross-validation for both tuning and evaluation leads to data leakage, as the test folds are reused for evaluation. The average cross-validation metric is typically optimistic and not an unbiased estimate of future performance; it is useful for model selection but not final assessment.
    • C. Incorrect. A 50/50 split wastes a large portion of data for training, which can reduce model quality. More importantly, the approach still uses a holdout test set for final evaluation, but the split is inefficient. An 80/20 split is preferred to maximize training data while retaining a sufficient test set.
    • D. Incorrect. Repeating cross-validation with different random seeds may reduce variance in the estimate, but it still does not provide an unbiased final performance estimate because the entire dataset is used for tuning and evaluation. A separate, untouched test set is required for unbiased estimation.

    Subdomain 3.2: Fitting and Evaluating Models

    24.You are evaluating a multiclass classification model on a dataset with 10 classes. You use `MulticlassClassificationEvaluator` with `metricName='accuracy'`. The test set has 1000 samples. The model achieves an accuracy of 0.72. Which interpretation is correct?

    1. A.72% of test samples were correctly classified.
    2. B.The average precision across all classes is 0.72.
    3. C.The average F1 score for each class is 0.72.
    4. D.Predictions are within 72% of true labels in log loss.
    Show answer & explanation

    Correct answer: A72% of test samples were correctly classified.

    • A. Correct. Accuracy in multiclass classification is the proportion of correctly classified samples out of the total test samples. An accuracy of 0.72 on 1000 samples means 72% (720 samples) were correctly predicted.
    • B. Incorrect. Precision is a per-class metric measuring true positives divided by predicted positives. Averaging precision across classes gives macro-precision, not accuracy. With `metricName='accuracy'`, the evaluator does not return precision.
    • C. Incorrect. The F1 score is the harmonic mean of precision and recall, calculated per class. Accuracy does not imply any specific F1 value; they are distinct evaluation metrics.
    • D. Incorrect. Log loss measures the cross-entropy between predicted probabilities and true labels, not the percentage of correct classifications. An accuracy of 0.72 means 72% samples correctly classified, not a log-loss agreement.

    Subdomain 3.2: Fitting and Evaluating Models

    25.You have a dataset with a categorical label column 'outcome' with values 'yes' and 'no'. You use StringIndexer to convert it to 'label' (0.0 for 'no', 1.0 for 'yes'). You build a logistic regression model. After training, you call `model.summary.accuracy`. What accuracy value will be reported?

    1. A.The accuracy computed on the training data using the indexed label column.
    2. B.The accuracy computed on a validation set automatically held out during training.
    3. C.The accuracy of the model using the original 'outcome' column.
    4. D.The cross-validated accuracy from an internal 3-fold procedure.
    Show answer & explanation

    Correct answer: AThe accuracy computed on the training data using the indexed label column.

    • A. Correct. The `model.summary.accuracy` in Spark MLLib's LogisticRegressionSummary reports the accuracy computed on the training data using the indexed label column. This is the default behavior; no validation set is held out unless explicitly configured.
    • B. Incorrect. Spark MLLib does not automatically hold out a validation set during training for logistic regression. Any validation split must be done explicitly using tools like `CrossValidator` or `TrainValidationSplit`.
    • C. Incorrect. The accuracy is computed using the indexed label column ('label'), not the original string 'outcome' column. The StringIndexer transforms the labels, and the model operates on the numeric values.
    • D. Incorrect. The `model.summary.accuracy` does not perform internal cross-validation. Cross-validation requires explicit use of `CrossValidator` or similar utilities.

    Domain 4: Deploying a Machine Learning Model

    Subdomain 4.2: Autoscaling and Performance

    26.For which type of machine learning model does GPU acceleration typically provide the most significant latency reduction?

    1. A.Linear regression models with small feature sets.
    2. B.Decision tree-based models with categorical features.
    3. C.Large transformer-based models with many parameters.
    4. D.Rule-based models with extensive conditional logic.
    Show answer & explanation

    Correct answer: CLarge transformer-based models with many parameters.

    • A. Incorrect. Linear regression with small feature sets is computationally lightweight and runs efficiently on CPUs. GPU overhead often outweighs the minimal parallel computation benefits, so no significant latency reduction is observed.
    • B. Incorrect. Decision tree-based models rely on branching logic and irregular control flow, which do not map well to GPU parallelism. Their inference is dominated by sequential decisions rather than large matrix operations, limiting GPU acceleration benefits.
    • C. Correct. Large transformer-based models involve massive tensor and matrix computations that are highly parallelizable. GPUs are optimized for such operations, dramatically reducing inference latency for these models.
    • D. Incorrect. Rule-based models execute sequential conditional logic and simple comparisons, which do not benefit from GPU parallelism. Latency depends on rule complexity rather than raw compute throughput, making GPU acceleration ineffective.

    Subdomain 4.2: Autoscaling and Performance

    27.A team is deploying a stateful model that maintains user session data in memory. They need to enable autoscaling without losing session state. What is the recommended approach?

    1. A.Externalize session state to a distributed cache like Redis.
    2. B.Configure sticky sessions to route users to the same replica.
    3. C.Store session state in memory and synchronize across replicas.
    4. D.Disable autoscaling entirely for stateful model deployments.
    Show answer & explanation

    Correct answer: AExternalize session state to a distributed cache like Redis.

    • A. Correct. Externalizing session state to a distributed cache such as Redis decouples state from individual replicas, allowing replicas to be stateless and safely scale up or down without losing user session data. This is the standard pattern for enabling autoscaling on stateful workloads.
    • B. Incorrect. Sticky sessions route requests from the same user to the same replica, but they do not prevent state loss when that replica is terminated or rescheduled during autoscaling. They also reduce load-balancing effectiveness and provide no durable session storage.
    • C. Incorrect. Keeping state only in memory and synchronizing replicas is fragile, complex, and not scalable. It does not guarantee consistency during autoscaling events and can still result in data loss.
    • D. Incorrect. Disabling autoscaling avoids state-loss issues but contradicts the requirement to enable autoscaling. The recommended approach is to externalize state, not to prevent scaling.

    Subdomain 4.2: Autoscaling and Performance

    28.A model endpoint in CML experiences a cyclic traffic pattern, with high demand during business hours and very low demand at night. The team wants to minimize operational costs. Which configuration should they apply?

    1. A.Set the minimum replicas to 0 to allow scaling down to zero during low-traffic periods.
    2. B.Manually scale the endpoint up and down each day using the CML API.
    3. C.Set a very high target CPU utilization to keep fewer replicas active at all times.
    4. D.Deploy the model using a smaller instance type and never scale down the endpoint.
    Show answer & explanation

    Correct answer: ASet the minimum replicas to 0 to allow scaling down to zero during low-traffic periods.

    • A. Correct. Setting minimum replicas to 0 allows the endpoint to scale down to zero when there is no traffic, minimizing costs during low-demand periods like nighttime. This is a cost-effective autoscaling configuration for cyclic traffic patterns.
    • B. Incorrect. Manually scaling every day introduces operational overhead and is error-prone compared to automated scaling. It is not efficient or scalable for predictable cyclic patterns.
    • C. Incorrect. Setting a very high target CPU utilization may reduce the number of replicas but does not allow scaling down to zero during low traffic. It can also hurt performance by overloading the remaining replicas.
    • D. Incorrect. Using a smaller instance type lowers per-replica cost, but never scaling down keeps resources running all night, wasting money. This does not take advantage of the cyclic traffic pattern to minimize costs.

    Domain 5: Deep Learning and General Machine

    Subdomain 5.3: Supervised and unsupervised learning

    29.What is the primary difference between bagging and boosting ensemble methods?

    1. A.Bagging trains models sequentially, while boosting trains models in parallel.
    2. B.Bagging uses weighted voting, whereas boosting relies on majority voting.
    3. C.Bagging primarily reduces variance, while boosting primarily reduces bias.
    4. D.Bagging is for regression only, while boosting is for classification only.
    Show answer & explanation

    Correct answer: CBagging primarily reduces variance, while boosting primarily reduces bias.

    • A. Incorrect. This statement reverses the training order. Bagging trains models in parallel on different bootstrap samples, while boosting trains models sequentially, with each new model focusing on correcting errors of previous ones.
    • B. Incorrect. Bagging typically combines predictions using majority voting (classification) or averaging (regression), while boosting uses weighted voting, but this is not the primary difference; the core distinction lies in variance vs. bias reduction.
    • C. Correct. Bagging (e.g., Random Forest) primarily reduces variance by averaging multiple models trained on different data subsets, making predictions more stable. Boosting (e.g., AdaBoost) primarily reduces bias by sequentially building models that correct prior mistakes.
    • D. Incorrect. Both bagging and boosting can be applied to both regression and classification tasks. The difference is not about task type but about how the ensemble is trained and how predictions are combined.

    Subdomain 5.3: Supervised and unsupervised learning

    30.A data scientist trains a decision tree model and observes near-zero training error but high validation error. Further increasing tree depth decreases training error but increases validation error. Which concept best explains this phenomenon?

    1. A.It is the tradeoff between a model's predictive accuracy and the time required for training.
    2. B.It is the tradeoff between bias (underfitting) and variance (overfitting) as model complexity changes.
    3. C.It is the tradeoff between the total number of input features and model interpretability.
    4. D.It is the tradeoff between false positive rate and false negative rate in classification tasks.
    Show answer & explanation

    Correct answer: BIt is the tradeoff between bias (underfitting) and variance (overfitting) as model complexity changes.

    • A. Incorrect. This describes a tradeoff between predictive accuracy and training time, which does not address the overfitting issue. The near-zero training error and high validation error with increasing depth is a classic sign of the bias-variance tradeoff, not computational efficiency.
    • B. Correct. As tree depth increases, model complexity increases, reducing bias (underfitting) but increasing variance (overfitting). The observed pattern—low training error and high validation error—is the classic bias-variance tradeoff, indicating overfitting.
    • C. Incorrect. The tradeoff between number of input features and interpretability does not explain the behavior. The phenomenon is about model complexity and generalization, not feature count or interpretability.
    • D. Incorrect. False positive and false negative rates relate to classification thresholds and error types, not to why deeper trees overfit. The behavior is best explained by bias and variance, not class-specific error tradeoffs.

    Subdomain 5.4: Algorithms

    31.Which of the following statements describes L2 regularization?

    1. A.It shrinks all coefficients toward zero by the same amount.
    2. B.It penalizes the sum of squared coefficient values.
    3. C.It can force some coefficients to zero, selecting features.
    4. D.It reduces the model's variance but increases its bias.
    Show answer & explanation

    Correct answer: BIt penalizes the sum of squared coefficient values.

    • A. Incorrect. This statement is ambiguous but more closely describes L1 regularization, where the penalty is constant, leading to some coefficients being zero. L2 regularization shrinks coefficients proportionally, not by the same amount.
    • B. Correct. L2 regularization adds a penalty equal to the sum of the squared coefficient values (Ridge regression). This discourages large coefficients but does not force them to zero.
    • C. Incorrect. This is a property of L1 regularization (Lasso), which can set some coefficients exactly to zero, performing feature selection. L2 regularization shrinks coefficients smoothly but rarely eliminates them.
    • D. Incorrect. While L2 regularization does reduce variance and increase bias, this statement is true of regularization in general and does not specifically identify L2.

    Subdomain 5.4: Algorithms

    32.Which of the following hyperparameter changes would help reduce underfitting in a Random Forest model?(Select 2)

    1. A.Increase the total number of trees (n_estimators) in the forest.
    2. B.Increase the maximum allowed depth of each individual tree.
    3. C.Decrease the minimum samples required to split an internal node.
    4. D.Increase the minimum samples required to be at a leaf node.
    Show answer & explanation

    Correct answers: B, CIncrease the maximum allowed depth of each individual tree.; Decrease the minimum samples required to split an internal node.

    • A. Incorrect. Increasing the number of trees generally reduces variance and improves stability, but does not increase the complexity of individual trees, so it is not effective for reducing underfitting.
    • B. Correct. Increasing the maximum depth allows trees to grow deeper, capturing more complex patterns and reducing underfitting. However, it also increases the risk of overfitting.
    • C. Correct. Decreasing the minimum samples required to split an internal node allows more frequent splits, making trees more complex and better fitting the training data, which can reduce underfitting.
    • D. Incorrect. Increasing the minimum samples at a leaf node forces larger leaves, simplifying the model and increasing underfitting, not reducing it.

    Subdomain 5.4: Algorithms

    33.Which approach would a data scientist most likely take to increase precision in a binary classification model while being willing to sacrifice recall?

    1. A.Lower the classification threshold to increase recall, sacrificing precision.
    2. B.Raise the classification threshold to increase precision, sacrificing recall.
    3. C.Acquire more labeled data and retrain the model to boost both metrics.
    4. D.Replace the model with a more complex ensemble to improve precision and recall.
    Show answer & explanation

    Correct answer: BRaise the classification threshold to increase precision, sacrificing recall.

    • A. Lowering the classification threshold increases recall but typically decreases precision due to more false positives. This option prioritizes recall, not precision.
    • B. Raising the classification threshold makes the model more conservative, reducing false positives and increasing precision, while recall decreases. This is the standard trade-off to increase precision.
    • C. Acquiring more labeled data can improve model performance overall but does not directly or reliably increase precision while sacrificing recall. The outcome depends on data quality and model behavior.
    • D. A more complex ensemble may improve both metrics or increase overfitting, but it does not guarantee a controlled increase in precision with reduced recall, and it is not the standard approach for this trade-off.

    Subdomain 5.1: Learning

    34.What is the primary purpose of using a validation set during model training?

    1. A.To evaluate the model on unseen data after training is complete.
    2. B.To tune hyperparameters and detect overfitting during training.
    3. C.To reduce the computational time required for each epoch.
    4. D.To increase the complexity of the model for better accuracy.
    Show answer & explanation

    Correct answer: BTo tune hyperparameters and detect overfitting during training.

    • A. Incorrect. Evaluating the model on unseen data after training is complete is the purpose of the test set, not the validation set. The validation set is used during training to guide model development and tuning.
    • B. Correct. The validation set is used to tune hyperparameters and monitor performance on data not used for training. It also helps detect overfitting by showing when validation performance stops improving while training performance continues, ensuring the model generalizes well.
    • C. Incorrect. A validation set does not reduce computational time; it adds some extra evaluation overhead during training. Its purpose is model evaluation and tuning, not optimization of training speed.
    • D. Incorrect. A validation set does not increase model complexity. Model complexity is determined by architecture and hyperparameters; the validation set provides feedback to select a better configuration and prevent overfitting.

    Subdomain 5.1: Learning

    35.Which statement about the bias-variance tradeoff is correct?

    1. A.Increasing model complexity reduces bias and increases variance.
    2. B.Increasing model complexity increases bias and reduces variance.
    3. C.Decreasing model complexity reduces bias and increases variance.
    4. D.Decreasing model complexity increases bias and reduces variance.
    Show answer & explanation

    Correct answer: AIncreasing model complexity reduces bias and increases variance.

    • A. Correct. As model complexity increases, the model fits the training data more closely, reducing bias. However, the model becomes more sensitive to noise, increasing variance (risk of overfitting).
    • B. Incorrect. Increasing model complexity typically reduces bias, not increases it, because the model can capture more patterns. Variance increases, not decreases, with higher complexity.
    • C. Incorrect. Decreasing model complexity usually increases bias (underfitting) and reduces variance. The statement reverses the actual effect.
    • D. Incorrect. Decreasing model complexity increases bias and reduces variance. The statement incorrectly claims that variance increases when it actually decreases.

    Want the full experience?

    These are just samples. Practice the full Cloudera Machine Learning Engineer (CDP-6001) question bank in quiz mode — free, no signup, with domain practice and exam simulation.