Azure Developer Cosmos DB SDK Basics Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Questions: 19 | Updated: Aug 14, 2026
Please wait...
Question 1 / 20
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. What is the default consistency level for Cosmos DB accounts?

Explanation

Cosmos DB uses Session consistency by default for newly created accounts. It provides read-your-writes and monotonic-read guarantees within a client session, helping users see their own recent updates while balancing consistency, availability, and performance. The consistency level can be changed in the account’s configuration.

Submit
Please wait...
About This Quiz
Azure Developer Cosmos Db Sdk Basics Quiz - Quiz

This quiz assesses your knowledge of Azure Cosmos DB SDK fundamentals for developers. It covers core concepts including connection setup, query operations, indexing strategies, partitioning, and consistency models. Ideal for college-level developers preparing for Azure certifications or building scalable cloud applications with Cosmos DB.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. The Cosmos DB SDK supports which query language for the SQL API?

Explanation

The Cosmos DB SDK’s SQL API uses a SQL-like query language to retrieve and filter JSON documents. Queries can reference document properties and use familiar constructs such as `SELECT`, `WHERE`, and `ORDER BY`. MongoDB Query Language, GraphQL, and XPath are not used to query data through the SQL API.

Submit

3. To optimize query performance, you should create an index on the ____ property used in WHERE clauses.

Explanation

Creating an index on the partition key helps the database locate matching records more efficiently when a WHERE clause filters on that property. It can reduce the amount of data scanned and speed up query execution, especially for large datasets, because the database can navigate directly to relevant partitions rather than checking every record.

Submit

4. Which SDK class represents a Cosmos DB database resource?

Explanation

The `Database` class represents a Cosmos DB database resource in the SDK. It provides access to database-level operations and to the containers within that database.

Submit

5. What is the purpose of the TTL (time-to-live) property in Cosmos DB?

Explanation

TTL in Cosmos DB sets an expiration period for items. When an item’s TTL elapses, Cosmos DB automatically deletes it, helping manage data retention and storage without requiring manual cleanup.

Submit

6. In the SDK, ____ is the method to delete an item from a container.

Explanation

`DeleteItemAsync` is used to remove an item from a container in the SDK. It typically takes the item’s ID and partition key, and performs the deletion asynchronously. The returned response can be inspected to confirm the operation’s status or handle errors.

Submit

7. The Cosmos DB Change Feed is useful for which scenario?

Explanation

The Cosmos DB Change Feed provides a stream of changes made to items in a container. Applications can process these changes as they occur, making it useful for real-time updates, event-driven workflows, and data synchronization.

Submit

8. Which feature allows you to run stored procedures and triggers in Cosmos DB?

Explanation

Server-side scripting lets you execute JavaScript stored procedures and triggers directly within Cosmos DB. These operations run close to the data, enabling transactional logic and reducing the need for separate application-side processing.

Submit

9. To retrieve a specific item by ID in Cosmos DB, use the ____ method.

Explanation

Use the `ReadItemAsync` method to retrieve a specific item from Cosmos DB by providing its item ID and partition key. It reads the item directly without querying the container.

Submit

10. In Cosmos DB SQL queries, which keyword filters results after aggregation?

Explanation

HAVING filters grouped results after aggregate functions such as COUNT, SUM, or AVG have been calculated. In contrast, WHERE filters individual documents before grouping and aggregation. FILTER and MATCH are not the standard SQL clauses used for applying conditions to aggregated groups.

Submit

11. Which connection mode in the Cosmos DB SDK provides lower latency for write operations in multi-region accounts?

Explanation

Direct mode connects the SDK directly to Cosmos DB replicas, avoiding the extra gateway hop. This reduces network overhead and typically provides lower latency and higher throughput for write operations, including in multi-region accounts.

Submit

12. The SDK method to create a new item in a container is ____ .

Explanation

`CreateItemAsync` is the SDK method used to add a new item to a container. It runs asynchronously, so the calling code can continue without blocking while the create operation is in progress.

Submit

13. Which indexing policy mode automatically indexes all properties of documents in Cosmos DB?

Explanation

Consistent indexing keeps the index up to date as items are written, so queries can use indexed document properties immediately. With Cosmos DB’s default indexing policy, all properties are included unless the policy is changed.

Submit

14. In Cosmos DB, what is the maximum size of a single item (document)?

Explanation

In Azure Cosmos DB, each individual item or document can be up to 2 MB in size. This limit applies to the complete serialized item, including its properties and values, so larger data may need to be split across multiple items or stored separately with a reference.

Submit

15. To connect to Cosmos DB using the .NET SDK, you initialize a ____ object with the connection string.

Explanation

The .NET SDK uses a `CosmosClient` instance to connect to Azure Cosmos DB. Create it by passing the account’s connection string to the `CosmosClient` constructor; the client then provides access to databases and containers.

Submit

16. Which consistency level offers the strongest guarantees in Cosmos DB?

Explanation

Strong consistency guarantees that reads return the most recent committed write, providing linearizability across clients. This offers the strongest consistency guarantees in Cosmos DB, though it may involve higher latency and reduced availability compared with weaker consistency levels.

Submit

17. What does RU stand for in Cosmos DB pricing and throughput calculations?

Explanation

RU stands for Request Unit, a normalized measure of the compute and resources consumed by database operations in Azure Cosmos DB. Throughput is provisioned in Request Units per second (RU/s), helping estimate and manage the capacity needed for reads, writes, and queries.

Submit

18. In the Cosmos DB SQL API SDK, which class is used to execute queries on a container?

Explanation

In the Cosmos DB SQL API SDK, a `Container` represents a collection of items and provides the methods needed to query them. You can create a query definition and use the container’s `GetItemQueryIterator` method to retrieve results. `Database` and `Client` provide higher-level access, while `QueryExecutor` is not the class used for container queries.

Submit

19. What is the primary purpose of a partition key in Cosmos DB?

Explanation

A partition key determines how Cosmos DB groups and distributes items across physical partitions. Choosing a key with well-distributed values helps balance storage and throughput, while enabling the database to locate related items efficiently.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (19)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What is the default consistency level for Cosmos DB accounts?
The Cosmos DB SDK supports which query language for the SQL API?
To optimize query performance, you should create an index on the ____...
Which SDK class represents a Cosmos DB database resource?
What is the purpose of the TTL (time-to-live) property in Cosmos DB?
In the SDK, ____ is the method to delete an item from a container.
The Cosmos DB Change Feed is useful for which scenario?
Which feature allows you to run stored procedures and triggers in...
To retrieve a specific item by ID in Cosmos DB, use the ____ method.
In Cosmos DB SQL queries, which keyword filters results after...
Which connection mode in the Cosmos DB SDK provides lower latency for...
The SDK method to create a new item in a container is ____ .
Which indexing policy mode automatically indexes all properties of...
In Cosmos DB, what is the maximum size of a single item (document)?
To connect to Cosmos DB using the .NET SDK, you initialize a ____...
Which consistency level offers the strongest guarantees in Cosmos DB?
What does RU stand for in Cosmos DB pricing and throughput...
In the Cosmos DB SQL API SDK, which class is used to execute queries...
What is the primary purpose of a partition key in Cosmos DB?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!