Courseiva

Microsoft Azure AI Engineer Associate AI-102 (AI-102) — Questions 751–761

761 questions total · 11pages · All types, answers revealed

Page 10

Page 11 of 11

751
MCQhard

You are designing a generative AI solution that uses Azure OpenAI Service. The solution must generate code snippets in Python and JavaScript. You need to ensure the model reliably outputs code in the correct language based on user input. Which approach should you use?

A.Set the top_p parameter to a low value.
B.Use a system message to specify the desired language.
C.Fine-tune the model on a dataset of code in both languages.
D.Set the temperature to 0 to make the model deterministic.
AnswerB

A system message sets persistent behavioural instructions applied to every turn, so it constrains the model to emit Python or JavaScript according to the user's request. This satisfies the reliability requirement better than per-prompt phrasing, which the model may inconsistently honour across requests.

Why this answer

System messages in Azure OpenAI Service allow you to set the context or behavior of the model, such as specifying the desired programming language for code generation. This approach is lightweight, requires no retraining, and reliably guides the model to output code in the correct language based on the user's request, leveraging the model's existing training on both Python and JavaScript.

Exam trap

The trap here is that candidates often confuse hyperparameters like temperature and top_p with content control mechanisms, mistakenly believing they can enforce output language, when in fact they only affect randomness and token selection probability.

How to eliminate wrong answers

Option A is wrong because setting top_p to a low value reduces the pool of tokens considered for sampling, which can make outputs more focused but does not control the language of the generated code; it is a nucleus sampling parameter, not a language selector. Option C is wrong because fine-tuning the model on a dataset of code in both languages is overkill for this requirement, as the base model already understands both languages; fine-tuning is typically used for specialized tasks or to adapt to a specific domain, not for simple language switching. Option D is wrong because setting temperature to 0 makes the model deterministic by always choosing the most likely token, but it does not enforce the output language; it can still produce code in the wrong language if the prompt is ambiguous, and it reduces creativity but does not guarantee language adherence.

752
Multi-Selecthard

You are building a generative AI assistant on Azure OpenAI Service that must invoke backend business functions, such as checking order status and issuing refunds, in response to natural-language requests. You want the model to decide when a function is needed and to supply structured arguments, while your application retains control over execution. Which two actions should you take? (Choose two.)

Select 2 answers
A.Define the available functions and their parameters in the tools parameter of the chat completions request.
B.Execute the returned function call in your application, then send the function result back to the model in a subsequent request so it can compose the final answer.
C.Fine-tune the base model on historical order and refund conversations so it learns to call the correct endpoints.
D.Grant the Azure OpenAI resource a managed identity with permission to call the backend APIs directly on behalf of the model.
E.Set the temperature parameter to 0 and increase the max_tokens value to guarantee deterministic function selection.
AnswersA, B

Supplying function definitions through the tools parameter is how you tell the model which operations exist and what arguments each expects. The model then returns a structured tool call naming the function and a JSON argument payload when it judges a function is needed, rather than fabricating an answer. This is the mechanism that lets the model choose actions based on the conversation while your code decides whether and how to run them.

Why this answer

Function calling works in two phases: you declare callable operations and their parameter schemas in the request, and the model returns a structured call when a function is appropriate. Your application then executes that function and returns the output so the model can finish the response. Both declaring the tools and executing plus returning results are required for a working implementation.

Exam trap

The trap here is believing the model itself executes backend functions or that fine-tuning teaches it to call endpoints, when in reality the model only proposes calls that your application must run and report back.

753
Multi-Selectmedium

Which TWO Azure AI services can be used to extract text from images and PDFs? (Select two.)

Select 2 answers
A.Azure AI Translator
B.Azure AI Search
C.Azure AI Vision OCR
D.Azure AI Document Intelligence
E.Azure AI Language
AnswersC, D

Azure AI Vision's Read OCR engine extracts printed and handwritten text from images and scanned documents. It returns lines and words with bounding boxes, making it suitable for pulling text out of photographs and image-only PDFs where no embedded text layer exists.

Why this answer

