Microsoft Azure AI Cloud Developer Associate (AI-200)

Practice AI-200 questions for Develop AI solutions by using Azure data management services (25–30%). These original questions are grounded in verified Microsoft Learn content.

Q01 - Question

You design a products table for filtered vector search in Azure Database for PostgreSQL. Most queries filter by category_id and a price range before they order by vector similarity. Products also have vendor-specific attributes that differ between products and are rarely filtered. Which two design choices should you make? Each correct answer presents part of the solution. Select two.

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Multi-select

B and D are correct.

Explanation: Structured columns with a B-tree index on (category_id, price) let PostgreSQL narrow the candidate rows before it calculates vector distances. A JSONB column gives you schema flexibility for dynamic attributes that you rarely filter on. This combination optimizes the common case and keeps the design flexible.

A is incorrect: GIN indexes support containment queries but not range queries. A price range filter on JSONB requires an expression index or a sequential scan.

C is incorrect: Consider partitioning when tables exceed tens of millions of rows and queries filter by the partition key. Here, the queries filter mainly by category, so partitioning by price adds complexity and doesn't match the query pattern.

Learn more in Microsoft Learn

Q02 - Question

An Azure Functions Cosmos DB trigger regenerates embeddings for every changed document in a knowledge base container. Most document changes update only the status, category, or access permission fields. Embedding API costs and rate limit errors are increasing. You need to reduce embedding API calls and keep embeddings accurate for content changes. What should you do?

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Single choice

C is correct.

Explanation: Metadata-only changes don't need new embeddings. A content hash lets you detect changes to the fields that affect the embedding without retrieving previous versions. Update the hash when you regenerate the embedding so that future comparisons work correctly.

A is incorrect: Regenerating embeddings for all documents increases embedding API calls, and a scheduled job replaces event-driven processing with periodic scans.

B is incorrect: Without a stored continuation token, each run reprocesses changes that were already handled, which increases embedding API calls.

D is incorrect: The lease container stores leases and checkpoints and has minimal throughput requirements. More lease throughput doesn't reduce the number of embedding API calls.

Learn more in Microsoft Learn

Q03 - Question

You configure a Redis Stream as a high-volume queue for AI inference requests. Workers acknowledge each task with XACK after processing. Monitoring shows that Redis memory use continues to grow even though the number of pending tasks stays low. You need to limit memory growth. What should you do?

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Single choice

A is correct.

Explanation: Stream tasks stay in memory until you remove them explicitly. Completed tasks don't expire automatically. Use maxlen with approximate=True on XADD, or call XTRIM periodically, to keep only the most recent tasks. Plan this cleanup strategy before you deploy a high-volume queue.

B is incorrect: XACK marks a task complete for the consumer group. Acknowledged tasks stay in the Stream until you trim them.

C is incorrect: XINFO commands return metrics such as total tasks, pending tasks, and consumers. They don't remove or expire tasks.

D is incorrect: XCLAIM reassigns pending tasks to another consumer. It doesn't remove tasks from the Stream.

Learn more in Microsoft Learn

Q04 - Question

You deploy a Python AI application that reads and writes items in Azure Cosmos DB for NoSQL. Security policy prohibits shared secrets in production and requires identity-based access control. You want one code path for local development and the deployed environment. Which two actions should you take? Each correct answer presents part of the solution.

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Multiple choice

A and D are correct.

Explanation: Microsoft Entra ID authentication uses role-based access control instead of shared secrets. DefaultAzureCredential uses your Azure CLI or Visual Studio credentials during local development and uses managed identity in deployed environments, so the same code runs in both. Before you use Entra ID authentication, assign an RBAC role to the identity. Cosmos DB Built-in Data Contributor grants read/write operations.

B is incorrect: Account keys are shared secrets that grant full access to all resources in the account. Keys do not integrate with centralized identity management or conditional access policies.

C is incorrect: Creating a client per request discards connection pools and cached routing information. This adds latency and might exhaust available connections. Create the client once at application startup and reuse it.

Learn more in Microsoft Learn

Q05 - Question

A nightly Python job uses psycopg to load about 50,000 archived agent messages into the messages table in Azure Database for PostgreSQL. The job currently runs one INSERT statement per row in a loop and takes too long. You need the highest load throughput. What should you do?

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Single choice

B is correct.

Explanation: For larger datasets of 10,000 rows or more, the COPY command provides the highest performance. It is often two to 10 times faster than individual inserts. In psycopg, use cur.copy() and write each record with copy.write_row().

A is incorrect: Use executemany for inserting hundreds to a few thousand rows. For 50,000 rows, COPY provides higher throughput.

C is incorrect: Never use string formatting or concatenation to build queries with data values. Use parameterized queries to prevent SQL injection.

D is incorrect: Creating new database connections is expensive because each requires network handshakes, authentication, and server-side resource allocation. A new connection per row makes the load slower.

