30 free Microsoft AI-200 practice questions from the CertStash pack of 174, each with the correct answer and a full explanation. The rule is the same for every exam: ten free on the product page, 30 free here, all 174 in the pack, and each step includes the one before it.
Get all 174 questions (US$39) · Download the first 10 as a PDF
Question 1
You maintain multiple versions of a container image in Azure Container Registry.
The production deployment must always run the exact same image build even if tags are changed later.
You need to ensure predictable and immutable image selection during deployment.
What should you do?
Show answer and explanation
Correct answer: D. Identify the image by using its SHA digest.
An image digest is a SHA-256 hash of the image manifest, so it identifies exactly one build and can never point at different content. Deploying by digest (for example myregistry.azurecr.io/app@sha256:...) guarantees that every deployment pulls the same bytes, even if tags are later moved or overwritten. Tags are mutable pointers, so they cannot give the predictable, immutable selection the production deployment needs.
Why the other options are wrong
- A. A production tag is mutable and can be reassigned to a different build at any time.
- B. Nightly rebuilds produce new images and make the deployed build less predictable, not more.
- C. The latest tag moves with every push, so it never guarantees the same build.
Question 2
A container in an AKS cluster repeatedly restarts.
Pod events show probe failures, although node-level CPU and memory metrics are normal.
You need to diagnose the cause of the repeating restarts.
What should you do first?
Show answer and explanation
Correct answer: D. Inspect the pod events and container logs.
When a container restarts repeatedly and pod events report probe failures while node CPU and memory are healthy, the cause lies in the pod or the application, not the node. Inspecting the pod events (kubectl describe pod) and the container logs shows which probe fails, how it fails, and what the application was doing at the time. Diagnosis comes before any configuration change, so this is the first step.
Why the other options are wrong
- A. Adding replicas multiplies the failing pods and does not reveal why the probes fail.
- B. Reducing initialDelaySeconds makes the probe fire earlier and is likely to worsen the failures, and it is a change made before the cause is known.
- C. Node metrics are normal, so draining and rebooting the node targets a problem that does not exist.
Question 3
You develop a message-processing service deployed to Azure Container Apps. The service reads messages from an Azure Service Bus queue.
The solution must minimize costs by ensuring NO compute resources are consumed when the queue is empty.
You need to configure scaling for the service.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: B, C. Configure the scaling rule to allow for the termination of all active replicas; Configure a Kubernetes Event-driven Autoscaler rule that monitors queue length.
A KEDA scale rule of type azure-servicebus that monitors the queue length lets Azure Container Apps add replicas in proportion to the number of pending messages. To consume no compute when the queue is empty, the rule must also be allowed to remove every replica, which means setting the minimum replica count to zero. Together, the queue-length rule and scale to zero give event-driven scaling at no idle cost.
Why the other options are wrong
- A. Raising the maximum replica count only caps how far the app scales out and does nothing to reduce idle cost.
- D. HTTP concurrency scaling reacts to web requests, not to Service Bus queue depth.
Question 4
You configure ACR Tasks to automate image builds.
Container images must rebuild when:
Application updates occur.
Base image updates occur, such as when the underlying OS image is updated.
Regular scheduled rebuilds are required.
You need to configure ACR Tasks to support automated image rebuilds.
Which three triggers should you configure? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: A, B, D. Timer trigger; Source code commit trigger; Base image update trigger
ACR Tasks supports several automatic triggers. A source code commit trigger rebuilds the image when application code changes in the Git repository. A base image update trigger rebuilds dependent images when the base image they are built from, such as an OS or runtime image, is updated. A timer trigger runs the task on a cron schedule, which covers the regular scheduled rebuilds.
Why the other options are wrong
- C. Registry events such as image push are not an ACR Tasks build trigger that satisfies these three requirements.
- E. A webhook notification reports registry events to other systems and does not start an ACR Tasks rebuild.
Question 5
You plan to deploy an Azure Container app.
You need to configure the container app to support session affinity.
Which ingress type and revision mode should you assign to the container app?
Show answer and explanation
Correct answer: D. HTTP ingress type and single revision mode
Session affinity in Azure Container Apps routes every request from a client to the same replica, and the platform enforces this stickiness with HTTP cookies. Because cookies exist only at the HTTP layer, the feature requires the HTTP ingress type. Azure Container Apps also supports session affinity only when the app runs in single revision mode, where all traffic goes to one active revision and there is no weighted split that could send a client to a different revision. Configuring HTTP ingress together with single revision mode is therefore the only combination that allows sticky sessions to be enabled.
Why the other options are wrong
- A. TCP ingress cannot set or read HTTP cookies, so sticky sessions are not available.
- B. TCP ingress does not support session affinity, and session affinity is also unsupported in multiple revision mode.
- C. Session affinity is supported only in single revision mode, not in multiple revision mode.
Question 6
You deploy a new revision of an app in Azure Container Apps.
You need to gradually shift production traffic to the revision while monitoring performance. In addition, you need to be able to quickly roll back.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: C, E. Enable multiple revision mode; Use traffic splitting.
Multiple revision mode keeps the current revision and the new revision active at the same time, which is a prerequisite for sending traffic to both. Traffic splitting then assigns percentage weights to each active revision, so production traffic can move to the new revision in small increments while performance is monitored. Rolling back is quick because the previous revision is still running: resetting its weight to 100 percent immediately returns all traffic to it without redeploying anything.
Why the other options are wrong
- A. Single revision mode deactivates the old revision automatically, so traffic cannot be shared or quickly shifted back.
- B. Restarting a revision only recycles its replicas and does not control how traffic is distributed.
- D. Increasing the replica count adds capacity to a revision but does not shift traffic between revisions.
Question 7
You have container source code stored in a Git repository.
The container registry must automatically build and store a new container image whenever a developer commits code to the Git repository.
You must minimize the use of an external build infrastructure.
You need to configure Azure Container Registry (ACR) to manage the build process natively and automatically.
Which two ACR components should you use? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: A, D. Webhook; Source-triggered task
A source-triggered task in ACR Tasks defines a build that runs in Azure whenever code is committed to the configured Git repository in GitHub or Azure DevOps, so no external build agents are required and the built image is pushed to the registry automatically. When the task is created with a commit trigger, ACR Tasks creates a webhook in the repository by using the supplied personal access token. That webhook notifies ACR Tasks of each commit, which is what starts the build. Together, the webhook and the source-triggered task deliver native, automatic builds on every commit.
Why the other options are wrong
- B. A quick task runs a single on-demand build, such as az acr build, and is not started automatically by commits.
- C. An artifact cache rule caches images pulled from upstream registries and does not build images.
Question 8
You deploy multiple instances of a change feed processor to handle a high ingestion rate within Azure Cosmos DB for NoSQL.
Each processor instance must process a different subset of partitions.
You need to ensure the workload is load-balanced across all processor instances.
What should you configure?
Show answer and explanation
Correct answer: C. lease container
The change feed processor stores its state and coordinates its instances through the lease container. Each lease represents a partition or range of the monitored container, and instances claim leases so that every instance processes a different subset of partitions. When instances are added or removed, leases are redistributed, which load-balances the workload automatically.
Why the other options are wrong
- A. Indexing precision affects how items are indexed for queries and has no bearing on change feed distribution.
- B. Strong consistency controls read guarantees and does not assign partitions to processors.
- D. Autoscale throughput adjusts request units and does not coordinate processor instances.
Question 9
An application performs similarity search across 5 million embeddings stored in Azure Database for PostgreSQL with pgvector. Queries often filter by department before ranking by cosine distance.
P95 latency for vector similarity queries exceeds the SLA target. Monitoring shows sustained high CPU use during query execution.
You need to reduce P95 latency for filtered vector similarity queries.
What should you do?
Show answer and explanation
Correct answer: A. Create B-tree indexes on frequently filtered metadata columns.
When queries filter by department before ranking by cosine distance, scanning all five million rows is the main cost and drives CPU use. B-tree indexes on the frequently filtered metadata columns let PostgreSQL find only the matching rows quickly, so far fewer vectors need distance calculations. That reduces CPU time and lowers P95 latency.
Why the other options are wrong
- B. Storing embeddings as JSON removes the vector type and makes distance calculations slower.
- C. A higher dimensionality increases the cost of every distance calculation and worsens latency.
- D. A longer statement timeout only lets slow queries run longer and does not make them faster.
Question 10
You store embeddings in a property named embedding in an Azure Cosmos DB for NoSQL container.
You must retrieve the five most similar documents to an input embedding.
You need to construct the similarity query.
What should you do?
Show answer and explanation
Correct answer: D. Limit the number of results.
A vector similarity query in Azure Cosmos DB for NoSQL orders items by VectorDistance on the embedding property and uses TOP N to return only the closest items. Limiting the result count to five returns the five most similar documents and keeps request unit consumption low, since the query does not need to return the whole ranked set.
Why the other options are wrong
- A. Offset pagination skips items and returns pages, which does not by itself return the five nearest.
- B. Strong consistency is a read guarantee and does not influence how many similar results are returned.
- C. Grouping by embedding value aggregates identical vectors and does not rank by similarity.
Question 11
You are developing a .Net web application that stores data in Azure Cosmos DB. The application must use the Azure Cosmos DB for NoSQL API and allow millions of reads and writes. The Azure Cosmos DB account has been created with multiple write regions enabled. The application has been deployed to the East US2 and Central US regions.
You need to update the application to support multi-region writes.
What are two possible ways to achieve this goal? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: B, E. Update the ConnectionPolicy class for the Azure Cosmos DB client and populate the PreferredLocations property based on the geoproximity of the application; Update the ConnectionPolicy class for the Azure Cosmos DB client and set the UseMultipleWriteLocations property to true.
For a .NET application to use multi-region writes, the Azure Cosmos DB client must be told both that it may write to multiple regions and which regions it should prefer. Setting UseMultipleWriteLocations to true on the ConnectionPolicy enables the SDK to send writes to any write region instead of only the primary one. Populating PreferredLocations based on geoproximity makes each deployment (East US2 and Central US) route its reads and writes to the closest region, which keeps latency low and lets the SDK fail over in order if that region becomes unavailable.
Why the other options are wrong
- A. Strong consistency is not supported with multiple write regions, and indexing a region property does not change how the client routes writes.
- C. A custom conflict resolution policy governs how conflicting writes are merged, but it does not make the client send writes to multiple regions.
- D. Passing session tokens through cookies maintains session consistency across nodes and does not enable the client to write to multiple regions.
Question 12
A large retail company operates online and physical stores. The company tracks inventory levels in real time to manage stock efficiently across all locations. You develop an Azure Event Grid solution to handle events generated by the inventory management system deployed to Azure.
You need to implement a subscription filter that dynamically adjusts to seasonal changes in product demand.
Which event filter should you use?
Show answer and explanation
Correct answer: A. An advanced filter using a Boolean condition that evaluates multiple data fields, including a season field within the event data
Advanced filters in an Event Grid subscription evaluate values in the event data using operators and can be combined across multiple fields. A condition that evaluates several data fields, including a season field in the event, can be adjusted to follow seasonal demand without changing event schemas or subjects. That makes it the flexible choice for a dynamically changing filter.
Why the other options are wrong
- B. A filter on the event type field is a fixed list of type names, so it cannot follow a season value that is carried in the event data.
- C. Event Grid subscriptions do not filter on labels of the kind described.
- D. A static subject filter is fixed and does not adjust to seasonal changes.
Question 13
You are developing an AI search API that caches semantic search results in Redis.
Search results must remain cached for 10 minutes. If the underlying data changes, cached entries must NOT be returned.
You need to implement a cache-aside strategy to ensure data consistency.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: B, D. Delete related cache keys when the source data changes; Configure a 10-minute Time to Live on each key.
In a cache-aside design, a 10-minute Time to Live on every key makes results expire automatically after the required period. To make sure stale entries are never returned when the underlying data changes, the application also deletes the related cache keys at the moment the source data is updated, which forces the next request to reload fresh results. The two actions together satisfy both the expiry and the consistency requirement.
Why the other options are wrong
- A. Key space notifications only report events and do not remove stale entries by themselves.
- C. Sliding expiration extends the life of a key on every access, so results could remain cached longer than 10 minutes.
Question 14
You are developing an Azure Function that calls external APIs by providing an access token for the API. The access token is stored in a secret named token in an Azure Key Vault named mykeyvault.
You need to ensure the Azure Function can access the token.
Which value should you store in the Azure Functions app configuration?
Show answer and explanation
Correct answer: C. @Microsoft.KeyVault(SecretUri=https://mykeyvault.vault.azure.net/secrets/token/)
Azure Functions resolves Key Vault secrets through a Key Vault reference stored as the value of an application setting. The reference uses the form @Microsoft.KeyVault(SecretUri=...) with the full URI of the secret, here the token secret in mykeyvault. At runtime the platform retrieves the secret by using the managed identity of the app, so the secret value is never stored in the configuration.
Why the other options are wrong
- A. This is not a valid Key Vault reference syntax and the platform cannot resolve it.
- B. This is not a valid Key Vault reference syntax and the platform cannot resolve it.
- D. The AZUREKVCONNSTR_ prefix is not a mechanism for resolving Key Vault secrets in app settings.
Question 15
You are designing an Azure Function that will process orders from a new Azure Service Bus queue.
You need to prevent the system from processing messages more than once and preserve failed messages for investigation.
Which two actions should you implement? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: A, C. Include a dead-letter handling process; Enable duplicate detection on the queue.
Duplicate detection on the queue discards messages that carry a message ID already seen within the detection window, which prevents the same order from being processed more than once. A dead-letter handling process keeps messages that repeatedly fail, or that cannot be processed, in the dead-letter queue so they are preserved for investigation instead of being lost. The two actions together cover both goals.
Why the other options are wrong
- B. An HTTP trigger does not read from the Service Bus queue, and it provides neither duplicate protection nor failed message storage.
- D. Sessions provide ordered, grouped processing and do not prevent duplicates or preserve failed messages.
Question 16
You are designing an Azure Function app that exposes a public API.
The solution must:
Validate incoming request data and return results immediately to the caller.
Support Microsoft Entra ID authentication.
Guarantee idempotent processing when the same request is retried.
Scale automatically under variable load.
Avoid duplicate processing.
You need to implement a trigger.
Which trigger should you implement?
Show answer and explanation
Correct answer: B. HTTP
An HTTP trigger exposes a public endpoint that can validate the incoming request and return the result to the caller immediately. It supports Microsoft Entra ID authentication through App Service authentication, scales automatically with load, and lets the function make retried requests idempotent by using a client-supplied key. The other triggers are asynchronous and cannot return a result directly to the caller.
Why the other options are wrong
- A. A Service Bus topic trigger processes messages asynchronously and cannot respond immediately to a caller.
- C. An Event Grid trigger handles event notifications and does not provide a synchronous response to a client.
- D. A queue storage trigger is asynchronous and does not return results immediately to the caller.
Question 17
An organization deploys Azure Cosmos DB.
You need to ensure that the index is updated as items are created, updated, or deleted.
What should you do?
Show answer and explanation
Correct answer: D. Set the indexing mode to Consistent.
Azure Cosmos DB supports two indexing modes: Consistent and None. In Consistent mode, the index is updated synchronously as items are created, updated, or deleted, so queries see index results that match the consistency level configured for the account. None disables indexing for the container, which is useful only for pure key-value workloads or bulk loads. Setting the indexing mode to Consistent therefore guarantees that the index tracks every write as it happens.
Why the other options are wrong
- A. Lazy mode updates the index asynchronously in the background, so the index can lag behind writes and the mode is not available for new containers.
- B. EnableScanInQuery allows queries to scan when no index is available; it does not control when the index is updated.
- C. Setting automatic to False stops items from being indexed automatically, which is the opposite of keeping the index current.
Question 18
You are implementing the expiration requirement for AI-generated summaries in the Redis cache.
You need to purge the AI summaries five minutes after creation, regardless of how often they are accessed.
What should you do?
Show answer and explanation
Correct answer: B. Configure absolute expiration on each cache key.
Absolute expiration sets a fixed time to live when the key is written, for example EXPIRE key 300 or SET with EX 300, and Redis removes the key when that time elapses no matter how many times it is read. Reading a key does not reset its TTL in Redis, so each AI summary is purged exactly five minutes after creation, which is the stated requirement.
Why the other options are wrong
- A. The allkeys-lru policy evicts keys only under memory pressure and does not guarantee removal after five minutes.
- C. PERSIST removes the TTL from a key, so the summaries would never expire.
- D. Sliding expiration extends the lifetime on every access, so frequently read summaries would outlive five minutes.
Question 19
You process Azure Service Bus messages that require a dependent external API call.
If the API is temporarily unavailable, you must delay processing of the message without incrementing the delivery count.
You need to find a way to process the message when the API is available while keeping the message accessible.
Which message action should you perform?
Show answer and explanation
Correct answer: B. Defer
Deferring a message keeps it in the queue or subscription but takes it out of the normal receive flow. The delivery count is not incremented, and the message stays accessible because the receiver records its SequenceNumber and later retrieves it explicitly with that number once the external API is available again. This gives the worker control over when the message is processed without losing it or consuming delivery attempts.
Why the other options are wrong
- A. Dead-lettering moves the message to the dead-letter queue and stops normal processing of it.
- C. Abandoning releases the lock and increments the delivery count, which the requirement forbids.
- D. Completing removes the message permanently, so it could not be processed later.
Question 20
You are designing an Azure Database for PostgreSQL table for semantic search. Queries frequently filter on the created_at column.
The schema must support vector similarity search and reliable date filtering.
You need to ensure that the table meets the requirements.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: B, D. Store embeddings in a pgvector column; Use a typed timestamp column for created_at.
The pgvector extension adds a vector data type to Azure Database for PostgreSQL, so storing embeddings in a vector column enables native similarity operators such as cosine and Euclidean distance and supports vector indexes like HNSW and IVFFlat. Storing created_at in a typed timestamp column lets PostgreSQL compare and range-filter dates correctly, use B-tree indexes on the column, and combine date predicates with vector similarity queries reliably. Together the two choices give the table efficient semantic search and dependable date filtering.
Why the other options are wrong
- A. A free-form string cannot be compared or range-filtered reliably as a date and cannot use date-aware indexing.
- C. A varchar column holds text, so it provides no vector distance operators or vector indexes for similarity search.
Question 21
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.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: A, C. Queue name; Trigger type
A KEDA custom scale rule in Azure Container Apps is defined by a trigger type, here azure-queue, and the metadata that identifies what to monitor. To scale on the messages in one specific Azure Storage queue, the rule needs the queue name in its metadata together with the trigger type. Other settings, such as polling interval and replica limits, are optional or are configured outside the rule values.
Why the other options are wrong
- B. The polling interval has a default and is not required to define which queue is monitored.
- D. Maximum replicas is a general scale setting of the app and is not a value of the custom rule.
Question 22
You have an Event Grid subscription that triggers an Azure Function.
You need to prevent loss of events in case the endpoint returns an HTTP 400 response.
Which action should you perform?
Show answer and explanation
Correct answer: C. Configure a dead-letter destination.
Event Grid does not retry delivery when the endpoint returns an HTTP 400 response, because that status signals a permanent failure. Without a dead-letter destination, the event would be dropped. Configuring a dead-letter destination, which is an Azure Storage blob container, stores the undelivered events so that they are preserved and can be processed later.
Why the other options are wrong
- A. Batching groups events for delivery and does not protect them from being dropped.
- B. Handshake validation proves ownership of an endpoint when the subscription is created and does not preserve events.
- D. A retry policy is not applied to a 400 response, so it would not prevent the loss.
Question 23
You manage an Azure Cosmos DB for a NoSQL API account named account1. The account contains a database named db1, which contains a container named container1. You configure account1 with a session consistency level.
You plan to develop an application named App1 that will access container1. Individual instances of App1 must perform reads and writes. App1 must allow multiple nodes to participate in the same session.
You need to configure an object to share the session token between the nodes.
Which object should you use?
Show answer and explanation
Correct answer: A. Document response
With session consistency, every write returns a new session token in the response for that operation. When several web nodes each run their own CosmosClient and must participate in the same session, the application takes the SessionToken from the document response of the write, sends it to the caller (for example in a cookie), and passes it back so that whichever node handles the next read can supply it. The document response is therefore the object that carries the session token being shared between nodes, enabling read-your-own-writes across the tier.
Why the other options are wrong
- B. The connection policy controls connectivity settings such as preferred regions and connection mode, not session tokens.
- C. Feed options configure paging and query behavior for feed reads and are not the object that delivers the token produced by a write.
- D. Request options only accept a token on the receiving side and do not provide the session token generated by the write.
Question 24
You are developing a Java application to be deployed in Azure. The application stores sensitive data in Azure Cosmos DB.
You need to configure Always Encrypted to encrypt the sensitive data inside the application.
What should you do first?
Show answer and explanation
Correct answer: A. Create a customer-managed key (CMK) and store the key in a new Azure Key Vault instance.
Always Encrypted in Azure Cosmos DB uses a hierarchy of keys. The customer-managed key is the root key and lives in Azure Key Vault, so it must exist before anything else can be set up. Data encryption keys are then created and wrapped by that key, and the container encryption policy refers to those data encryption keys. Creating the customer-managed key in a new Key Vault is therefore the first step.
Why the other options are wrong
- B. A data encryption key is wrapped by the customer-managed key, so that key must already exist.
- C. A managed identity does not by itself create the key that all later encryption depends on.
- D. The container encryption policy refers to data encryption keys that do not yet exist at this point.
Question 25
You develop an AI application that stores telemetry documents in Azure Cosmos DB for NoSQL.
Each document contains 30 properties. Queries filter only on deviceId and timestamp.
Write operations consume more RUs than expected.
You need to reduce RU consumption for write operations while maintaining query performance.
What should you do?
Show answer and explanation
Correct answer: A. Exclude unused properties from indexing.
Azure Cosmos DB for NoSQL indexes every property by default, and each write must update the index entries for all of them, so a document with 30 properties pays index maintenance on 28 paths that no query uses. Excluding the unused paths from the indexing policy (for example, adding the paths of the 28 unused properties to excludedPaths) lowers the RU charge of every insert and update. Queries that filter on deviceId and timestamp still use their indexes, so query performance is unaffected.
Why the other options are wrong
- B. Adding index paths for the queried properties does not lower write cost while the remaining properties are still being indexed.
- C. A different partition key changes data distribution, not the index maintenance work that drives the write RU charge.
- D. Strong consistency increases latency and read cost and does nothing to reduce write RU consumption.
Question 26
You optimize an AI inference API that uses Redis caching.
You must reduce the risk of serving outdated data while minimizing cache management overhead.
You need to implement the caching strategy that satisfies the requirements.
What should you do?
Show answer and explanation
Correct answer: A. Trigger invalidation when source data changes.
Invalidating or updating a cache entry when its source data changes removes the stale copy at the moment it becomes outdated, which minimizes the risk of serving old data. The work happens only when a change event occurs, so there is no need to tune expirations or manage keys continuously, which keeps cache management overhead low.
Why the other options are wrong
- B. An LRU eviction policy manages memory pressure and does nothing to remove entries whose source data has changed.
- C. More memory lets stale entries stay cached longer and does not address freshness.
- D. Resetting expiration on each read keeps popular entries alive indefinitely, which increases the risk of serving outdated data.
Question 27
You deploy an AI application across multiple Azure regions.
The application must be able to view writes across all regions within a predictable time window.
You need to determine the appropriate consistency level.
What are two consistency levels you can use to achieve the goal? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: B, C. Strong; Bounded staleness
Strong consistency guarantees that reads always return the most recent committed write in every region. Bounded staleness guarantees that reads lag behind writes by no more than a configured number of versions or a configured time interval, so writes become visible across regions within a predictable window. Session and eventual consistency give no bound on how soon writes from other regions become visible.
Why the other options are wrong
- A. Session consistency guarantees ordering only within a single client session and gives no time bound across regions.
- D. Eventual consistency has no ordering or time guarantee, so the delay before writes appear in other regions is unpredictable.
Question 28
You are implementing semantic retrieval for a chatbot.
Embeddings are already stored in Redis. However, vector similarity queries do not return matches.
You need to resolve the vector similarity search issue.
What should you do?
Show answer and explanation
Correct answer: C. Create a FLAT vector index on the embedding field.
Redis vector similarity search runs through the query engine against an index created with FT.CREATE, and storing embeddings in hashes or JSON documents does not make them searchable on its own. Defining a VECTOR field with the FLAT algorithm (with the correct type, dimension and distance metric) over the embedding field indexes the existing and future keys, after which KNN queries return matches.
Why the other options are wrong
- A. A metadata-only index has no vector field, so KNN similarity queries still have nothing to search.
- B. Geo-replication copies data between regions and does not enable vector search.
- D. A TTL only controls how long keys live and does not make embeddings queryable.
Question 29
You are developing a solution that will use a multi-partitioned Azure Cosmos DB database. You plan to use the latest Azure Cosmos DB SDK for development.
The solution must meet the following requirements:
• Send insert and update operations to an Azure Blob storage account.
• Process changes to all partitions immediately.
• Allow parallelization of change processing.
You need to process the Azure Cosmos DB operations.
What are two possible ways to achieve this goal? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
Show answer and explanation
Correct answer: A, C. Create an Azure Function to use a trigger for Azure Cosmos DB. Configure the trigger to connect to the container; Create a background job in an Azure Kubernetes Service and implement the change feed feature of the SDK.
Both correct options rely on the change feed processor, which reads changes from every partition as they arrive, checkpoints progress in a lease container, and automatically distributes partition ranges across instances for parallel processing. An Azure Function with an Azure Cosmos DB trigger uses the change feed processor internally, so it receives inserts and updates from all partitions and scales out across function instances, after which it can write them to Blob storage. A background job in Azure Kubernetes Service that implements the change feed processor of the SDK provides the same behavior, with parallelism achieved by running multiple pods that share the lease container.
Why the other options are wrong
- B. The change feed estimator only measures how far behind a processor is; it does not read or forward changes.
- D. The pull model leaves scheduling, polling, and distribution of FeedRange work to custom code, so it does not process all partitions immediately the way the change feed processor does.
Question 30
You store embeddings in Redis by using keys formatted as doc:(id). Some embeddings are accessed frequently. Others are rarely used.
You need to implement a caching strategy that keeps only frequently accessed embeddings in memory.
What should you use?
Show answer and explanation
Correct answer: B. allkeys-lru
The allkeys-lru eviction policy removes the least recently used keys across the whole keyspace when memory is full. Frequently accessed embeddings are used often and therefore stay in memory, while rarely used ones are evicted first. This matches the goal of keeping only frequently accessed embeddings resident in the cache.
Why the other options are wrong
- A. volatile-ttl evicts keys with the shortest remaining expiry, regardless of how often they are used.
- C. EXPIRE sets a fixed lifetime on a key and does not consider access frequency.
- D. Time-window expiration removes keys on a schedule and does not track how often they are used.
That was 30 of 174.
The full Microsoft AI-200 pack has all 174 questions, each with the answer, the explanation and why the other options are wrong, plus a questions-only copy for timed runs. US$39, paid once, with free monthly updates and a pass-or-your-money-back guarantee.
Not ready yet? Get the first 87 free as one PDF by email. Get the Half Pack →
