Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

MongoDB MCQ Set 1

1. ________ contains a counter of the total number of clients with active operations in progress or queued.
a) globalLock.active
b) localLock.activeClients
c) globalLock.activeClients
d) all of the mentioned

View Answer

Answer: c [Reason:] The activeClients data structure provides more granular information about the number of connected clients and the operation types (e.g. read or write) performed by these clients.

2. Point out the correct statement :
a) In MongoDB 3.0, cursor.explain() returns the indexOnly field to indicate whether the index covered a query
b) When an index covers a query, MongoDB can both match the query conditions and return the results using only the index keys
c) For read-heavy applications, deploy sharding and add one or more shards to a sharded cluster to distribute load among mongod instances
d) All of the mentioned

View Answer

Answer: b [Reason:] MongoDB does not need to examine documents from the collection to return the results.

3. The ___________ collection stores custom roles that administrators create and assign to users to provide access to specific resources.
a) admin.system.role
b) admin.system.roles
c) admin.system.roleasign
d) all of the mentioned

View Answer

Answer: b [Reason:] System collections include these collections stored in the admin database

4. The _________ field provides the amount of resident memory in use.
a) mem.resident
b) memory.resident
c) mem.resident
d) all of the mentioned

View Answer

Answer: c [Reason:] If this exceeds the amount of system memory and there is a significant amount of data on disk that isn’t in RAM, you may have exceeded the capacity of your system.

5. Point out the correct statement :
a) MongoDB distributions are currently available for Mac OS X, Linux, Windows Server 2012, Windows Server 2008 R2 64bit, Windows 7 (64 bit), Windows Vista, and Solaris
b) The MongoDB distribution for Solaris include support for the WiredTiger storage engine
c) mongod will not start if dbPath contains data files created by a storage engine
d) None of the mentioned

View Answer

Answer: b [Reason:] The MongoDB distribution for Solaris does not include support for the WiredTiger storage engine.

6. When the TTL thread is active, you will see _______ operations in the output of db.currentOp().
a) read
b) update
c) delete
d) all of the mentioned

View Answer

Answer: c [Reason:] When you build a TTL index in the background, the TTL thread can begin deleting documents while the index is building.

7. MongoDB stores tag sets in the replica set configuration object, which is the document returned by _____
a) rs.config()
b) rs.conf()
c) rs.confstats()
d) all of the mentioned

View Answer

Answer: b [Reason:] Custom read preferences and write concerns evaluate tags sets in different ways.

8. Which of the following represents Shared lock ?
a) R
b) w
c) r
d) W

View Answer

Answer: a [Reason:] W represents Exclusive (X) lock.

9. On Linux, use the ______ command to check if disk I/O is a bottleneck for your database.
a) stat
b) iostats
c) iostat
d) none of the mentioned

View Answer

Answer: c [Reason:] Specify a number of seconds when running iostat to avoid displaying stats covering the time since server boot.

10. Which of the following document configures the threshold which determines whether a query is “slow” for the purpose of the logging system?
a) systemLog.verbosity
b) operationProfiling.mode
c) operationProfiling.slowOpThresholdMs
d) none of the mentioned

View Answer

Answer: c [Reason:] systemLog.verbosity controls the amount of logging output that mongod write to the log.

MongoDB MCQ Set 2

1. ____________ does not dump the content of the local database.
a) mongoshell
b) mongodump
c) mongolocaldump
d) none of the mentioned

View Answer

Answer: b [Reason:] mongodump can read data from either mongod or mongos instances, in addition to reading directly from MongoDB data files without an active mongod.

2. Point out the correct statement :
a) The data format used by mongodump from version 2.2 or later is incompatible with earlier versions of mongod
b) The replica role confers no additional access, in keeping with the policy of least privilege
c) To backup a given database’s users, you must have the replace action on the admin database’s admin.system.users collection
d) All of the mentioned

View Answer

Answer: a [Reason:] Do not use recent versions of mongodump to back up older data stores.

3. To backup all the databases in a cluster via mongodump, you should have the ___________ role.
a) restore
b) backup
c) replication
d) all of the mentioned

View Answer

Answer: b [Reason:] The backup role provides the required privileges for backing up all databases.

4. ___________ is a routing service for MongoDB shard configurations that processes queries from the application layer.
a) mongod
b) mongos
c) mongocon
d) none of the mentioned

View Answer

Answer: b [Reason:] From the perspective of the application, a mongos instance behaves identically to any other MongoDB instance.

5. Point out the wrong statement :
a) To backup a given database, you must have read access on the database
b) The backup role confers no additional access, in keeping with the policy of least privilege
c) mongodumplocal overwrites output files if they exist in the backup data folder
d) All of the mentioned

View Answer

Answer: c [Reason:] To backup the system.profile collection, which is created when you activate database profiling, you must have additional read access on this collection.

6. __________ sends all diagnostic logging information to a log file instead of to standard output or to the host’s syslog system.
a) syspath
b) syslog
c) logpath
d) syspathlog

