CertLumen

Free practice questions · Databricks

10 Databricks Certified Machine Learning Associate practice questions, with answers

Exam-style questions from the CertLumen course, spread over the exam's sections by their weights. Each has its answer and why. They're written for practice: never questions from the real exam.

Question 1 · Databricks Machine Learning

Registering a model to Unity Catalog fails with an error saying the model passed for registration did not contain any signature metadata. The model was logged with mlflow.sklearn.log_model(model, name="model"). What is the most direct fix?

  1. ARegister the model under a two-level name such as ml.churn_model, so the signature check is skipped
  2. BGrant the user EXECUTE on the target schema
  3. CLog the model again with an input_example or signature, then register it
  4. DCall mlflow.set_registry_uri("databricks") and retry the registration
Show the answer

C. Unity Catalog requires every new model version to have a model signature. Pass input_example= (MLflow infers the signature) or signature=infer_signature(X, model.predict(X)) when logging, then register the newly logged model.

Question 2 · Databricks Machine Learning

After validation, an ML engineer wants to mark version 3 of prod.ml.churn_model with validation_status = approved, without changing tags on other versions. Which call should they use?

  1. Aclient.set_registered_model_tag("prod.ml.churn_model", "validation_status_v3", "approved")
  2. Bclient.set_model_version_tag("prod.ml.churn_model", "3", "validation_status", "approved")
  3. Cmlflow.set_tag("validation_status", "approved")
  4. Dclient.set_registered_model_alias("prod.ml.churn_model", "approved", 3)
Show the answer

B. Unity Catalog keeps separate tags on registered models and on model versions. set_model_version_tag(name, version, key, value) tags one version; it needs ownership of the model or the APPLY TAG privilege.

Question 3 · Databricks Machine Learning

Fraud features in the offline table ml.fraud.card_features change throughout the day, and the online copy used by the serving endpoint must reflect changes as soon as they happen. Change Data Feed is enabled on the table. Which publish_table setting fits?

  1. Apublish_mode="SNAPSHOT"
  2. Bpublish_mode="TRIGGERED" run once a week
  3. Cpublish_mode="CONTINUOUS"
  4. DNo publish mode, because online stores read the Delta table directly
Show the answer

C. publish_table supports TRIGGERED (the default, incremental on demand or on a schedule), CONTINUOUS (streaming, immediate updates) and SNAPSHOT (one-time full copy). TRIGGERED and CONTINUOUS need Change Data Feed on the source table.

Question 4 · Databricks Machine Learning

A data scientist runs AutoML classification on loan applications from 2022 to 2026 to predict default. The model will score future applications, so the test set must hold the most recent applications rather than a random sample. What should they do?

  1. ASelect application_date as the time column, so AutoML splits the data chronologically
  2. BSort the input table by application_date before starting, so the default split keeps the latest rows for testing
  3. CExclude application_date with exclude_cols, because a date column makes AutoML split randomly
  4. DSet primary_metric to log_loss, which makes AutoML hold out the most recent rows
Show the answer

A. By default AutoML splits the data randomly into 60% training, 20% validation and 20% test, stratified for classification. When you select a time column (time_col in the API), it splits chronologically instead: the earliest rows train, the next ones validate and the latest ones test, which mirrors how the model will be used on future data. The time column can be a timestamp, integer or string column.

Question 5 · Data Processing

dbutils.data.summarize(df) reports about 1.03 million distinct values for customer_id, but SELECT COUNT(DISTINCT customer_id) returns 981,442. The team wants the profile itself to show the exact distinct count. What should the data scientist do?

  1. ARun dbutils.data.summarize(df, precise=True) to get exact distinct counts
  2. BRun dbutils.data.summarize(df.limit(64000)) so that the profile is based on every displayed row
  3. CFill the NULL values in customer_id first, because the profile counts NULL as a distinct value
  4. DUse df.summary('distinct'), which returns an exact distinct count for every column type
Show the answer

A. By default (precise=False), dbutils.data.summarize approximates some statistics to save time: the distinct count of a high-cardinality categorical column has about 5% relative error, which matches the gap here. With precise=True (Databricks Runtime 10.4 LTS and above), all statistics are exact except numeric histograms and percentiles.

Question 6 · Data Processing

