databricks Data Engineer Professional · Practice questions

Section 8: Debugging and Deploying Practice Questions

Review 10 sample questions with their correct answers and explanations. Sign up free to continue with the full topic quiz.

Sign up free for the full quiz

Question 1

Which statement about integration tests for a data pipeline is correct?

  1. They test single functions in isolation
  2. They only check code style
  3. They run the pipeline end to end in a test environment — Correct
  4. They run in production on live data

Correct answer

They run the pipeline end to end in a test environment

Explanation

Integration tests validate that components work together, typically after deploying to a test target.

Question 2

Which approach deploys a Lakeflow declarative pipeline through CI/CD?

  1. Export it as CSV
  2. Use a cluster init script
  3. Define it in a bundle and deploy it — Correct
  4. Create it manually in each workspace

Correct answer

Define it in a bundle and deploy it

Explanation

Bundles manage pipelines as resources across targets.

Question 3

A data engineer wants to unit test a transformation function that takes and returns a DataFrame. Which approach is best practice?

  1. Skip testing because Spark functions cannot be tested
  2. Test it by running the production job and inspecting the output table
  3. Move it to a module and test with pytest — Correct
  4. Write tests as markdown cells in the notebook

Correct answer

Move it to a module and test with pytest

Explanation

Modular code is testable with pytest; pyspark.testing provides DataFrame comparison utilities.

Question 4

Which job design allows a failed task in a backfill of 100 dates to be rerun without rerunning successful dates?

  1. Create one job per date manually
  2. Run all dates in a single notebook loop without checkpointing
  3. Use a for each task and repair the run — Correct
  4. Use a continuous job

Correct answer

Use a for each task and repair the run

Explanation

Repair reruns only failed iterations.

Question 5

Which statement about the Lakeflow Jobs 'for each' task in large backfills is correct?

  1. It is limited to SQL tasks
  2. It cannot pass parameters
  3. It runs all inputs on the driver sequentially
  4. It runs a nested task per input with set concurrency — Correct

Correct answer

It runs a nested task per input with set concurrency

Explanation

For each tasks parallelize backfills over parameter lists.

Question 6

Which bundle setting validates that production deployments use a service principal and specific settings?

  1. include: '*.yml'
  2. mode: production — Correct
  3. databricks bundle init
  4. mode: development on prod

Correct answer

mode: production

Explanation

Production mode enforces checks such as no development prefixes and requires appropriate run_as configuration.

Question 7

A bundle deploys jobs, pipelines and dashboards. Which CI/CD sequence is recommended?

  1. Deploy to production first, then test
  2. Only validate YAML and skip tests
  3. Deploy directly to production from developer laptops
  4. PR: validate, test, deploy to test; merge: deploy to prod — Correct

Correct answer

PR: validate, test, deploy to test; merge: deploy to prod

Explanation

Automated tests in a non-production target gate production deployments.

Question 8

A job is configured with a Git source and a branch. What happens at each run?

  1. The job fails unless a tag is used
  2. The job uses a cached copy from its creation date
  3. The job runs code from the workspace's personal folders
  4. It runs the latest commit of that branch — Correct

Correct answer

It runs the latest commit of that branch

Explanation

Jobs with Git sources fetch the specified ref at run time; pinning a tag gives fixed versions.

Question 9

A data engineer needs to run Python code in a pipeline that imports a shared library from the repository. Which approach is best for bundles?

  1. Build a wheel in the bundle and attach it to tasks — Correct
  2. Copy the code into every notebook
  3. Store it in the DBFS root without versioning
  4. Install it manually on each cluster

Correct answer

Build a wheel in the bundle and attach it to tasks

Explanation

Bundles can build artifacts such as wheels and attach them to tasks, keeping versions consistent.

Question 10

A test must compare an output DataFrame with an expected one, ignoring row order. Which utility helps?

  1. df.show()
  2. dbutils.fs.ls
  3. assertDataFrameEqual — Correct
  4. df.explain()

Correct answer

assertDataFrameEqual

Explanation

assertDataFrameEqual compares schema and data, with options for ordering and tolerance.

Ready for the full quiz?

Create a free QuizAnalyst account to practice the complete question set and save your progress.

Sign up free for the full quiz