Databricks Generative AI Engineer Associate exam dumps

Databricks Generative AI Engineer Associate practice question 74 of 306

Databricks Certified Generative AI Engineer Associate. Free level, Databricks. Free question with the correct answer and a full explanation.

Databricks Generative AI Engineer Associate Question 74

Select 3

You are tasked with fine-tuning a generative AI model designed to generate Python code snippets based on natural language descriptions. Which of the following prompt/response pairs align with the task the model is designed to perform?

  1. A

    Prompt: 'Generate a Python function to calculate the factorial of a number.' Response: 'def factorial(n):\n if n == 0: return 1\n else: return n * factorial(n-1)'

  2. B

    Prompt: 'What is the capital of France?' Response: 'The capital of France is Paris.'

  3. C

    Prompt: 'Generate a Python script to read a CSV file.' Response: 'import pandas as pd\ndata = pd.read_csv("file.csv")\nprint(data.head())'

  4. D

    Prompt: 'Explain the concept of recursion with examples.' Response: 'Recursion is a method of solving problems where a function calls itself. For example, the factorial function uses recursion.'

  5. E

    Prompt: 'Create a Python class for a basic calculator.' Response: 'class Calculator:\n def add(self, a, b): return a + b\n def subtract(self, a, b): return a - b'

Show answer and explanation

Correct answers: A, C, E

Explanation

The task of the model is to generate Python code snippets based on natural language descriptions. Prompt/response pairs that involve generating Python code (like creating a function, script, or class) align with the task, while those focusing on factual answers or conceptual explanations do not.

  • A. Correct.

    This prompt/response pair aligns with the model's task because it involves generating Python code based on a natural language description.

  • B. Incorrect.

    This does not align with the model's task as it involves factual question-answering, which is outside the scope of generating Python code.

  • C. Correct.

    This prompt/response pair aligns with the model's task because it involves generating Python code to perform a specific function as requested.

  • D. Incorrect.

    This does not align with the model's task as it involves explaining a programming concept rather than generating Python code.

  • E. Correct.

    This prompt/response pair aligns with the model's task because it involves generating Python code for a specific use case (a calculator class).

Timed practice exam

Take a Databricks Generative AI Engineer Associate practice test under exam conditions

45 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam