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. What is the interactive shell for MongoDB called ?
a) mongo
b) mongodb
c) dbmong
d) none of the mentioned

View Answer

Answer: a [Reason:] Interactive shell lets developers view, insert, remove, and update data in their databases, as well as get replication information, set up sharding, shut down servers, execute JavaScript, and more.

2. Point out the correct statement :
a) Humon.io is a Web based GUI for MongoDB
b) Mongo3 is a java-based GUI
c) NoSQL Manager for MongoDB is a MS Windows GUI application for MongoDB management with Shell
d) All of the mentioned

View Answer

Answer: c [Reason:] NoSQL Manager for MongoDB is similar to MMS.

3. Administrative information in MongoDB can also be accessed through :
a) dashboard
b) web interface
c) psql shell
d) all of the mentioned

View Answer

Answer: b [Reason:] Web interface is a simple webpage that serves information about the current server status. By default, this interface is 1000 ports above the database port (28017).

4. Which of the following is web-based client software for MongoDB ?
a) BI Studio
b) Database Master
c) Fang of Mongo
d) Mongo3

View Answer

Answer: b [Reason:] Futon4Mongo is a clone of the CouchDB-Futon-Web-Interface for MongoDB.

5. Point out the wrong statement :
a) MongoHub is a native OS-X-application for MongoDB management
b) Cassandra is most popular for its document stores management system
c) MongoDB is the fourth most popular type of database management system
d) All of the mentioned

View Answer

Answer: b [Reason:] MongoDB is most popular for document stores.

6. ___________ provides statistics on the per-collection level.
a) mongosniff
b) mongotop
c) mongooplog
d) mongofiles

View Answer

Answer: b [Reason:] mongotop is a command-line tool providing a method to track the amount of time a MongoDB instance spends reading and writing data.

7. ___________ is a command-line tool that displays a summary list of status statistics for a currently running MongoDB instance.
a) mongostat
b) mongotop
c) mongooplog
d) mongofiles

View Answer

Answer: a [Reason:] It describes how many inserts, updates, removes, queries, and commands were performed, as well as what percentage of the time the database was locked and how much memory it is using.

8. mongostat tool is similar to the UNIX/Linux _________ utility.
a) stats
b) vim
c) vmstat
d) all of the mentioned

View Answer

Answer: c [Reason:] vmstat is a computer system monitoring tool that collects and displays summary information about operating system memory, processes, interrupts, paging and block I/O.

9. Which of the following tool is similar to the UNIX/Linux top utility ?
a) mongosniff
b) mongotop
c) mongooplog
d) mongofiles

View Answer

Answer: b [Reason:] By default, mongotop returns values every second.

10. mongosniff requires the ___________ network library and is only available for Unix-like systems.
a) Wirecap
b) Libpcap
c) Wcap
d) None of the mentioned

View Answer

Answer: b [Reason:] A cross-platform alternative is the open source Wireshark packet analyzer which has full support for the MongoDB wire protocol.

MongoDB MCQ Set 2

1. _______________ is a specification for storing and retrieving files that exceed the BSON-document size limit of 16MB.
a) DataFS
b) GridFS
c) ReadFS
d) None of the mentioned

View Answer

Answer: b [Reason:] Instead of storing a file in a single document, GridFS divides a file into parts, or chunks

2. Point out the wrong statement :
a) By default GridFS limits chunk size to 255k
b) GridFS is useful only for storing files that exceed 16MB
c) When you query a GridFS store for a file, the driver or client will reassemble the chunks as needed
d) All of the mentioned

View Answer

Answer: b [Reason:] GridFS is useful not only for storing files that exceed 16MB but also for storing any files for which you want access without having to load the entire file into memory.

3. How many does collections GridFS use to store files ?
a) 1
b) 2
c) 3
d) 4

View Answer

Answer: b [Reason:] One collection stores the file chunks, and the other stores file metadata.

4. The default chunk size is changed from 256k to 255k in version :
a) 3.0
b) 2.4.9
c) 2.4.10
d) None of the mentioned

View Answer

Answer: b [Reason:] The use of the term chunks in the context of GridFS is not related to the use of the term chunks in the context of sharding.

5. Point out the wrong statement :
a) Client libraries provide a convenient, injection free, process to build these objects
b) MongoDB represents queries as BSON objects
c) Field names in MongoDB’s query language have semantic meaning
d) All of the mentioend

View Answer

Answer: d [Reason:] If you need to use db.eval() with user supplied values, you can either use a CodeWScope or you can supply extra arguments to your function.

6. Which of the collection in GridFS stores the binary chunks ?
a) chunks
b) files
c) data
d) log

View Answer

Answer: a [Reason:] GridFS places the collections in a common bucket by prefixing each with the bucket name.

