NoSQL Quiz Questions - Correct Answers
1. Which of the following is NOT a benefit of relational databases?
Answer: d. Native support for nested records and lists
2. What is the 'impedance mismatch' in the context of relational databases?
Answer: c. The difference between the relational model and in-memory data structures
3. What is the main difference between an integration database and an application database?
Answer: b. Integration databases are shared by multiple applications, while application databases
are used by a single application
4. Why did large web properties like Google and Amazon start exploring alternatives to relational
databases in the early 2000s?
Answer: d. All of the above
5. What does the term 'NoSQL' stand for?
Answer: b. Not Only SQL
6. Which of the following is NOT a common characteristic of NoSQL databases?
Answer: c. They always run on clusters
7. What is an aggregate in the context of NoSQL databases?
Answer: a. A collection of related data that is treated as a unit
8. What is the main difference between key-value and document data models?
Answer: c. Key-value databases treat the aggregate as opaque, while document databases can see
the structure within the aggregate
9. Which type of NoSQL database is best suited for handling data with complex relationships?
Answer: d. Graph database
10. What is a materialized view in the context of NoSQL databases?
Answer: c. A precomputed and cached query that provides data organized differently from the
primary aggregates
11. What are the two main approaches to data distribution?
Answer: a. Replication and sharding
12. Which distribution model is recommended as the simplest option, if feasible?
Answer: d. Single server
13. What is sharding?
Answer: b. Putting different parts of the data onto different servers
14. Which distribution model is particularly helpful for scaling read-intensive datasets?
Answer: b. Master-slave replication
15. What is the main advantage of master-slave replication for read resilience?
Answer: b. Slaves can handle read requests even if the master fails
16. What is the biggest complication of peer-to-peer replication?
Answer: a. Maintaining consistency due to potential write-write conflicts
17. How can sharding and replication be combined?
Answer: c. By having multiple masters, each responsible for a subset of data, and replicating data
within each shard
18. What is a common strategy for column-family databases in terms of distribution models?
Answer: b. Sharding with master-slave replication for each shard
19. What is an inconsistency window?
Answer: a. The length of time an inconsistency is present in a system
20. What is a write quorum?
Answer: a. The minimum number of nodes that need to acknowledge a write to ensure strong
consistency
21. What is the main advantage of running processing logic on a cluster compared to a single
database server?
Answer: c. Ability to distribute computation over many machines
22. What is the purpose of the map function in the map-reduce pattern?
Answer: c. To process a single aggregate and emit key-value pairs
23. Which of the following statements about the reduce function in map-reduce is TRUE?
Answer: d. It combines multiple map outputs with the same key
24. How does partitioning improve the performance of map-reduce?
Answer: c. By allowing multiple reduce functions to run in parallel
25. What is a combining reducer?
Answer: b. A reduce function that can be used to reduce data before it is sent across the network
26. What is the benefit of breaking down a complex map-reduce calculation into multiple stages?
Answer: d. It simplifies the logic of each stage and allows for potential reuse of intermediate results
27. What is a materialized view in the context of map-reduce?
Answer: c. A stored intermediate result of a map-reduce computation that can be reused for other
computations
28. How can incremental map-reduce be used to update materialized views?
Answer: b. By only recomputing the parts of the view that are affected by the new data
29. Which of the following is NOT a limitation of the map-reduce pattern?
Answer: a. Map tasks can only operate on data from a single aggregate
30. What is the primary motivation for using map-reduce with NoSQL databases?
Answer: c. To efficiently process large volumes of data stored on clusters
31. What is a key difference between documents in a document database and rows in a traditional
RDBMS?
Answer: d. Documents can have varying structures and attributes within the same collection
32. Which of the following is NOT a common data format used for documents in document
databases?
Answer: d. CSV
33. In MongoDB, what is the function of the _id field?
Answer: c. It acts as a unique identifier for each document, similar to ROWID in Oracle
34. How does MongoDB achieve consistency in a distributed environment?
Answer: b. By utilizing replica sets and allowing control over write propagation with the w parameter
35. What is the purpose of the slaveOk flag in MongoDB?
Answer: d. To allow read operations to be served from secondary nodes, potentially improving read
performance
36. Which statement about transactions in document databases is most accurate?
Answer: c. Transactions are generally limited to atomic operations within a single document, though
some databases offer more advanced transaction capabilities
37. What is a key advantage of document databases' query features compared to key-value stores?
Answer: c. They enable querying based on data within the document without fetching the entire
document
38. How can document databases be scaled horizontally for read-intensive workloads?
Answer: b. By adding more secondary nodes to a replica set and configuring clients to read from
those secondaries.
39. What is the purpose of sharding in MongoDB?
Answer: d. To distribute data across multiple nodes, potentially enhancing both read and write
performance.
40. Which of the following is a use case where document databases are well-suited?
Answer: c. E-commerce applications with evolving product catalogs and order structures
41. What are the fundamental elements of a graph database?
Answer: d. Nodes and edges
42. In a graph database, what is a node?
Answer: c. An entity with properties, representing an object in the application
43. What is an edge in a graph database?
Answer: c. A relationship with properties, connecting two nodes
44. What is a key advantage of graph databases over relational databases for storing graph-like
structures?
Answer: d. Graph databases handle changing relationship types more flexibly
45. Why is traversing relationships typically faster in a graph database compared to a relational
database?
Answer: c. Graph databases persist relationships, so they don't need to be computed at query time
46. Which graph database is mentioned as being fully ACID-compliant?
Answer: c. Neo4j
47. How does Neo4j typically achieve high availability?
Answer: c. By using replicated slaves that can also handle write operations
48. What is the purpose of indexing in Neo4j?
Answer: c. To speed up the retrieval of nodes and edges based on property values
49. Which query language is specifically designed for traversing graph databases?
Answer: b. Cypher
50. What is a common approach for scaling graph databases when the dataset exceeds the RAM
capacity of a single server?
Answer: c. Sharding the data at the database level