MongoDB MCQ Questions - Optimization Strategies

This section focuses on "Optimization Strategies" in MongoDB. These Multiple Choice Questions (MCQ) should be practiced to improve the MongoDB skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.

1. Which command returns a document that provides an overview of the database process's state?

A. serverStatus 
B. currentQueue
C. currentQu
D. clientStatus

View Answer


2. Which of the following setting defines what constitutes a "slow" operation?

A. fastOpThresholdMs
B. slowOpThresholdZs
C. slowOpThresholdMs
D. slowOpThresholdGs

View Answer


3. _________provide the number of times the lock acquisitions encountered deadlocks.

A. locks.deadlock
B. lock.deadlockCount
C. lock.deadlock
D. locks.deadlockCount

View Answer


4. _________ returns the queryPlanner information for the evaluated method.

A. db.explain()
B. db.collection.explain()
C. collection.explain()
D. explain()

View Answer


5. Point out the correct statement.

A. For read-heavy applications, deploy sharding and add one or more shards to a sharded cluster to distribute load among mongod instances
B. Spikes in the number of available connections can also be the result of application or driver errors
C. For read-heavy applications, increase the size of your replica set and distribute read operations to secondary members
D. All of the above

View Answer


6. With which storage engine, MongoDB uses memory-mapped files to store data?

A. MMAPv2
B. MMAPv1
C. WiredTiger
D. All of the above

View Answer


7. _________ returns the queryPlanner and executionStats information for the evaluated method.

A. cursor.explain()
B. tablescan.explain()
C. server.explain()
D. client.explain()

View Answer


8. If MongoDB can use an index scan to obtain the requested sort order, the result will not include a SORT stage

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


9. Which of the following provides information on the MongoDB instance?

A. serverInfo
B. queryPlanner
C. executeStats
D. None of the above

View Answer


10. If the query planner selects a _________ the explain result includes an IXSCAN stage.

A. Document
B. Replica Set
C. Index
D. None of the above

View Answer





Discussion



* You must be logged in to add comment.