Microsoft certification · Exam AI-200

AI-200 Mock Exam

Developing AI Cloud Solutions on Azure

Find out if you're ready for AI-200. Take the free timed mock exam and get your score in minutes, or study the free AI-200 questions below with answers and explanations.

20 questions · 40 minutes · free, no sign-up

Free AI-200 questions

1–10 of 42 free
Question 1
You need to implement trace correlation according to the business requirements. Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. NOTE: More than one order of answer choices is correct. You will receive credit for any of the correct orders you se lect.
Show answerHide answer

Explanation

Explanation

To implement distributed trace correlation, you must first instrument the application code using the OpenTelemetry SDK. This step is essential because the SDK is responsible for generating trace context (Trace IDs and Span IDs) as requests move through your services.

Once the code is instrumented to create this telemetry, you must configure a trace exporter in the OpenTelemetry SDK. The exporter acts as the bridge, taking the generated trace data and sending it to your observability backend (such as Azure Monitor Application Insights).

Finally, you must redeploy the instrumented services. Code changes and configuration updates only take effect in the live environment after the updated application is built and deployed, allowing the services to begin emitting correlated trace data.



Why Other Options Are Incorrect

- Implement a view in the OpenTelemetry SDK: Incorrect. In OpenTelemetry, "views" are used exclusively for filtering and aggregating metrics, not for managing or correlating distributed traces.

- Call TelemetryClient.TrackEvent() within service methods: Incorrect. This uses the legacy Application Insights SDK rather than the OpenTelemetry SDK. Furthermore, TrackEvent logs custom events; it does not establish the distributed trace context required for correlation.

References

- Microsoft Learn: Instrument an application with OpenTelemetry (Covers SDK setup and exporters).
Question 2
You need to configure vector embedding updates according to the business and technical requirements. Which information should you use? To answer, select the appropriate option in the answer area. NOTE: Each correct selection is worth one point.
Show answerHide answer

Explanation



Explanation

To trigger vectorization upon document changes, you must use the Change feed processor. Azure Cosmos DB's Change Feed acts as a persistent, event-driven log of inserts and updates. The Change feed processor listens to this log in real-time. When a document is modified, the processor catches the event, allowing your application to extract the text, send it to an embedding model (like Azure OpenAI), and write the resulting vector back to the document. This ensures an efficient, event-driven architecture rather than relying on costly polling.

To scale out the processing, you must configure a Lease container. The Change feed processor uses a separate lease container to manage state and coordinate work across multiple client instances. Each instance acquires a "lease" for a specific range of partition keys. By deploying multiple application instances pointing to the same lease container, they automatically distribute the workload among themselves. If an instance fails, its lease expires, and another instance takes over, ensuring both horizontal scaling and high availability.

Why Other Options Are Incorrect

- Periodic full container scan: Highly inefficient and expensive. It consumes massive Request Units (RUs) and introduces significant latency, whereas Change Feed is incremental and real-time.

- Cross-partition SQL query: This is merely a query pattern requiring constant polling, not an event-driven mechanism, making it unsuitable for triggering real-time updates.

- Strong consistency level: This governs read/write data replication guarantees across regions, not background processing or worker scale-out.

- RU throughput on the container: While necessary for write operations, provisioning RU/s does not scale out the compute processing; the lease container manages compute distribution.

References

- Microsoft Learn: Change feed processor in Azure Cosmos DB (Details the processor and lease container architecture for scaling).
Question 3 Choose 1
You need to deploy a batch embedding workload according to the planned application architecture. What should you use?
Show answerHide answer

Correct answer: A YAML-formatted files

Explanation

Explanation

When deploying a batch embedding workload to a containerized environment (specifically Azure Kubernetes Service, as implied by the other options), you use YAML-formatted files.