Learn more in Microsoft Learn

Q06 - Question

You store 1536-dimensional dense embeddings from text-embedding-ada-002 in a vector(1536) column in Azure Database for PostgreSQL. Storage costs are increasing as the document table grows. You must reduce embedding storage and keep acceptable similarity search quality. What should you do?

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Single choice

C is correct.

Explanation: The halfvec type stores elements as 16-bit floating-point numbers and uses half the storage of the vector type. Use halfvec only after you benchmark and verify that half precision provides acceptable search quality for your use case.

A is incorrect: The sparsevec type is for models that produce sparse embeddings where most elements are zero. Dense embeddings from text-embedding-ada-002 are not sparse.

B is incorrect: The vector(n) dimension must match the output dimension of the embedding model. A 768-dimension column causes insertion errors for 1536-dimension embeddings.

D is incorrect: An index does not reduce the size of the vector column. An IVFFlat index adds about 1 to 1.5 times the vector column size in storage.

Learn more in Microsoft Learn

Q07 - Question

You design vector storage for a product catalog in Azure Managed Redis. Each product has nested specifications, several variant records, and two embeddings: one for the description and one for the main image. The application already exchanges product data in JSON format. Which storage approach should you use?

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Single choice

A is correct.

Explanation: Choose Redis JSON when your data has nested structures, you need multiple vectors per item, or your application already uses JSON. Convert each embedding to a numeric array with tolist(), and define the index with IndexType.JSON, $. JSONPath field names, and the as_name parameter for query references.

B is incorrect: Redis Hash stores flat field-value pairs only. It's the better choice for simple records when you need maximum memory efficiency and query speed, but it doesn't support nested objects.

C is incorrect: Flattening nested data into one text field works against the documented guidance. Hash is intended for data models that won't need nested objects.

D is incorrect: JSON documents store vectors as numeric arrays, not binary bytes, and a JSON-based index must use IndexType.JSON.

Learn more in Microsoft Learn

Q08 - Question

You are designing a new Azure Cosmos DB for NoSQL container for a legal research application. The embedding model produces 384-dimension vectors. At launch, each physical partition will store about 600 vectors. The business requires similarity search results with guaranteed accuracy, and approximate results aren't acceptable. Which vector index configuration should you use at launch?

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Single choice

D is correct.

Explanation: A flat index performs brute-force k-nearest neighbor search and compares the query vector against every indexed vector, so it provides 100% accuracy. The 384-dimension vectors are within the flat index limit of 505 dimensions, and the small dataset limits the latency and RU cost of brute-force comparison.

A is incorrect: DiskANN uses approximate nearest neighbor algorithms, which doesn't meet the guaranteed accuracy requirement. It also requires at least 1,000 vectors before the index becomes effective, and with fewer vectors queries fall back to brute-force scans.

B is incorrect: QuantizedFlat compresses vectors and can cause minor differences in ranked results. It also requires at least 1,000 vectors before the index becomes effective.

C is incorrect: The none mode disables indexing and supports only point reads by item ID and partition key. It doesn't support similarity search across embeddings.

Learn more in Microsoft Learn

Q09 - Question

You add read replicas to an Azure Database for PostgreSQL server that supports a product recommendation engine. The application runs vector similarity searches for recommendations. It also shows users their preferences immediately after they update them. How should you route these queries?

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Single choice

D is correct.

Explanation: Replication to read replicas is asynchronous, so replicas might be slightly behind the primary. Vector similarity searches are read-only and can tolerate slight staleness, so you can route them to replicas. Queries that need immediate consistency, such as a user's just-updated preferences, should go to the primary server.

A is incorrect: Recommendation searches can tolerate a few seconds of replica lag. If you send all of them to the primary server, you lose the extra query capacity that the replicas provide.

B is incorrect: Read replicas handle read queries only. Only the primary server can process the preference updates.

C is incorrect: You can create up to five read replicas per primary server. Even distribution also sends queries that need immediate consistency to replicas.

Learn more in Microsoft Learn

Q10 - Question

You plan to create an Azure Managed Redis resource with the Azure CLI. You then plan to build and run a Python Flask web app that connects with Microsoft Entra ID and publishes and subscribes to Redis channels and patterns. Which two items must you have in your development environment? Each correct answer presents part of the solution.

Domain: Develop AI solutions by using Azure data management services (25–30%) Type: Multiple choice

A and C are correct.

Explanation: The app requires Python 3.12 or greater. To create the Azure Managed Redis resource with the Azure CLI, install the latest Azure CLI and the redisenterprise extension by running az extension add --name redisenterprise.

B is incorrect: Python 3.8 doesn't meet the requirement. The app requires Python 3.12 or greater.

D is incorrect: The app uses pub/sub channels and pattern subscriptions. Pub/sub doesn't use Streams consumer groups.

Learn more in Microsoft Learn

Take the AI-200 practice test · Read the AI-200 study guide