MCQs on Working with Azure Cosmos DB APIs | Azure Cosmos DB MCQs Questions

Welcome to this comprehensive guide on Azure Cosmos DB MCQ questions and answers tailored for mastering its APIs. Azure Cosmos DB is a globally distributed, multi-model database service designed for modern application development. In this set of 30 multiple-choice questions, you will learn about the key concepts and usage of SQL API for document-oriented data, MongoDB API for NoSQL applications, Cassandra API for wide-column stores, Gremlin API for graph data, and Table API for key-value pairs. These questions are ideal for exam preparation or brushing up on your Azure Cosmos DB skills.


Chapter 4: Working with Azure Cosmos DB APIs – MCQs

Topic 1: Using SQL API for Document-Oriented Data

  1. What is the default consistency level of Azure Cosmos DB when using the SQL API?
    a) Strong
    b) Eventual
    c) Session
    d) Bounded staleness
  2. Which query language is used with the SQL API in Azure Cosmos DB?
    a) T-SQL
    b) ANSI SQL
    c) SQL-like syntax tailored for JSON
    d) SPARQL
  3. What type of data does the SQL API in Azure Cosmos DB primarily handle?
    a) Key-value data
    b) Relational data
    c) JSON document-oriented data
    d) Graph data
  4. How does Azure Cosmos DB index data when using the SQL API?
    a) Only primary keys are indexed
    b) All fields are indexed by default
    c) Indexing must be manually configured
    d) No indexing is supported
  5. What function does the ARRAY_CONTAINS method perform in SQL API queries?
    a) Checks if a field contains an array
    b) Validates if a specific value exists within an array
    c) Joins two arrays
    d) Splits an array into multiple documents
  6. Which of the following is a valid Azure Cosmos DB SQL API query?
    a) SELECT * FROM c WHERE c.id = '123'
    b) GET ALL FROM c WHERE c.id = '123'
    c) FIND c FROM id = '123'
    d) SELECT DOCUMENTS c WHERE id = '123'

Topic 2: Working with MongoDB API for NoSQL Applications

  1. What does the MongoDB API in Azure Cosmos DB enable developers to do?
    a) Query relational data
    b) Use MongoDB drivers to interact with Cosmos DB
    c) Configure VMs for MongoDB deployment
    d) Perform transactions on graph data
  2. Which command is supported by Azure Cosmos DB’s MongoDB API?
    a) db.collection.insertOne()
    b) SELECT FROM
    c) GRAPH MATCH
    d) GET TABLE ROWS
  3. What is the maximum document size supported by the MongoDB API in Azure Cosmos DB?
    a) 2 MB
    b) 4 MB
    c) 8 MB
    d) 16 MB
  4. How does the MongoDB API handle data partitioning in Azure Cosmos DB?
    a) By using collection-level sharding
    b) By assigning static storage quotas
    c) By creating secondary indexes
    d) By setting up primary keys only
  5. Which tool can developers use to migrate data from MongoDB to Azure Cosmos DB?
    a) Azure Data Migration Service
    b) Cosmos DB CLI
    c) MongoDB Compass
    d) Azure File Sync
  6. What happens if a MongoDB API query exceeds the RU limit in Azure Cosmos DB?
    a) The query fails with an error
    b) It executes with reduced consistency
    c) The query is throttled
    d) The RU limit is automatically increased

Topic 3: Using Cassandra API for Wide-Column Stores

  1. What is the purpose of the Cassandra API in Azure Cosmos DB?
    a) To manage key-value pairs
    b) To support wide-column database models
    c) To store graph data
    d) To handle JSON documents
  2. Which programming language can interact with Azure Cosmos DB using the Cassandra API?
    a) C#
    b) Java
    c) Python
    d) All of the above
  3. How does the Cassandra API support querying data in Azure Cosmos DB?
    a) Through CQL (Cassandra Query Language)
    b) By using SQL queries
    c) Via Gremlin syntax
    d) By running Spark jobs
  4. What is the primary unit of replication in the Cassandra API?
    a) Partition key
    b) Table
    c) Cluster
    d) Keyspace
  5. Which Azure Cosmos DB feature ensures data consistency for the Cassandra API?
    a) Tunable consistency levels
    b) Data sharding
    c) Virtual networks
    d) Table triggers
  6. How does the Cassandra API handle secondary indexes?
    a) Automatically indexes all columns
    b) Supports user-defined secondary indexes
    c) Requires no index configuration
    d) Limits to primary key indexing only

Topic 4: Graph Data with Gremlin API

  1. What is the Gremlin API used for in Azure Cosmos DB?
    a) Managing relational data
    b) Querying graph-based data models
    c) Importing JSON documents
    d) Handling key-value pairs
  2. Which language does the Gremlin API support for querying graph data?
    a) T-SQL
    b) Gremlin traversal language
    c) JSON Path
    d) SQL
  3. What is a common use case for the Gremlin API in Azure Cosmos DB?
    a) Real-time analytics
    b) Social network graphs
    c) Document management systems
    d) Transactional processing
  4. What does a “vertex” represent in the Gremlin API?
    a) A table schema
    b) A node in the graph
    c) A database partition
    d) A query execution plan
  5. How does the Gremlin API ensure relationship consistency?
    a) By maintaining edges between vertices
    b) By using secondary indexes
    c) By implementing eventual consistency
    d) By reducing replication latency
  6. Which Gremlin step retrieves all connected edges for a given vertex?
    a) outE()
    b) inV()
    c) hasLabel()
    d) count()

Topic 5: Table API for Key-Value Pairs

  1. What is the Table API in Azure Cosmos DB used for?
    a) Handling key-value data pairs
    b) Managing graph-based queries
    c) Importing large-scale files
    d) Storing JSON documents
  2. Which programming language supports Table API interactions in Cosmos DB?
    a) .NET
    b) Python
    c) JavaScript
    d) All of the above
  3. What query method is supported by the Table API?
    a) OData queries
    b) CQL queries
    c) SQL-like joins
    d) Gremlin traversals
  4. How is partitioning handled in the Table API?
    a) By defining a partition key per table
    b) By setting static table sizes
    c) By using multiple secondary indexes
    d) By enabling global sharding
  5. Which property is mandatory when adding an entity in Table API?
    a) PartitionKey
    b) EntityId
    c) IndexKey
    d) RowKey
  6. What is the maximum size for a single entity in the Table API?
    a) 64 KB
    b) 1 MB
    c) 5 MB
    d) 16 MB

Answer Key

QnoAnswer
1b) Eventual
2c) SQL-like syntax tailored for JSON
3c) JSON document-oriented data
4b) All fields are indexed by default
5b) Validates if a specific value exists within an array
6a) SELECT * FROM c WHERE c.id = '123'
7b) Use MongoDB drivers to interact with Cosmos DB
8a) db.collection.insertOne()
9d) 16 MB
10a) By using collection-level sharding
11a) Azure Data Migration Service
12c) The query is throttled
13b) To support wide-column database models
14d) All of the above
15a) Through CQL (Cassandra Query Language)
16d) Keyspace
17a) Tunable consistency levels
18b) Supports user-defined secondary indexes
19b) Querying graph-based data models
20b) Gremlin traversal language
21b) Social network graphs
22b) A node in the graph
23a) By maintaining edges between vertices
24a) outE()
25a) Handling key-value data pairs
26d) All of the above
27a) OData queries
28a) By defining a partition key per table
29a) PartitionKey
30a) 64 KB

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top