Azure AI Vision OCR (option C) is correct because its Read/OCR capability extracts printed and handwritten text directly from images and scanned documents. Azure AI Document Intelligence (option D) is correct because it uses prebuilt and custom models to extract text, key-value pairs, and tables from PDFs, images, and forms. Azure AI Translator (A) performs text translation, not optical character recognition, so it cannot extract text from images or PDFs.

Azure AI Search (B) is a search indexing service that can consume extracted text but does not itself perform OCR on images or PDFs. Azure AI Language (E) provides NLP features such as sentiment analysis and entity recognition on existing text, not text extraction from images or PDFs.

Exam trap

The trap here is that candidates may confuse Azure AI Language's text analysis capabilities with OCR, or assume Azure AI Search can extract text directly, when in fact it only indexes pre-extracted data.

754
MCQeasy

A company is deploying an Azure AI solution that uses Azure Cognitive Services. The solution must comply with data residency requirements that mandate all customer data be stored within a specific geographic region. Which action should the company take when creating the Cognitive Services resource?

A.Apply a resource tag that specifies the region.
B.Configure the endpoint URL to point to a regional endpoint.
C.Set the SKU to a tier that supports regional restrictions.
D.Select the appropriate region during resource creation.
AnswerD

Selecting the appropriate region during resource creation pins the Cognitive Services resource to that geography, ensuring stored customer data remains within the mandated boundary. Data residency is enforced at the resource level, so the region chosen at deployment determines where data is processed and stored. Other settings do not relocate data after provisioning.

Why this answer

Data residency requirements are satisfied by physically storing customer data within a specific geographic boundary. When creating an Azure Cognitive Services resource, selecting the appropriate region (e.g., 'West Europe' or 'East US') during the provisioning process ensures that all data processed and stored by that service instance remains within that Azure datacenter region. This is the fundamental and only guaranteed method to enforce data residency at the resource level.

Exam trap

The trap here is that candidates confuse network-level controls (like endpoint configuration or tagging) with physical data storage guarantees, mistakenly believing that a regional endpoint or a tag can enforce data residency when only the initial region selection during resource creation can do so.

How to eliminate wrong answers

Option A is wrong because resource tags are metadata labels used for organization, cost tracking, or policy enforcement; they do not influence where the underlying service stores data. Option B is wrong because the endpoint URL is automatically generated based on the chosen region and cannot be manually configured to redirect storage; it only determines the network access point, not the physical data location. Option C is wrong because the SKU tier (e.g., S0, F0) determines throughput limits and feature availability, not geographic restrictions; no SKU tier enforces regional data storage.

755
MCQmedium

You are creating an Azure AI Search indexer that processes documents from Azure Blob Storage. The documents include PDFs and images. You need to extract both text and image content, and then use the image content to generate captions via the Image Analysis skill. Which indexer configuration is required to enable image extraction and passing images to the skillset?

A.Set the parsingMode to json.
B.Set the allowSkillsetToReadFileData parameter to true.
C.Set the parsingMode to delimitedText and specify a delimiter.
D.Set the imageAction to generateNormalizedImages in the indexer's parameters.
AnswerD

The imageAction parameter in the indexer configuration controls image extraction. Setting it to generateNormalizedImages extracts images from documents and normalizes them, making them available in the enriched document for skills like Image Analysis. This is the correct configuration to enable image content to be passed to the skillset for caption generation.

Why this answer