View Answer

Answer: c [Reason:] By default, MongoDB overwrites the log file when the process restarts.

7. ___________ is the primary daemon process for the MongoDB system.
a) mongos
b) mongod
c) logpath
d) syspathlog

View Answer

Answer: b [Reason:] It handles data requests, manages data access, and performs background management operations.

8. __________ is a diagnostic tool for inspecting BSON files
a) jsondump
b) bsondump
c) bsondumpjson
d) all of the mentioned

View Answer

Answer: b [Reason:] The bsondump converts BSON files into human-readable formats, including JSON.

9. Which of the following is a utility to check disk I/O performance independently of MongoDB?
a) mongoperf
b) mongoio
c) mongod
d) none of the mentioned

View Answer

Answer: a [Reason:] Specify options to mongoperf using a JavaScript document.

10. ____________ utility makes it possible to manipulate files stored in your MongoDB instance in GridFS objects from the command line.
a) mongoperf
b) mongoio
c) mongod
d) mongofiles

View Answer

Answer: d [Reason:] All mongofiles commands have the following form:mongofiles

MongoDB MCQ Set 3

1. ___________ captures and returns the counts of database operations by type.
a) mongostat
b) mongod
c) mms
d) all of the mentioned

View Answer

Answer: a [Reason:] Use mongostat to understand the distribution of operation types and to inform capacity planning.

2. Point out the correct statement :
a) Database commands cannot return statistics regarding the current database state with greater fidelity
b) Monitoring is a critical component of all database administration
c) The MongoDB distribution does not include utilities that quickly return statistics about instances’ performance and activity
d) All of the mentioned

View Answer

Answer: a [Reason:] This is useful for diagnosing issues and assessing normal operation.

3. _________ tracks and reports the current read and write activity of a MongoDB instance, and reports these statistics on a per collection basis.
a) mongostat
b) mongod
c) mongotop
d) all of the mentioned

View Answer

Answer: c [Reason:] Use mongotop to check if your database activity and use match your expectations.

4. _______ method is useful tool for identifying the database instance’s in-progress operations.
a) db.current
b) db.currentOp
c) db.Op
d) none of the mentioned

View Answer

Answer: b [Reason:] MongoDB includes a number of commands that report on the state of the database.

5. Point out the correct statement :
a) MMS offers point in time recovery of MongoDB replica sets
b) MongoDB provides a web interface that exposes diagnostic and monitoring information in a simple web page
c) db.Status() outputs an account of the state of a MongoDB instance
d) none of the mentioned

View Answer

Answer: b [Reason:] The web interface is accessible at localhost: , where the number is 1000 more than the mongod port.

6. ___________ returns a general overview of the status of the database, detailing disk usage, memory use, connection, journaling, and index access.
a) dbStats
b) db.serverStatus()
c) db.stats()
d) none of the mentioned

View Answer

Answer: b [Reason:] This command is rarely run directly.

7. The ________ reflect the amount of storage used, the quantity of data contained in the database, and object, collection, and index counters.
a) dbStats
b) db.serverStatus()
c) db.statserver()
d) none of the mentioned

View Answer

Answer: a [Reason:] The dbStats command, or db.stats() from the shell, returns a document that addresses storage use and data volumes.

8. ________ provides statistics that resemble dbStats on the collection level
a) dbStats
b) db.serverStatus()
c) db.statserver()
d) collstats

View Answer

Answer: d [Reason:] It also includes count of the objects in the collection, the size of the collection, the amount of disk space used by the collection, and information about its indexes.

9. Which of the following command returns quickly and does not impact MongoDB performance ?
a) dbStats
b) db.serverStatus()
c) db.stats()
d) none of the mentioned

View Answer

Answer: b [Reason:] serverStatus outputs an account of the state of a MongoDB instance.

10. Which of the following document details the state and configuration of the replica set and statistics about its members ?
a) replSetGetStatus
b) db.serverStatus()
c) db.stats()
d) none of the mentioned

View Answer

Answer: d [Reason:] The replSetGetStatus command (rs.status() from the shell) returns an overview of your replica set’s status.

MongoDB MCQ Set 4

1. The enabled setting for mongod and mongos instances disables the __________ status page.
a) home
b) primary
c) secondary
d) none of the mentioned

View Answer

Answer: a [Reason:] The mongod and mongos instances run with the http interface disabled by default.

2. Point out the correct statement :
a) The status interface is write-only by default
b) Default port for the status page is 28117
c) Authentication does not control or affect access to this interface
d) None of the mentioned

View Answer

Answer: c [Reason:]If you enable this interface, you should only allow trusted clients to access this port.

3. The net.http.RESTInterfaceEnabled setting for mongod enables a fully interactive administrative __________ interface, which is disabled by default
a) Restful
b) Rest
c) WebService
d) All of the mentioned

View Answer

Answer: b [Reason:]The REST interface does not support any authentication and you should always restrict access to this interface to only allow trusted clients to connect to this port.