7. ___________ is the _id is of the data type chosen for the original document in files collections.
a) files._id
b) file._id
c) fileobj._id
d) none of the mentioned

View Answer

Answer: a [Reason:] The default type for MongoDB documents is BSON ObjectId.

8. Which of the following checks and repairs errors and inconsistencies in data storage ?
a) repairDatabase
b) repairedDatabase
c) recoverDatabase
d) all of the mentioned

View Answer

Answer: a [Reason:] repairDatabase is analogous to a fsck command for file systems.

9. The files_id field contains the _id of the chunk’s __________ document.
a) parent
b) child
c) top
d) none of the mentioned

View Answer

Answer: a [Reason:] GridFS uses a unique, compound index on the chunks collection for the files_id and n fields.

10. Which of the following field allows efficient retrieval of chunks ?
a) n
b) name
c) object
d) 2n

View Answer

Answer: a [Reason:] The GridFS index allows efficient retrieval of chunks using the files_id and n values.

MongoDB MCQ Set 3

1. Which of the following flag can be set by mongo shell ?
a) Timeout
b) noTimeout
c) Time
d) None of the mentioned

View Answer

Answer: b [Reason:] By default, the server will automatically close the cursor after 10 minutes of inactivity or if client has exhausted the cursor.

2. Point out the correct statement :
a) Intervening read operations on a document may result in a cursor that returns a document more than once if that document has changed
b) The MongoDB server returns the query results in batches
c) Subsequent batch size is 50 megabytes
d) None of the mentioned

View Answer

Answer: b [Reason:] For most queries, the first batch returns 101 documents or just enough documents to exceed 1 megabyte.

3. Which of the following will display complete list of available cursor flags ?
a) cursor.Option()
b) cursor.addOption()
c) cursor.addOptions()
d) all of the mentioned

View Answer

Answer: b [Reason:] You should either close the cursor manually or exhaust the cursor.

4. To describe the message structure, a ________ like struct is used.
a) Pascal
b) C++
c) C
d) Java

View Answer

Answer: c [Reason:] The standard message header is typed as MsgHeader. Integer constants are in capitals (e.g. ZERO for the integer value of 0).

5. Point out the wrong statement :
a) The MongoDB Wire Protocol is a simple socket-based, request-response style protocol
b) For queries that include a sort operation without an index, the server must load all the documents in memory to perform the sort before returning any results
c) Clients communicate with the database server through a regular TCP/IP socket
d) All of the mentioned

View Answer

Answer: d [Reason:] As you iterate through the cursor and reach the end of the returned batch, if there are more results, cursor.next() will perform a getmore operation to retrieve the next batch.

6. ______________ specifies the number of documents to return in each batch of the response from the MongoDB instance.
a) cursor.batchSize(size)
b) cursor.Size(size)
c) cursor.batch(size)
d) all of the mentioned

View Answer

Answer: a [Reason:] Specifying 1 or a negative number is analogous to using the limit() method.

7. The __________ method returns a document that includes a metrics field.
a) db.serverStats()
b) db.serverStatus()
c) db.status()
d) all of the mentioned

View Answer

Answer: b [Reason:] The metrics field contains a cursor with number of timed out cursors since the last server restart.

8. ____________ is a client or database-generated identifier that uniquely identifies this message.
a) messageLength
b) responseTo
c) requestID
d) all of the mentioned

View Answer

Answer: c [Reason:] For the case of client-generated messages, it will be returned in the responseTo field of the OP_REPLY message.

9. Which of the following operator is not very selective ?
a) $nine
b) $nin
c) $ain
d) None of the mentioned

View Answer

Answer: b [Reason:] The inequality operators $nin and $ne are not very selective since they often match a large portion of the index.

10. An index cannot cover a query on a _______ collection when run against a mongos if the index does not contain the shard key.
a) vertical
b) sharded
c) horizontal
d) none of the mentioned

View Answer

Answer: b [Reason:] MongoDB can both match the query conditions and return the results using only the index.

MongoDB MCQ Set 4

1. The architecture of a replica set affects the set’s _________ and capability.
a) scalability
b) capacity
c) performance
d) all of the mentioned

View Answer

Answer: b [Reason:] Replica sets provide redundancy and fault tolerance.

2. Point out the wrong statement :
a) Even number of members ensures that the replica set is always able to elect a primary
b) Arbiters do not store a copy of the data and require fewer resources
c) You may run an arbiter on an application server or other shared process
d) None of the mentioned

View Answer

Answer: a [Reason:] If you have an even number of members, add an arbiter to get an odd number.

3. The standard replica set deployment for production system is a ___-member replica set.
a) two
b) three
c) four
d) five

View Answer