To extract images from documents and make them available for enrichment, you must set the imageAction parameter to generateNormalizedImages in the indexer definition. This extracts images and places them in the enriched document under /document/normalized_images/*. The Image Analysis skill can then use those images as input to generate captions.

Other parsing modes or parameters do not enable image extraction for skills.

Exam trap

The trap here is confusing parameters that allow access to file data with those that actually extract and normalize images for skills.

756
MCQmedium

You have an Azure AI solution that uses Azure AI Language to perform sentiment analysis. The solution is experiencing high latency. Which action should you take to reduce latency?

A.Move the service to a different Azure region.
B.Use the Free tier of the Azure AI Language service.
C.Increase the request timeout value.
D.Scale the service by increasing the number of instances or using a higher pricing tier.
AnswerD

Latency from throttling or insufficient throughput is resolved by scaling out instances or moving to a higher tier, increasing provisioned transactions per second. This directly addresses the capacity constraint causing the high latency in Azure AI Language sentiment analysis.

Why this answer

Scaling the Azure AI Language service by increasing the number of instances or moving to a higher pricing tier (e.g., from Standard S0 to a tier with higher throughput) directly addresses high latency by providing more capacity to handle concurrent requests. High latency often results from hitting the service's rate limits or throughput constraints, and scaling alleviates this bottleneck without changing the underlying architecture.

Exam trap

The trap here is that candidates often confuse network latency (solved by region proximity) with service throughput latency (solved by scaling), leading them to incorrectly choose Option A when the real bottleneck is capacity, not geography.

How to eliminate wrong answers

Option A is wrong because moving the service to a different Azure region primarily reduces network latency due to geographic proximity, but it does not resolve high latency caused by insufficient service capacity or throttling; the core issue is throughput, not distance. Option B is wrong because the Free tier has strict rate limits (e.g., 5,000 transactions per month) and lower throughput, which would likely worsen latency under load rather than reduce it. Option C is wrong because increasing the request timeout value does not reduce latency; it only allows the client to wait longer for a response, masking the symptom without addressing the underlying performance issue.

757
MCQeasy

A retail company wants to build a knowledge mining solution that indexes product descriptions stored in an Azure SQL Database and makes them searchable through a web application. The descriptions are already plain text. You need to configure Azure AI Search to pull the data into an index with the least effort. What should you create first?

A.A cognitive skillset that applies OCR to each product description.
B.A custom skill that queries the SQL database and writes documents to the index.
C.An indexer with a data source connection to Azure SQL Database.
D.An Azure AI Document Intelligence model trained on the product descriptions.
AnswerC

An indexer connects to a supported data source, reads documents, and populates an index. Creating the data source connection to Azure SQL Database and an indexer that targets the index is the standard low-effort way to ingest plain text records. No enrichment skills are needed because the content is already machine-readable.

Why this answer

Azure AI Search integrates directly with Azure SQL Database through indexers and data source connections. When the source content is already plain text, the indexer can read rows and populate the index without any enrichment skills. This is the least-effort approach and avoids custom code or document extraction models.

Exam trap

The trap here is reaching for enrichment skills or document intelligence when the source data is already structured text that a built-in indexer can ingest directly.

758
MCQmedium

A support organization uses Azure AI Language custom named entity recognition (custom NER) to extract product codes from warranty emails. The model performs well in production, but a new product line introduced codes formatted as two letters, a hyphen, and six digits, and the model misses them. You need the model to recognize the new format while keeping existing extraction quality. What should you do?

A.Increase the model's temperature setting so it generalizes to unseen code formats.
B.Create a new custom NER project dedicated to the new product line and route emails to it based on keyword rules.
C.Add labeled utterances containing the new code format to the existing project, retrain, and review the evaluation metrics before redeploying.
D.Add the new product codes to a phrase list attached to the entity and redeploy the existing model.
AnswerC

Custom NER learns entity boundaries from labeled examples, so adding utterances that contain the new two-letter, hyphen, six-digit pattern teaches the model the new shape while the existing labeled data preserves prior behavior. Retraining and reviewing evaluation metrics confirms that recall on the new format improved without regressing the original product codes before you redeploy.

Why this answer

The reliable way to extend a custom NER model to a new entity shape is to label representative utterances that contain that shape and retrain, then verify with evaluation metrics. This preserves the learned behavior on existing codes because the original labeled data remains in the project, while the new examples supply the boundary evidence the model needs for the two-letter, hyphen, six-digit pattern.

Exam trap

The trap here is reaching for a runtime hint such as a phrase list or a sampling parameter instead of adding labeled training data for the new entity format.

759
MCQmedium

You are building a generative AI assistant that must summarize long technical manuals stored in Azure Blob Storage. The manuals are often 300 pages, and the model must produce a concise summary with references to page numbers. Which approach should you use?

A.Use Azure AI Document Intelligence to extract text, then send each page as a separate request to Azure OpenAI and concatenate the summaries.
B.Use Azure OpenAI fine-tuning to train a custom model on the manuals, then ask the model to summarize any manual.
C.Use Azure OpenAI GPT-4o with a single prompt containing the entire manual text.
D.Use Azure AI Search to index the manuals with page metadata, then use a retrieval-augmented generation (RAG) pattern with Azure OpenAI to generate summaries and citations.
AnswerD

Indexing the manuals in Azure AI Search with page-level metadata enables retrieval of relevant chunks and supports citation of page numbers. The RAG pattern lets Azure OpenAI generate a summary grounded in retrieved content, avoiding context-window limits. This is the recommended approach for long documents requiring references.

Why this answer

Long documents exceed model context windows, so retrieval-augmented generation is needed. Azure AI Search indexes content with metadata, allowing Azure OpenAI to generate grounded summaries and cite page numbers. This combination handles length, improves accuracy, and provides traceability, which is essential for technical manuals.

Exam trap

The trap here is assuming that a large-context model can ingest an entire long manual in one prompt, ignoring token limits and the need for verifiable page citations.

760
MCQeasy

You need to analyze the sentiment of social media posts in real time using Azure AI Language. Which approach should you use?

A.Call the sentiment analysis REST API for each post
B.Use Azure AI Search with cognitive skills
C.Use the batch processing feature in Azure AI Language
D.Send posts to an Event Hub and use Stream Analytics
AnswerA

The sentiment analysis REST API processes each post synchronously, returning polarity scores immediately, which satisfies the real-time constraint. Batch or asynchronous pipelines would introduce latency, so per-post API calls are the appropriate mechanism for streaming social media sentiment.

Why this answer

The sentiment analysis REST API in Azure AI Language is designed for real-time, per-document analysis. By calling the API for each social media post as it arrives, you achieve the lowest latency and can process posts individually without batching or streaming overhead, which is essential for real-time sentiment analysis.

Exam trap

The trap here is that candidates often confuse real-time processing with streaming architectures (like Event Hubs and Stream Analytics) or batch processing, but the simplest and most direct real-time approach for per-document sentiment analysis is the REST API.

How to eliminate wrong answers

Option B is wrong because Azure AI Search with cognitive skills is designed for indexing and enriching documents at rest, not for real-time processing of individual streaming posts. Option C is wrong because the batch processing feature in Azure AI Language is intended for asynchronous, high-throughput processing of large volumes of documents, not for real-time, per-post analysis. Option D is wrong because sending posts to an Event Hub and using Stream Analytics is a streaming architecture that adds unnecessary complexity and latency for simple per-post sentiment analysis; the REST API is more direct and efficient for real-time needs.

761
MCQhard

You are developing a solution that uses Azure AI Language to perform sentiment analysis on multilingual product reviews. The reviews are in English, German, and Japanese. You need to ensure that the sentiment score is accurate for each language. What should you do?

A.Specify the correct language code for each review in the request, such as 'en', 'de', or 'ja'.
B.Translate all reviews to English using Azure AI Translator, then perform sentiment analysis with language set to 'en'.
C.Set the language parameter to 'en' for all requests to force English sentiment analysis.
D.Omit the language parameter and let the service auto-detect the language for each review.
AnswerA

Azure AI Language sentiment analysis supports multiple languages, and providing the correct language code ensures the appropriate model is used. This yields the most accurate sentiment scores. Since the languages are known, explicitly setting the code avoids detection errors and improves reliability for English, German, and Japanese reviews.

Why this answer

Azure AI Language sentiment analysis supports multiple languages, and specifying the correct language code for each review ensures the model uses the appropriate linguistic rules. This yields the most accurate sentiment scores. Auto-detection or forcing a single language can lead to misinterpretation, while translation adds unnecessary complexity and potential loss of sentiment nuance.

Exam trap

The trap here is thinking that translating to English or forcing a single language is needed for multilingual sentiment, when Azure AI Language natively supports multiple languages with explicit language codes.

Page 10

Page 11 of 11

All pages