Multiple-Choice Quiz on Azure Cosmos DB, Cloud Design Patterns, and NoSQL Databases
1 What is Azure Cosmos DB?
A) A NoSQL database for managing data at planet-scale
B) A SQL-based database
C) A relational database management system
D) A programming language
Answer: A
Explanation: Cosmos DB is a multi-model NoSQL database designed for global distribution,
scalability, and performance. It allows for horizontal scaling, making it suitable for large-scale
applications.
2 Which of the following is NOT a component of the Web-Queue-Worker architecture?
A) Web front end
B) Worker for resource-intensive tasks
C) A distributed cache
D) A centralized database only for logs
Answer: D
Explanation: The Web-Queue-Worker pattern includes a web front end, a worker for intensive
tasks, and usually a distributed cache, but not a centralized database exclusively for logs.
3 What is the main function of the worker in the Web-Queue-Worker architecture?
A) Serve client requests
B) Perform long-running or batch tasks asynchronously
C) Handle only lightweight, synchronous tasks
D) Manage the identity provider for authentication
Answer: B
Explanation: The worker in this architecture handles asynchronous, resource-intensive, or
long-running tasks, allowing the front end to remain responsive to users.
4 Which architecture style supports applications that require independent scaling of
subsystems?
A) Microservices
B) Monolithic
C) 3-Tier
D) Centralized database architecture
Answer: A
Explanation: Microservices architecture allows each service to be scaled and deployed
independently, ideal for handling different resource needs across an application.
5 Which of the following describes a document database?
A) Stores data as structured tables
B) Uses a flexible schema with JSON-like documents
C) Stores data in rows and columns
D) Uses only XML for data representation
Answer: B
Explanation: Document databases, like Cosmos DB, store data in flexible, semi-structured
formats, such as JSON, allowing for dynamic schemas.
6 Which NoSQL database is optimized for handling interconnected data?
A) Columnar database
B) Key-value store
C) Document database
D) Graph database
Answer: D
Explanation: Graph databases are best suited for data with complex relationships, as they can
model and query connections between data points efficiently.
7 In Cosmos DB, what is the primary purpose of a partition key?
A) To define schema structure
B) To distribute data across multiple storage locations
C) To enforce strict data consistency
D) To configure serverless mode
Answer: B
Explanation: Partition keys are crucial in Cosmos DB for organizing data into logical partitions,
ensuring efficient data distribution and query performance.
8 Which feature is unique to Cosmos DB when compared to traditional relational
databases?
A) Limited scalability
B) Fixed schema requirements
C) Global distribution and multi-model support
D) Centralized SQL-only querying
Answer: C
Explanation: Cosmos DB’s global distribution and support for various data models (e.g., key-
value, document) make it distinct from traditional SQL databases.
9 What is the main advantage of using the Serverless mode in Cosmos DB?
A) It provides unlimited throughput
B) It only allows SQL queries
C) It is cost-effective for infrequent workloads
D) It restricts global distribution
Answer: C
Explanation: Serverless mode is ideal for applications with irregular demand, as it
automatically adjusts resources, saving costs when demand is low.
10 Which API is NOT supported by Azure Cosmos DB?
A) Gremlin API
B) MongoDB API
C) MySQL API
D) Table API
Answer: C
Explanation: Cosmos DB supports Core SQL, MongoDB, Gremlin, and Table APIs, but not the
MySQL API.
11 Which is a use case where a document database like Cosmos DB is particularly
suitable?
A) Storing sensor data logs
B) Managing interconnected data with complex relationships
C) Handling large volumes of JSON-based product data
D) Supporting transactions in a financial application
Answer: C
Explanation: Document databases are optimized for handling semi-structured data like JSON,
making them ideal for storing product catalogs and user data.
12 What is a key feature of Microservices architecture?
A) Services communicate only synchronously
B) Services have a centralized database for all microservices
C) Each service can be deployed and scaled independently
D) All services must use the same technology stack
Answer: C
Explanation: Microservices architecture enables independent scaling and deployment of each
service, enhancing agility and flexibility.
13 What is the role of the API Gateway in Microservices architecture?
A) To directly access each service's database
B) To expose client requests and forward them to appropriate services
C) To prevent services from being scaled independently
D) To handle synchronous messaging only
Answer: B
Explanation: The API Gateway acts as an entry point, managing requests and directing them to
the correct services, enhancing separation between clients and services.
14 What type of data does a columnar database store?
A) Rows in a JSON format
B) Data in wide columns with each column stored independently
C) Data in strict tables with predefined schema
D) Data only in key-value pairs
Answer: B
Explanation: Columnar databases organize data by columns rather than rows, allowing for
efficient access and storage, particularly in analytics.
15 Which NoSQL database type uses a hash-based key-value pair model?
A) Columnar database
B) Document database
C) Key-value store
D) Graph database
Answer: C
Explanation: Key-value stores use a simple key-value model where data is accessed by a
unique key, allowing fast retrieval.
16 Which is a benefit of using polyglot persistence in cloud architectures?
A) Allows each service to use the best storage option for its needs
B) Forces all services to use a single database type
C) Reduces performance due to multiple storage types
D) Increases storage cost by enforcing uniform data handling
Answer: A
Explanation: Polyglot persistence enables the use of different database types within an
architecture, optimizing data storage based on specific use cases.
16 How does Cosmos DB achieve high availability globally?
A) Through single data centre storage
B) Using global distribution with multiple data regions
C) By replicating data only in the primary region
D) Through local databases without backups
Answer: B
Explanation: Cosmos DB’s global distribution replicates data across regions, ensuring data is
always available, even in case of regional outages.
18 Which Cosmos DB API is specifically compatible with document-oriented applications?
A) Cassandra API
B) MongoDB API
C) Table API
D) Core (SQL) API
Answer: B
Explanation: The MongoDB API in Cosmos DB is compatible with document databases, making
it suitable for applications that use MongoDB drivers and JSON data structures.
19 What is a potential downside of Microservices architecture?
A) Difficult to scale individual components
B) Complex inter-service communication and potential latency
C) Inability to implement fault isolation
D) Large monolithic codebase dependencies
Answer: B
Explanation: Microservices often require intricate communication between services, which
can introduce latency and complexity.
20 In Cosmos DB, what is a JOIN operation used for?
A) To combine documents from multiple containers
B) To connect data elements within a single document
C) To link documents in different databases
D) To join Cosmos DB data with on-prem databases
Answer: B
Explanation: JOIN operations in Cosmos DB are limited to intra-document relationships, unlike
SQL databases that support joins across multiple tables.
21 What is the best approach to handling semi-structured data in a NoSQL database?
A) Use a document database
B) Use a relational database with predefined schema
C) Store data in a key-value format only
D) Enforce a fixed schema to ensure consistency
Answer: A
Explanation: Document databases are designed for semi-structured data, allowing for flexible
schemas that are ideal for varied data formats like JSON.
22 Which of these is a use case for a key-value store?
A) Managing detailed product data with nested objects
B) Storing user session data and quick lookups
C) Creating complex data relationships
D) Storing hierarchical document-based data
Answer: B
Explanation: Key-value stores are optimized for fast retrieval, making them ideal for storing
session data and caching.
23 What is the primary purpose of the partition key in Cosmos DB?
A) It serves as a global unique identifier
B) It allows data to be segmented across physical storage
C) It enforces data consistency
D) It controls serverless mode settings
Answer: B
Explanation: The partition key is essential for distributing data across storage partitions in
Cosmos DB, helping balance load and optimize queries.
24 Which of the following best describes Cosmos DB's data consistency models?
A) Only strong consistency is supported
B) Consistency levels vary from strong to eventual
C) Consistency is fixed based on the partition key
D) There are no consistency models in Cosmos DB
Answer: B
Explanation: Cosmos DB provides multiple consistency models, allowing applications to
choose between strict consistency and high availability.
25 In Cosmos DB, what is the recommended approach to managing unpredictable
workloads?
A) Use provisioned throughput mode only
B) Select serverless mode to adjust to demand automatically
C) Use a single data region to reduce costs
D) Restrict scaling options to avoid overuse
Answer: B
Explanation: Serverless mode in Cosmos DB scales with demand, making it ideal for workloads
with unpredictable or irregular usage patterns.