Check Your Knowledge
Test what you picked up in this section – the workspace, notebooks, magic commands, dbutils,
debugging, Git folders, and compute clusters.
-
What is the primary difference between
%runanddbutils.notebook.run? A.%runis faster B.%runshares the calling notebook’s session and variables;dbutils.notebook.runexecutes the target notebook as a separate, isolated run C.dbutils.notebook.runonly works with SQL notebooks D. There is no functional difference -
Which magic command lets a cell in a Python-default notebook run as Spark SQL? A.
%python-sqlB.%sqlC.#!sqlD.--sql -
What is a jobs cluster, compared to an all-purpose cluster? A. A cluster reserved exclusively for SQL warehouses B. A cluster created for a single scheduled job run and torn down immediately afterward C. A cluster that can never autoscale D. A cluster type only available on Azure
-
Where should credentials such as a database password be stored for use in a notebook? A. Hardcoded directly in the notebook cell B. In a plain text workspace file C. In a secret scope, retrieved via
dbutils.secrets.getD. In a notebook widget -
What does a widget created with
dbutils.widgetsbecome when the same notebook runs as a Lakeflow Jobs task? A. It is ignored entirely B. It becomes a job parameter, supplying the same value non-interactively C. It converts automatically into a secret D. It forces the job to run on a jobs cluster only -
What is the main advantage of a Git folder over a plain workspace file for production pipeline code? A. Git folders run faster B. Git folders support branches, pull requests, and integrate with CI/CD, unlike workspace files’ simple revision history C. Workspace files cannot be edited by more than one person D. Git folders don’t require a cluster to run
-
What AWS cost-saving option can worker nodes (but generally not the driver node) safely use? A. Reserved Instances only B. Spot instances C. Dedicated hosts D. Free-tier instances only
-
What does an auto-termination setting on an all-purpose cluster do? A. Deletes all notebooks attached to the cluster B. Automatically shuts down the cluster after a period of inactivity, to avoid unnecessary cost C. Terminates the workspace itself D. Prevents the cluster from ever being restarted
-
What is a cluster policy used for? A. Encrypting data at rest B. Constraining what cluster configuration options a user is allowed to choose C. Defining Unity Catalog permissions D. Scheduling job runs
-
Which tool is best suited for compute optimized specifically for SQL/BI dashboard workloads? A. An all-purpose cluster B. A jobs cluster C. A SQL warehouse D. An instance pool
Answer Key
- B –
%runinlines the target notebook into the current session (shared variables);dbutils.notebook.runexecutes it as an independent run with parameters in and a return value out. - B –
%sqlswitches that cell’s language to Spark SQL regardless of the notebook’s default. - B – a jobs cluster exists only for the duration of the scheduled run it was created for, then terminates, incurring no idle cost.
- C – secrets belong in a secret scope, retrieved via
dbutils.secrets.get, never hardcoded or plain-text. - B – the same parameterization mechanism serves both interactive widgets and non-interactive job parameters.
- B – branching, pull requests, and CI/CD integration are Git folder capabilities that plain workspace files don’t have.
- B – spot instances offer significant savings for workers; losing the driver to reclamation fails the whole job, so it’s generally avoided there.
- B – auto-termination shuts down an idle all-purpose cluster automatically, the main defense against accidental cost from a forgotten running cluster.
- B – cluster policies are admin-defined templates that restrict the configuration choices available to users.
- C – SQL warehouses are the compute type purpose-built for SQL/BI workloads, available in serverless or classic form.
| ← Previous: Databricks Compute Cluster | Next: Delta Lake - Deep Dive → | |:—|—:|