Answer: b [Reason:] Avoid complexity when possible, but let your application requirements dictate the architecture.

4. _________ for a replica set is the number of members that can become unavailable and still leave enough members in the set to elect a primary.
a) Fault tolerance
b) Reliability
c) Security
d) None of the mentioned

View Answer

Answer: a [Reason:] In other words, it is the difference between the number of members in the set and the majority needed to elect a primary.

5. Point out the correct statement :
a) Removing a member to the replica set does not always increase the fault tolerance
b) The secondary is the only member in the replica set that receives write operations
c) Fault tolerance is an effect of replica set size, but the relationship is not direct
d) None of the mentioned

View Answer

Answer: c [Reason:] Additional members can provide support for dedicated functions, such as backups or reporting.

6. Without a primary, a replica set cannot accept ________ operations.
a) read
b) write
c) read write
d) all of the mentioned

View Answer

Answer: b [Reason:] Arbiters do not keep a copy of the data.

7. _________ member is used to support dedicated functions, such as backup or reporting.
a) Hidden
b) Primary
c) ViewState
d) None of the mentioned

View Answer

Answer: a [Reason:] Delayed members can also support dedicated functions.

8. To protect your data if your main data center fails, keep at least _______ member in an alternate data center.
a) one
b) two
c) three
d) none of the mentioned

View Answer

Answer: a [Reason:] Always add new members before the current demand saturates the capacity of the set.

9. What should be the priority of member to prevent them from becoming primary ?
a) 0
b) 1
c) 2
d) 3

View Answer

Answer: a [Reason:] Always ensure that the main facility is able to elect a primary.

10. _________ sets also allow the routing of read operations to specific machines.
a) Field
b) Read
c) Tag
d) All of the mentioned

View Answer

Answer: c [Reason:] Use replica set tag sets to ensure that operations replicate to specific data centers.

MongoDB MCQ Set 5

1. If you create the user administrator before enabling access control, MongoDB disables the ________ exception.
a) localhost
b) server
c) runtime
d) none of the mentioned

View Answer

Answer: a [Reason:] The localhost exception allows you to enable authorization before creating the first user in the system.

2. Point out the correct statement :
a) After you create the user administrator, the localhost exception is no longer available
b) Enabling access control on a MongoDB instance restricts access to the instance by requiring that users identify themselves when connecting
c) The mongo shell executes a number of commands at start up
d) All of the mentioned

View Answer

Answer: d [Reason:] As a result, when you log in as the user administrator, you may see authentication errors from one or more commands.

3. If you use the localhost exception when deploying a new MongoDB system, the first user you create must be in the ________ database.
a) head
b) local
c) admin
d) all of the mentioned

View Answer

Answer: c [Reason:] In the case of a sharded cluster, the localhost exception applies to each shard individually as well as to the cluster as a whole.

4. If you need to disable access control for any reason, restart the process with ______ setting.
a) KeyFile
b) Authentication
c) Authorization
d) All of the mentioned

View Answer

Answer: a [Reason:] Login in with the user administrator’s credentials and create additional users.

5. Point out the wrong statement :
a) Authentication does not require an authentication mechanism
b) To enable authentication on a sharded cluster, you must enable authentication individually on each component of the cluster
c) The content of the key file must be the same on all cluster members
d) All of the mentioned

View Answer

Answer: a [Reason:] Authentication requires an authentication mechanism and, in most cases, a key file.

6. The ________ client authentication allows clients to authenticate to servers with certificates rather than with a username and password.
a) x.209
b) x.509
c) x.709
d) None of the mentioned

View Answer

Answer: b [Reason:] MongoDB supports x.509 certificate authentication for use with a secure TLS/SSL connection.

7. Which of the following allows user to view the information of any user in the given database?
a) createUser
b) viewUser
c) killCursors
d) all of the mentioned

View Answer

Answer: b [Reason:] To provide user administrators, MongoDB has userAdmin and userAdminAnyDatabase roles.

8. enableLocalhostAuthBypass is not available using _________ database command.
a) setParameter
b) enableParameter
c) removeParameter
d) none of the mentioned

View Answer

Answer: a [Reason:] Use the setParameter option in the configuration file or the –setParameter option on the command line.

9. MongoDB’s _______ is a database profiling system that can help identify inefficient queries and operations.
a) Reporter
b) Executer
c) Profiler
d) None of the mentioned

View Answer

Answer: c [Reason:] Enable the profiler by setting the profile value using the following command in the mongo shell.

10. ______________ enables a set of internal commands useful for internal testing operations.
a) enableTestAll
b) enableTest
c) enableTestCommands
d) all of the mentioned

View Answer

Answer: c [Reason:] enableTestCommands is only available when starting mongod and you cannot use setParameter to modify this parameter.