4. The ________ setting for mongod and mongos instances limits the network interfaces on which MongoDB programs will listen for incoming connections.
a) bindIpmongo
b) bind
c) bindIp
d) revokeip

View Answer

Answer: c [Reason:]You can also specify a number of interfaces by passing bindIp a comma separated list of IP addresses.

5. Point out the wrong statement :
a) Changing the port does not meaningfully reduce risk or limit exposure
b) You can use the mongod –bind_ip and mongos –bind_ip option on the command line at run time to limit the network accessibility of a MongoDB program
c) The net.http.RESTInterfaceEnabled configuration makes the http status interface, which is read-only by default, fully interactive
d) None of the mentioned

View Answer

Answer: d [Reason:]If your system has more than one network interface, bind MongoDB programs to the private or internal network interface.

6. The ________ setting for mongod and mongos instances changes the main port on which the mongod or mongos instance listens for connections.
a) portp
b) port
c) portIP
d) none of the mentioned

View Answer

Answer: b [Reason:]Setting port also indirectly sets the port for the HTTP status interface, which is always available on the port numbered 1000 greater than the primary mongod port.

7. On Linux systems, the ________ interface provides access to the underlying netfilter firewall.
a) ssip
b) iptables
c) dns
d) all of the mentioned

View Answer

Answer: b [Reason:]Firewalls allow administrators to filter and control access to a system by providing granular control over what network communications.

8. On Windows systems, __________ command line interface provides access to the underlying Windows Firewall.
a) netsh
b) netstat
c) netln
d) SelectIndexes

View Answer

Answer: a [Reason:]To minimize overall exposure, ensure that only traffic from trusted sources can reach mongod and mongos instances and that the mongod and mongos instances can only connect to trusted outputs.

9. MongoDB users who use VPNs use ________ rather than IPSEC VPNs for performance issues.
a) TTS
b) SSL
c) LTS
d) None of the mentioned

View Answer

Answer: b [Reason:]Virtual private networks, or VPNs, make it possible to link two networks over an encrypted and limited-access trusted network.

10. By default, the policy in ___________ Firewall allows all outbound connections and blocks all incoming connections.
a) Windows
b) Linux
c) Mac
d) None of the mentioned

View Answer

Answer: a [Reason:]Given the default ports of all MongoDB processes, you must configure networking rules that permit only required communication between your application and the appropriate mongod.exe and mongos.exe instances.

MongoDB MCQ Set 5

1. Object_Id is similar to _________ key in Relational Databases
a) primary
b) secondary
c) composite
d) all of the mentioned

View Answer

Answer: a [Reason:] Object_Id is unique and cannot be changed.

2. Point out the correct statement :
a) ObjectIds are small, likely unique, fast to generate, and ordered
b) ObjectIds are large, likely unique, and ordered
c) ObjectIds values consists of 18-bytes
d) All of the mentioned

View Answer

Answer: a [Reason:] In MongoDB, documents stored in a collection require a unique _id field that acts as a primary key.

3. Which of the field is reserved for use as a primary key ?
a) _id
b) _uid
c) _uuid
d) All of the mentioned

View Answer

Answer: a [Reason:] ID value value must be unique in the collection, is immutable, and may be of any type other than an array.

4. In the mongo shell, you can access the creation time of the ObjectId, using the ______ method..
a) getTime()
b) getTimestamp()
c) Timestamp()
d) none of the mentioned

View Answer

Answer: b [Reason:] MongoDB clients should add an _id field with a unique ObjectId.

5. Point out the wrong statement :
a) The field names cannot start with the dollar sign ($) character
b) The field names cannot contain the dot (.) character
c) The field names cannot contain the null character
d) None of the mentioned

View Answer

Answer: d [Reason:] Documents have certain restrictions on field names.

6. To ensure functioning replication, do not store values that are of the _______ regular expression type in the _id field.
a) JSON
b) XML
c) JScript
d) None of the mentioned

View Answer

Answer: d [Reason:] The _id field may contain values of any BSON data type, other than an array.

7. GridFS uses a _________ index on the chunks collection for the files_id and n fields.
a) unique
b) single
c) non unique
d) none of the mentioned

View Answer

Answer: a [Reason:] The files_id field contains the _id of the chunk’s “parent” document.

8. The ______ field is always the first field in the document.
a) _id
b) id
c) Ob_id
d) None of the mentioned

View Answer

Answer: a [Reason:] Updates that include renaming of field names may result in the reordering of fields in the document.

9. The GridFS index allows efficient retrieval of __________ using the files_id and n values
a) chunks
b) files
c) bson
d) none of the mentioned

View Answer

Answer: a [Reason:] When you query for a large file, GridFS automatically reassembles the smaller files into the original large file.

10. Which of the following query is used to generate a new ObjectId, use the ObjectId() constructor with no argument
a) x = ObjectIdAdd()
b) x = addObjectId()
c) x = ObjectId()
d) none of the mentioned

View Answer

Answer: c [Reason:] ObjectId() constructor is used with no argument for new object.