Home / GenAI Engineer practice test / Assembling and Deploying Applications / Question

Databricks Generative AI Engineer Associate · free practice question

A programmer intends to construct a basic workflow that performs the following sequence of operations: accepts input from a user, transforms it into an…

Exam-style question on Assembling and Deploying Applications from the free GenAI Engineer practice test, with the answer and a full explanation below.

Updated November 11, 2026

Assembling and Deploying Applications

A programmer intends to construct a basic workflow that performs the following sequence of operations: accepts input from a user, transforms it into an appropriate prompt for an LLM, invokes the LLM, and finally extracts the textual output. When utilizing LangChain Expression Language (LCEL) and specifically the pipe (|) operator, which of the following correctly builds the variable chain?

  1. ACombine PromptTemplate.from_template('{question}'), ChatOpenAI() and StrOutputParser() with the + operator and assign the result to chain
  2. BPass PromptTemplate.from_template('{question}') and ChatOpenAI() as arguments to the StrOutputParser() constructor
  3. CCreate an LLMChain with PromptTemplate.from_template('{question}') as its prompt and ChatOpenAI() as its llm argument
  4. DPipe PromptTemplate.from_template('Answer this: {question}') into ChatOpenAI() and pipe that into StrOutputParser()
Answer & explanation

Correct answer: D

WHY D is correct: This is the canonical LCEL minimal chain. The pipe operator (|) chains Runnable objects left-to-right: the PromptTemplate formats the input dict into a prompt message, ChatOpenAI() calls the LLM and returns an AIMessage, and StrOutputParser() extracts the text string. The chain is invoked with chain.invoke({'question': '...'}).

WHY NOT A: The + operator is not a valid chain composition operator in LCEL. Runnable objects are composed with | (pipe), not +.

WHY NOT C: LLMChain is the legacy pre-LCEL API. While it works, it is not LCEL and does not support .stream(), .batch(), or async operations natively. The question specifies LCEL and the pipe-operator approach.

WHY NOT B: StrOutputParser() is not a wrapper constructor that accepts other objects as positional arguments. It is an instantiated Runnable that receives LLM output via | — it cannot be constructed with the prompt and LLM as parameters.

Take the full GenAI Engineer practice test free →

Would you pass today?

This question is one of 45 in the free, timed Databricks Generative AI Engineer Associate practice test. Take it and get a section-by-section score.

Start the free test →