YAML (YAML Ain't Markup Language) is the industry-standard declarative language for Kubernetes. To deploy a batch workload, you create a YAML manifest file (such as a Kubernetes Job or CronJob) that defines the desired state of the application—including the container image to use, the number of completions/parallelism, resource requests/limits (e.g., GPU or high-memory nodes required for embeddings), and environment variables (like API keys or endpoint URLs). You then apply this file to the cluster, allowing Kubernetes to manage the batch execution lifecycle.

Why the Other Options Are Incorrect

- B. kubectl run and create commands: While kubectl create -f file.yaml is the command used to deploy the YAML, the kubectl run command is primarily imperative and designed for creating simple, single-container Pods or Deployments. It lacks the robust configuration capabilities needed for complex batch jobs with specific restart policies, parallelism, and multi-container setups.

- C. XML-formatted files: XML is not supported by Kubernetes for manifest configuration. Kubernetes exclusively uses YAML or JSON.

- D. az aks commands: The az aks commands are used to manage the Azure Kubernetes Service cluster infrastructure itself (e.g., creating the cluster, scaling node pools, or getting credentials). They are not used to deploy individual application workloads or batch jobs onto the cluster.

References
- Microsoft Learn: Run a batch job using a Kubernetes Job (Explains how to use YAML manifests for batch workloads).
Question 4 Choose 1
You need to improve throughput for concurrent application requests to PostgreSQL. What should you implement?
Show answerHide answer

Correct answer: A Implement connection pooling.

Explanation

Explanation

When an application experiences high volumes of concurrent requests, it can overwhelm a relational database like Azure Database for PostgreSQL. Each new connection consumes significant memory and CPU overhead on the database server to establish and maintain.

Implementing connection pooling (using tools like PgBouncer, which is built into Azure Database for PostgreSQL Flexible Server) solves this by maintaining a pool of active, reusable database connections. Instead of opening and closing a connection for every application request, the application checks out an existing connection from the pool, uses it, and returns it immediately. This drastically reduces the overhead on the database, allowing it to process a much higher throughput of concurrent application requests.

Why the Other Options Are Incorrect

B. Increase shared_buffers: shared_buffers controls the amount of memory dedicated to caching data. While increasing it can improve read performance (reducing disk I/O), it does not directly address the bottleneck of establishing and managing hundreds or thousands of concurrent connections.

C. Enable read replicas: Read replicas are excellent for scaling out read-heavy workloads by offloading queries to secondary servers. However, they do not solve the connection overhead problem on the primary server for general application requests (especially write operations, which must go to the primary).

D. Increase max_connections: While this allows more concurrent connections, it is generally an anti-pattern. Setting max_connections too high requires massive amounts of RAM (as each connection consumes memory) and can lead to severe CPU context-switching overhead, which ultimately decreases throughput and can crash the database.

References
Microsoft Learn: Connection pooling in Azure Database for PostgreSQL - Flexible Server (Explains how built-in PgBouncer helps manage concurrency).
Question 5
You are developing several microservices to run on Azure Container Apps. External HTTP ingress traffic has been enabled for the Microservices.
A deployed microservice must be updated to allow users to test new features. You have the following requirements:

* Enable and maintain a single URL for the updated microservice to provide to test users.
* Update the microservice that corresponds to the current microservice version.
You need to configure Azure Container Apps.

Which features should you configure? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.
Show answerHide answer

Explanation



Explanation

- Revision Label: Azure Container Apps uses revisions to manage application deployments. To provide a single, static URL for test users to access new features, you must assign a revision label (e.g., "test") to the new revision. This creates a dedicated, stable Fully Qualified Domain Name (FQDN) that always routes traffic to that specific revision, regardless of how many times you update the container image or the revision itself.

- Revision mode: The requirement to "update the microservice that corresponds to the current microservice version" implies you are managing multiple versions. Revision mode determines how revisions are handled. By setting the revision mode to Single (as opposed to Multiple), you ensure that the application always routes 100% of traffic to the latest deployed revision, allowing you to systematically update the active version while managing test versions.

Why the Other Options Are Incorrect

- Container image: This specifies the actual code/application artifact to run. While you must update the image to deploy new features, changing the image alone does not guarantee a stable URL for testers or control how revisions are activated.

- Container registry: This is the storage location for your container images. It is an infrastructure setting and does not manage URLs or traffic routing.

- Revision label vs. Revision mode (Cross-check): You cannot use "Revision label" to activate the current version (labels are for routing specific traffic to specific URLs). You cannot use "Revision mode" to provide a single URL for testers, as the default application URL always points to the latest revision.

References
- Microsoft Learn: Revisions in Azure Container Apps
Question 6 Choose 1
A RAG application ' s retrieval step is returning documents that are topically related but not precisely relevant to the user ' s question. You need to improve retrieval precision without retraining any model. What should you do?
Show answerHide answer

Correct answer: B Enable semantic ranking (re-ranking) in Azure AI Search

Explanation

Explanation

In a Retrieval-Augmented Generation (RAG) architecture, standard vector search (or keyword search) often retrieves documents that are broadly related to the topic but may lack the precise contextual nuance required to answer the specific question.

Semantic ranking (re-ranking) in Azure AI Search solves this problem without retraining any models. It uses advanced language understanding models to re-evaluate the initial set of results (from vector or keyword search) and re-orders them based on how closely the actual meaning of the document passage matches the user's query intent. This significantly improves retrieval precision.

Why the Other Options Are Incorrect

- A. Increase the embedding model's dimensionality only: Changing embedding dimensions requires generating entirely new embeddings for the entire dataset using a different model. It does not inherently guarantee better precision for nuanced queries and violates the constraint of not retraining/changing models.

- C. Disable vector search and use only keyword search: Keyword search relies on exact lexical matching and often performs worse than vector search for semantic questions (e.g., failing to match synonyms). Disabling vector search would likely decrease overall retrieval quality.

- D. Reduce the number of indexed documents: This is a destructive approach. It arbitrarily reduces the knowledge base and risks removing the exact documents needed to answer the user's question, rather than improving the ranking of the retrieved results.

References
- Microsoft Learn: Semantic ranking in Azure AI Search (Explains how it improves precision by re-ranking results using language models).
Question 7
You have an Azure Service Bus namespace that contains a topic named Topic1.
You plan to create a subscription named Sub1 to Topic1. In Sub1, you plan to filter messages from Topic1 based on their system properties and apply an action that will annotate each filtered message.
You need to configure the filtering.
How should you configure the filtering? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.
Show answerHide answer

Explanation



Explanation

- Use the SQL type: Azure Service Bus supports three filter types: Boolean, Correlation, and SQL. Since the requirement states you need to filter based on system properties, a SQL filter is required. SQL filters allow you to write expressions (e.g., sys.Label = 'Important') that evaluate against both system properties (like sys.To, sys.CorrelationId) and custom user properties. Boolean filters only check for the existence of a specific label, and Correlation filters only match against a specific set of standard properties.

- Annotate the metadata of the original message: A Service Bus rule consists of a filter and an action. The action determines what happens to a message that meets the filter criteria. The option "Annotate the metadata of the original message" aligns with the requirement to "apply an action that will annotate each filtered message." (In Service Bus terminology, SQL filter actions can use SET to add or update user properties/metadata on the message without creating a copy).

Why the Other Options Are Incorrect

- Use the Boolean type: Boolean filters (e.g., TrueFilter or FalseFilter) simply evaluate to true or false and do not allow complex filtering based on specific system property values.

- Use the Correlation type: Correlation filters are optimized for matching a fixed set of properties (like CorrelationId or MessageId) but cannot evaluate complex expressions against arbitrary system properties.

- Copy a message and update its body: Service Bus filter actions operate on metadata/properties; they cannot modify the payload (body) of the message.

- Copy a message and annotate its metadata: Filter actions modify the message in-place as it is routed to the subscription; they do not create copies.

References
- Microsoft Learn: Topic filters and actions in Azure Service Bus
Question 8 Choose 1
You store embeddings in a property named embedding in an Azure Cosmos DB for NoSQL container.
You must construct a vector similarity query that orders documents by similarity to the input embedding and returns only the top five results. You need to construct the similarity query. What should you do?
Show answerHide answer

Correct answer: B Limit the number of results.

Explanation

Explanation

In Azure Cosmos DB for NoSQL, when executing a vector similarity search (using the VectorDistance function), the database calculates the distance between the input vector and the stored vectors, then sorts the results by that distance (using ORDER BY).

To satisfy the requirement of returning only the top five results, you must use the TOP clause in your SQL query (or use the limit parameter in the SDK/query definition). For example:
SELECT TOP 5 * FROM c ORDER BY VectorDistance(c.embedding, @inputVector)

Why the Other Options Are Incorrect

- A. Group by embedding value: GROUP BY is used to aggregate data (like calculating sums or averages). It does not sort results by vector similarity nor restrict the output to a specific number.

- C. Select distinct embedding: DISTINCT is used to remove duplicate values from the result set. It does not sort by similarity or limit the number of rows returned.

- D. Use offset pagination: Offset pagination (OFFSET n LIMIT m) is used to skip a specific number of rows and then return the next set. While you could technically use OFFSET 0 LIMIT 5, TOP 5 is the direct, correct, and most efficient way to specify "return only the top N results" in Cosmos DB without unnecessary pagination overhead.

References
- Microsoft Learn: Vector similarity search in Azure Cosmos DB for NoSQL (Details using VectorDistance with TOP N for top-k results).
Question 9 Choose 2
You are creating a hazard notification system that has a single signaling server which triggers audio and visual alarms to start and stop. You implement Azure Service Bus to publish alarms, each alarm controller uses Azure Service Bus to receive alarm signals as part of a transaction Alarm events must be recorded for audit purposes Each transaction record must include information about the alarm type that was activated. You need to implement a reply-trail auditing solution Which two actions should you perform? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
Show answerHide answer

Correct answer: A, F Assign the value of the hazard message SessionId property to the ReplyToSessionld property. Assign the value of the hazard message MessageId property to the CorrelationId property

Explanation

Explanation

To implement a reply-trail auditing solution in Azure Service Bus, you must link the initial request (the hazard alarm) to the subsequent audit record. The standard messaging pattern for this uses two specific properties:

- 1. MessageId to CorrelationId (Option F): When the signaling server publishes the hazard alarm, it populates the MessageId. When the alarm controller processes the message and creates the audit record, it must copy that original MessageId into the CorrelationId of the new audit message. This is the fundamental way Service Bus allows you to correlate a reply or follow-up message back to the original request for auditing purposes.

- 2. SessionId to ReplyToSessionId (Option A): Because alarm events are transactional and must be processed in order for a specific alarm, Sessions are likely being used. If the original hazard message uses a SessionId, the reply/audit message must route its response to the correct session. By setting the ReplyToSessionId on the original message, the receiving controller knows exactly which session to send the audit record back to, ensuring the audit trail is grouped correctly.

Why the Other Options Are Incorrect

- B, C, D, E (Manipulating SequenceNumber or DeliveryCount): Properties like SequenceNumber and DeliveryCount are read-only, system-generated properties. You cannot manually assign application-level values (like a MessageId or SessionId) to them.

- SequenceNumber: Assigned by Service Bus to uniquely order messages.
- DeliveryCount: Incremented by Service Bus every time a message is delivered to a receiver.

References
- Microsoft Learn: Message correlation in Azure Service Bus (Explains using CorrelationId to tie replies to requests).
Question 10 Choose 2
An ACA app processes messages from an Azure Storage queue.
The app must scale automatically based on messages in a specific Azure Storage queue by using a Kubernetes Event-driven Autoscaler (KEDA) custom scale rule. You need to configure the required scale rule values.
Which two values should you configure? Each correct answer presents part of the solution. Choose two.
NOTE: Each correct selection is worth one point.
Show answerHide answer

Correct answer: B, D Trigger type Queue name

Explanation

Explanation

To configure a KEDA (Kubernetes Event-driven Autoscaler) custom scale rule in Azure Container Apps to scale based on an Azure Storage queue, you must define the specific scaler and the target it should monitor.

- Trigger type (B): You must specify the type of scaler KEDA should use. In this case, the trigger type would be `azure-queue` (or `azure-storage-queue` depending on the specific KEDA metadata implementation). This tells the autoscaler what kind of external system it is monitoring.

- Queue name (D): Because the requirement specifies scaling based on messages in a specific Azure Storage queue, you must provide the queue's name in the scaler metadata so KEDA knows exactly which queue's length to evaluate.

Why the Other Options Are Incorrect

- A. Polling interval: While you can configure how often KEDA checks the queue, this is an optional tuning parameter, not a required definition of the scale rule itself.

- C. Maximum replicas: Maximum replicas is a core scaling boundary configured at the application level (or scale definition), but it is not part of the specific custom scale rule (which defines what to monitor). The question specifically asks for values to configure the custom scale rule.

References
- Microsoft Learn: Set scaling rules in Azure Container Apps (Details how `rules` require a `type` and `metadata` like `queueName`).
Full mock exam

Sit the AI-200 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real AI-200 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full AI-200 mock exam
  • 60questions per mock
  • 120 mintime limit
  • 142questions in the bank
  • Newmock on every attempt