microsoft AI-200: Developing AI Cloud Solutions on Azure · Practice questions

2. Develop AI solutions by using Azure data management services Practice Questions

Review 10 sample questions with their correct answers and explanations. Sign up free to continue with the full topic quiz.

Sign up free for the full quiz

Question 1

You know both the id and the partition key value of an item in Azure Cosmos DB for NoSQL. What is the cheapest way to retrieve it?

  1. Read the change feed from the beginning
  2. Use a stored procedure that scans the container
  3. Run SELECT * FROM c WHERE c.id = @id across all partitions
  4. Use a point read (ReadItem) with the id and partition key — Correct

Correct answer

Use a point read (ReadItem) with the id and partition key

Explanation

A point read with id and partition key is the most efficient operation, costing about 1 RU for a 1 KB item.

Question 2

Building an HNSW index on 10 million embeddings takes hours. Which setting most directly speeds up the index build?

  1. Lower ef_search
  2. Increase max_connections so that more client sessions can build parts of the index
  3. Increase maintenance_work_mem (and parallel maintenance workers) — Correct
  4. Enable autovacuum

Correct answer

Increase maintenance_work_mem (and parallel maintenance workers)

Explanation

Index builds are faster when the graph fits in maintenance_work_mem. Parallel workers also help.

Question 3

Which Cosmos DB query correctly returns the five most similar items to a query vector @q?

  1. SELECT TOP 5 c.id, VectorDistance(c.embedding, @q) AS score FROM c WHERE score > 0.8 ORDER BY c.id
  2. SELECT TOP 5 c.id FROM c ORDER BY c.embedding DESC
  3. SELECT c.id FROM c WHERE c.embedding = @q
  4. SELECT TOP 5 c.id, VectorDistance(c.embedding, @q) AS score FROM c ORDER BY VectorDistance(c.embedding, @q) — Correct

Correct answer

SELECT TOP 5 c.id, VectorDistance(c.embedding, @q) AS score FROM c ORDER BY VectorDistance(c.embedding, @q)

Explanation

Vector search uses VectorDistance in ORDER BY together with TOP N. Results are ranked by similarity.

Question 4

A developer must import 2 million documents into Cosmos DB as fast as possible from a .NET app. Which SDK option helps?

  1. ConsistencyLevel = Strong
  2. MaxItemCount = 1
  3. AllowBulkExecution = true — Correct
  4. ConnectionMode = Gateway only

Correct answer

AllowBulkExecution = true

Explanation

Bulk mode groups concurrent operations to maximize throughput usage for large imports.

Question 5

A container stores 3,072-dimension embeddings. Which vector index type is NOT suitable because of its dimension limit?

  1. flat — Correct
  2. No vector index type has a dimension limit
  3. diskANN
  4. quantizedFlat

Correct answer

flat

Explanation

The flat index supports a limited number of dimensions (505). Higher-dimension embeddings use quantizedFlat or diskANN.

Question 6

An app receives HTTP 429 responses from Cosmos DB during short traffic spikes. Which response is most appropriate first?

  1. Rely on the SDK's built-in retries that honor retry-after, and consider autoscale throughput — Correct
  2. Create a new CosmosClient on every retry so the request is routed to a different gateway node
  3. Remove the partition key
  4. Switch to Strong consistency

Correct answer

Rely on the SDK's built-in retries that honor retry-after, and consider autoscale throughput

Explanation

429 means the provisioned RUs were exceeded. The SDK retries after the suggested delay. Autoscale handles spikes better.

Question 7

A change feed processor runs on three instances with the same processor name and lease container. What happens?

  1. Only the first instance runs; the others stay idle forever
  2. Every instance processes all changes, so the handler must deduplicate them by item id
  3. Leases are distributed so each partition range is processed by one instance — Correct
  4. Each instance processes every change three times

Correct answer

Leases are distributed so each partition range is processed by one instance

Explanation

Instances sharing a lease container split the lease ownership, which scales out processing without duplicate work.

Question 8

A product price cached in Redis must never be served for more than 10 minutes after it was cached. Which command sets the value with that expiry?

  1. SET price:42 19.99 EX 600 — Correct
  2. INCR price:42
  3. PERSIST price:42
  4. SET price:42 19.99 NX, followed by PERSIST price:42

Correct answer

SET price:42 19.99 EX 600

Explanation

EX sets a time-to-live in seconds. PERSIST removes a TTL, and NX only sets the key if it does not exist.

Question 9

Vector search commands fail on a newly created Azure Managed Redis instance with an unknown command error. What is the most likely cause?

  1. The client connects over TLS on port 10000, which does not support module commands
  2. The eviction policy is allkeys-lru
  3. The keys have no TTL
  4. The RediSearch module was not enabled when the instance was created — Correct

Correct answer

The RediSearch module was not enabled when the instance was created

Explanation

Vector search depends on the RediSearch module, which is selected when the instance is created.

Question 10

Embedding storage is too large. You want to reduce storage and memory with minimal impact on recall. Which pgvector option helps?

  1. Use a numeric[] column, which pgvector compresses automatically
  2. Store embeddings as halfvec (16-bit floats) — Correct
  3. Store embeddings as text
  4. Disable TOAST compression

Correct answer

Store embeddings as halfvec (16-bit floats)

Explanation

halfvec halves storage per dimension and can be indexed, usually with little recall loss.

Ready for the full quiz?

Create a free QuizAnalyst account to practice the complete question set and save your progress.

Sign up free for the full quiz