A data scientist wants to compare the distribution of price across the five values of neighborhood, including the median and the outliers in each group. Which visualization fits best?

  1. AA scatter plot of the StringIndexer index of neighborhood against price
  2. BA box plot of price grouped by neighborhood
  3. CA pie chart of the total price per neighborhood
  4. DA line chart of price ordered by neighborhood name
Show the answer

B. A box plot per category is the standard way to compare a continuous feature across the levels of a categorical feature. Each box shows the quartiles, the line inside it is the median, and points beyond the whiskers (1.5 x IQR) are outliers, so groups can be compared side by side. Databricks notebook visualizations include a box chart, and seaborn's boxplot works on a pandas sample.

Question 7 · Model Development

A team tunes six mostly continuous hyperparameters of a gradient-boosted model. Each training run takes about 25 minutes and the budget allows roughly 40 runs. They want the results of completed runs to guide which settings are tried next. Which tuning approach fits best?

  1. AA full grid search over 4 values of each of the six hyperparameters
  2. BRandom search with 40 samples drawn from the same ranges
  3. CTrain one model with default values, then adjust the settings by hand
  4. DBayesian search with TPE, for example Hyperopt tpe.suggest
Show the answer

D. Bayesian (sequential model-based) search builds a model of score versus hyperparameters from completed trials and picks the next candidates where improvement is likely, so it usually needs fewer trials than grid or random search. Grid search explodes combinatorially with six dimensions, and random search doesn't learn.

Question 8 · Model Development

A team tunes 20 hyperparameter combinations for a Spark ML model on a 900-million-row table. Each fit takes about 90 minutes and they need results within two days. A 25% validation slice of this table is large enough to be representative. Which tuning setup is most appropriate?

  1. ATrainValidationSplit with trainRatio=0.75
  2. BCrossValidator with numFolds=10 for the most reliable estimate
  3. CCrossValidator with numFolds=5 and parallelism=1
  4. DScore each combination on the training data to save time
Show the answer

A. Cross-validation is most valuable on small or medium datasets. When data is plentiful and each fit is expensive, a train-validation split gives a dependable estimate for a fraction of the cost: 21 fits versus at least 61 for 3-fold cross-validation.

Question 9 · Model Development

A churn dataset has 300,000 rows and 40 columns and fits easily in the driver's memory. The data scientist wants an XGBoost model and to try about 100 hyperparameter configurations quickly on a multi-node cluster. Which approach is most appropriate?

  1. AUse Spark ML only, because single-node libraries such as XGBoost can't read data that is stored in Unity Catalog tables
  2. BRepartition the pandas DataFrame across the workers, so that one XGBoost model trains faster on each partition
  3. CTrain every configuration one after another on the driver, because tuning trials can't run in parallel
  4. DTrain single-node XGBoost on pandas data and spread the independent tuning trials across the cluster's workers
Show the answer

D. Data size decides the library. When the training data fits on one machine, single-node libraries such as scikit-learn, XGBoost and LightGBM are simple and fast, and the cluster is used to run many tuning trials at once (for example with Optuna, Joblib Spark or, on older runtimes, Hyperopt SparkTrials). Spark ML (pyspark.ml) is for data too large for one machine.

Question 10 · Model Deployment

Smart meters send up to 30,000 readings per second, and the volume changes by a factor of ten between night and day. An anomaly detection model registered in Unity Catalog must score every reading within minutes, and the team wants compute that resizes automatically with minimal operational work. Which design best meets these requirements?

  1. AA Structured Streaming notebook job on fixed-size compute that applies the model with spark_udf
  2. BA streaming job that calls a Model Serving endpoint over REST for every reading
  3. CA Lakeflow Spark Declarative Pipelines (DLT) pipeline that applies the model as a Spark UDF
  4. DA nightly batch job that scores the previous day's readings with pandas
Show the answer

C. A declarative pipeline applies the model as a Spark UDF inside a streaming table and manages checkpoints, retries and scaling. Serverless pipelines always use enhanced autoscaling, which adds and removes compute as the streaming load changes, so the fluctuating volume is handled without manual sizing.

How ready are you?

Take ten more, weighted like the real exam, and see your score by section and a rough chance of passing. The course has 270 questions and 4 timed practice exams.

Take the free check

About the course · Free study guide · A question a day by email