AI-901 Generative AI apps and agents practice questions
12 sample questions with full explanations. Try each one before you open the answer. New to this area? Read the Generative AI apps and agents study guide first.
-
Question 1
Your app asks a model to sort support tickets into one of five categories, but its labels are inconsistent and sometimes in the wrong format. Which prompt technique is most likely to help?
- A Raise the temperature so the model explores more options
- B Include a few example tickets with their correct category in the prompt
- C Switch the deployment to Global Batch
- D Increase the max output tokens
Show answer and explanation
Answer: B
Giving the model a few examples of inputs with the correct outputs (few-shot learning) shows it exactly what you expect, which makes its labels and format more consistent.
- A: Higher temperature makes output more random, which would make the labels less consistent.
- C: Global Batch changes how requests are processed and billed, not how well the model follows a format.
- D: A category label is short. More output tokens won't make it more accurate or consistent.
Source: Prompt engineering techniques (Microsoft Learn)
-
Question 2
A team is writing prompts for a marketing assistant in Microsoft Foundry. For each statement, choose Yes if it is true or No if it is false.
- A specific request that states the audience, length and format usually gets better results than a vague request.
- In a long prompt, repeating the key instructions at the end can help the model follow them.
- Using clear separators, such as ### or headings, between instructions and content makes a prompt harder for the model to follow.
Show answer and explanation
A specific request that states the audience, length and format usually gets better results than a vague request. Yes In a long prompt, repeating the key instructions at the end can help the model follow them. Yes Using clear separators, such as ### or headings, between instructions and content makes a prompt harder for the model to follow. No Good prompts leave as little to interpretation as possible, so stating the audience, length and format helps. Models can be influenced more by the end of a prompt, so repeating key instructions there is worth trying. Clear syntax, such as separators and headings, makes intent clearer, not harder to follow.
Source: Prompt engineering techniques (Microsoft Learn)
-
Question 3
You are deploying a model in the Foundry portal. For each statement, choose Yes if it is true or No if it is false.
- You choose a deployment type, which affects throughput and where data is processed.
- For a Global Standard deployment, you can assign a Tokens Per Minute (TPM) allocation.
- You must fine-tune a model before you can deploy it.
Show answer and explanation
You choose a deployment type, which affects throughput and where data is processed. Yes For a Global Standard deployment, you can assign a Tokens Per Minute (TPM) allocation. Yes You must fine-tune a model before you can deploy it. No When you deploy a model, you choose settings such as the deployment type (which is tied to throughput and data-processing requirements), the model version and a TPM allocation. Models from the catalog can be deployed as they are; fine-tuning is optional.
Source: Generative AI models (Get started with generative AI and agents in Microsoft Foundry) (Microsoft Learn)
-
Question 4
You're building an agent in Microsoft Foundry that must look up a customer's order in the company database and then email them an update. Which part of the agent gives it these abilities?
- A Its instructions
- B Its tools
- C Its model
- D Its deployment type
Show answer and explanation
Answer: B
An agent in Foundry combines a model, instructions and tools. Tools are the actions the agent can take by calling external systems, such as querying a database or sending email.
- A: Instructions define the agent's role, behavior and rules. They can tell it to email customers, but they can't give it access to email or the database.
- C: The model provides the reasoning. On its own it can't reach the database or send email.
- D: The deployment type affects throughput and where data is processed, not what actions the agent can take.
Source: Creating an agent (Get started with generative AI and agents in Microsoft Foundry) (Microsoft Learn)
-
Question 5
You are creating a single agent in the Foundry portal. For each statement, choose Yes if it is true or No if it is false.
- You can save a model, instructions and tools together as an agent.
- You can test and refine the agent in the playground before using it in an app.
- An agent can only use one tool.
Show answer and explanation
You can save a model, instructions and tools together as an agent. Yes You can test and refine the agent in the playground before using it in an app. Yes An agent can only use one tool. No In the Foundry portal you save a model, instructions and tools as an agent, then test and refine it in the playground. An agent can have several tools, such as web search, a database and Code Interpreter, and uses whichever ones fit the request.
Source: Creating an agent (Get started with generative AI and agents in Microsoft Foundry) (Microsoft Learn)
-
Question 6
A developer wants a Python app to send questions to an agent that was already built and tested in the Foundry portal. What does the app connect to?
- A The model deployment the agent uses, calling the model directly
- B The Foundry project, using the Foundry Projects SDK
- C The Azure portal's web interface
- D The storage account where the agent's files are kept
Show answer and explanation
Answer: B
To use an agent from a client app, you connect to the Foundry project with the Foundry Projects SDK, then call the agent through the project. The agent's model, instructions and tools come with it.
- A: Calling the model directly would skip the agent's instructions and tools.
- C: The Azure portal is a management website, not something an app calls to talk to an agent.
- D: A storage account holds files. It can't run the agent or return its answers.
Source: Creating an agent (Get started with generative AI and agents in Microsoft Foundry) (Microsoft Learn)
-
Question 7
You are writing a lightweight client app for an existing Foundry agent. For each statement, choose Yes if it is true or No if it is false.
- The app must identify which agent it wants to call, for example by the agent's ID or name.
- The app must re-send the agent's full instructions with every request.
- The app sends the user's message to the agent and receives the agent's response.
Show answer and explanation
The app must identify which agent it wants to call, for example by the agent's ID or name. Yes The app must re-send the agent's full instructions with every request. No The app sends the user's message to the agent and receives the agent's response. Yes The client connects to the project and names the agent it wants to call. The agent's instructions and tools are stored with the agent in Foundry, so the app only sends the user's message and gets back the response.
Source: Creating an agent (Get started with generative AI and agents in Microsoft Foundry) (Microsoft Learn)
-
Question 8
Your app asks a model to find the renewal date in each uploaded contract. Some contracts have no renewal date, and for those the model invents a plausible-looking one. Which prompt change most directly addresses this?
- A Add more example contracts to the prompt, each one showing a renewal date
- B Lower the temperature to 0
- C Ask the model to summarize the whole contract in detail before it answers
- D Tell the model what to reply when the date isn't there
Show answer and explanation
Answer: D
Giving the model an "out", such as replying "not found" when the answer isn't in the text, reduces made-up answers. Without one, the model tends to produce something that looks like an answer even when the source has none.
- A: Examples that always contain a date teach the model that a date is always expected, which can make invented dates more likely.
- B: A temperature of 0 makes answers more consistent, but the model can still consistently invent a date when none exists.
- C: More explanation doesn't tell the model what to do when the date is missing, so it can still invent one.
Source: Prompt engineering techniques (Microsoft Foundry) (Microsoft Learn)
-
Question 9
Your chat client sends REST requests to a model endpoint in Microsoft Foundry. Every request is rejected as unauthorized. The JSON body and the endpoint URL are correct. What is the request most likely missing?
- A The Azure subscription ID in a request header
- B The deployment's model version number
- C The name of the Foundry portal user who deployed the model
- D An API key or a Microsoft Entra ID token
Show answer and explanation
Answer: D
Foundry endpoints are protected. An application can only use one if it presents the correct API key, or a token showing its Microsoft Entra ID credentials are valid. These go in the request headers, alongside metadata such as the content type.
- A: A subscription ID identifies where resources live, but it isn't a credential. Anyone could know it, so it can't prove the caller is allowed in.
- B: The model version is set on the deployment itself. It has nothing to do with whether the caller is allowed in.
- C: The endpoint checks a key or token, not who deployed the model. A user's name isn't a credential.
Source: Using Microsoft Foundry endpoints (Get started with AI in Azure) (Microsoft Learn)
-
Question 10
A marketing department is starting with Microsoft Foundry. It plans three separate AI use cases: a campaign-copy assistant, a social media monitor and an image generator. It wants a single Azure resource for the whole department, with a separate workspace for each use case. How should it set this up?
- A Three Foundry resources, each with one project
- B One Foundry project that holds three Foundry resources
- C One Foundry resource with three Foundry projects inside it
- D One model deployment shared by all three, with no resource or project
Show answer and explanation
Answer: C
A Foundry resource is the Azure resource that provides the platform capabilities. A Foundry project is a workspace inside that resource where you build apps, agents and evaluations. A common pattern is one resource for a team or department with a separate project for each use case.
- A: This gives each use case a workspace, but it uses three resources instead of the single department-wide resource the team wants.
- B: This reverses the relationship. Projects live inside a resource, not the other way around.
- D: Model deployments are created inside a Foundry resource; you can't have one without the other.
Source: Microsoft Foundry for AI (Get started with AI in Azure) (Microsoft Learn)
-
Question 11
Your Python client app sends each user message to a Foundry agent with responses.create(). When a user asks "What is the size of France?" and then "And what is the capital city?", the agent doesn't know which country the second question means. What should the app do?
- A Copy the agent's instructions into every input so the agent remembers the topic
- B Add a line to each input that tells the agent to remember earlier questions
- C Create a new conversation for each question so every request starts clean
- D Create a conversation once and pass its ID in every responses.create() call
Show answer and explanation
Answer: D
A conversation keeps the history of a multi-turn chat. The app creates it once with conversations.create(), then passes the same conversation ID with each question, so the agent sees the earlier turns and knows the follow-up is about France.
- A: The agent already has its instructions. The missing piece is the earlier messages, not the instructions.
- B: Telling the agent to remember doesn't help if the earlier messages aren't sent with the request. It can't recall turns it never sees.
- C: A new conversation per question is the cause of the problem. Each request starts with no history, so the follow-up loses its context.
Source: Quickstart: Get started with Microsoft Foundry SDK (Microsoft Learn)
-
Question 12
A company is building a chat app on a model deployed in Microsoft Foundry. Answers must come from its internal policy documents, which change every month, and the team doesn't want to retrain the model each time. Which approach should they use?
- A Fine-tune the model on the policy documents every month
- B Use retrieval augmented generation (RAG) over the policy documents
- C Raise the model's temperature so it explores more possible answers
- D Paste every policy document into the system prompt
Show answer and explanation
Answer: B
RAG retrieves the relevant passages from your documents at question time and gives them to the model, so answers stay grounded in the latest version without retraining. Microsoft's guidance is to use RAG when answers must be grounded in private or frequently changing data.
- A: Fine-tuning changes the model's behavior or style. It would have to be repeated every time the documents change.
- C: Temperature only changes how random the wording is. It doesn't give the model access to the documents.
- D: Putting every document in the system prompt doesn't scale and quickly exceeds the model's context limits.
Source: Retrieval augmented generation (RAG) and indexes in Microsoft Foundry (Microsoft Learn)
Want more practice on Generative AI apps and agents?
Practice the full question bank for this area, in random order, with your progress saved in your browser.
Practice Generative AI apps and agents