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. Split empty chunks in your collection by manually performing the ______ command on chunks.
a) distrbute
b) split
c) change
d) all of the mentioned

View Answer

Answer: b [Reason:] The config database is internal: applications and administrators should not modify or depend upon its content in the course of normal operation.

2. Point out the correct statement:
a) Pre-splitting the chunk ranges in an empty sharded collection allows clients to insert data into an already partitioned collection
b) MongoDB cannot create enough chunks or distribute data fast enough to support required throughput
c) Chunk migration does not require copying all the data in the chunk from one shard to another
d) All of the mentioned

View Answer

Answer: a [Reason:] In most situations a sharded cluster will create and distribute chunks automatically without user intervention.

3. MongoDB provides the _________ command to combine contiguous chunk ranges into a single chunk.
a) helpchunks
b) moveChunks
c) mergeChunks
d) all of the mentioned

View Answer

Answer: c [Reason:] For a sharded collection, mergeChunks combines contiguous chunk ranges on a shard into a single chunk. Issue the mergeChunks command from a mongos instance.

4. Use ________ to determine the current chunk ranges across the cluster.
a) sh.collects()
b) sh.status()
c) sh.results()
d) all of the mentioned

View Answer

Answer: b [Reason:] To access the config database, connect to a mongos instance in a sharded cluster, and use the following helper: use config

5. Point out the wrong statement :
a) If a collection already has data, MongoDB automatically splits the collection’s data when you enable sharding for the collection
b) Subsequent attempts to manually create splits can lead to unpredictable chunk ranges and sizes as well as inefficient or ineffective balancing behavior
c) MongoDB creates splits only after an insert operation
d) None of the mentioned

View Answer

Answer: d [Reason:] The default behavior suppresses the detailed chunk information if the total number of chunks is greater than or equal to 20.

6. __________ splits the chunk that contains the shard key value specified by the query at the chunk’s median point.
a) sh.Find()
b) sh.splitFind()
c) sh.split()
d) all of the mentioned

View Answer

Answer: b [Reason:] sh.splitFind() creates two roughly equal chunks.

7. _________ splits a chunk at the shard key value specified by the query.
a) sh.Find()
b) sh.splitFind()
c) sh.split()
d) sh.splitAt

View Answer

Answer: d [Reason:] In most circumstances, you should leave chunk splitting to the automated processes within MongoDB.

8. sh.splitFind () Splits the chunk that contains the shard key value specified by the query at the chunk’s ______ point.
a) smean
b) stdev
c) median
d) all of the mentioned

View Answer

Answer: c [Reason:] It may be beneficial to pre-split manually an empty collection using methods such as sh.splitFind().

9. The mergeChunks command requires at least _______ empty input chunk.
a) one
b) two
c) three
d) all of the mentioned

View Answer

Answer: a [Reason:] MergeChunks merge two contiguous chunks on the same shard, where at least one of the contains no data.

10. The chunkSize and ________ options, passed at startup to the mongos, do not affect the chunk size after you have initialized the cluster.
a) –Size
b) –chunkSize
c) –chunk
d) None of the mentioned

View Answer

Answer: b [Reason:] Modifying the chunk size has several limitations.

MongoDB MCQ Set 2

1. A sharded cluster can contain __________ query router to divide the client request load.
a) 1
b) 0
c) more than 1
d) all of the mentioned

View Answer

Answer: c [Reason:] A client sends requests to one query router. Most sharded clusters have many query routers.

2. Point out the correct statement:
a) MongoDB distributes data, or shards, at the collection level
b) To shard a document, you need to select a shard key
c) MongoDB divides the shard key values into replica sets
d) All of the mentioned

View Answer

Answer: a [Reason:] Sharding partitions a collection’s data by the shard key.

3. ________ servers store the cluster’s metadata.
a) Local
b) Config
c) Master
d) All of the mentioned

View Answer

Answer: a [Reason:] This data contains a mapping of the cluster’s data set to the shards.

4. The query router uses __________ to target operations to specific shards.
a) metadata
b) cluster
c) replica
d) all of the mentioned

View Answer

Answer: a [Reason:] For development and testing purposes only, each shard can be a single mongod instead of a replica set.

5. Point out the wrong statement :
a) For hash-based sharding, MongoDB divides the data set into ranges determined by the shard key values to provide hash based partitioning
b) Cloud-based providers may only allow users to provision smaller instances
c) For hash based partitioning, MongoDB computes a hash of a field’s value, and then uses these hashes to create chunks
d) All of the mentioned

View Answer

Answer: a [Reason:] For range-based sharding, MongoDB divides the data set into ranges determined by the shard key values to provide range based partitioning.

6. Production sharded clusters have exactly ______ config servers.
a) 1
b) 2
c) 3
d) 4

View Answer

Answer: c [Reason:] Do not deploy production clusters without 3 config servers.

7. A _________ key is either an indexed field or an indexed compound field that exists in every document in the collection.
a) cluster
b) shard
c) partition
d) all of the mentioned

View Answer

Answer: b [Reason:] Sharding partitions a collection’s data by the shard key.

8. To divide the shard key values into chunks, MongoDB uses _____ based partitioning.
a) range
b) b tree
c) document
d) isMaster

View Answer

Answer: a [Reason:] Hash based partitioning can also be used.

9. With hash based partitioning, two documents with _____ shard key values are unlikely to be part of the same chunk.
a) close
b) open
c) partially close
d) all of the mentioned

View Answer

Answer: a [Reason:] This ensures a more random distribution of a collection in the cluster.

10. _______ based partitioning, by contrast, ensures an even distribution of data at the expense of efficient range queries.
a) Hash
b) Range
c) Table
d) None of the mentioned

View Answer

Answer: b [Reason:] Hashed key values results in random distribution of data across chunks and therefore shards.

MongoDB MCQ Set 3

1. MongoDB uses _________ to support deployments with very large data sets and high throughput operations.
a) sharding
b) replication
c) replica sets
d) all of the mentioned

View Answer

Answer: a [Reason:] Sharding is a method for storing data across multiple machines.

2. Point out the correct statement:
a) High query rates can exhaust the CPU capacity of the server
b) Database systems with small data sets and high throughput applications can challenge the capacity of a single server
c) Smaller data sets exceed the storage capacity of a single machine
d) All of the mentioned

View Answer

Answer: a [Reason:] Working set sizes larger than the system’s RAM stress the I/O capacity of disk drives.

3. How many types of sharding exist in MongoDB ?
a) 1
b) 2
c) 3
d) All of the mentioned

View Answer

Answer: b [Reason:] MongoDB have two basic approaches: vertical scaling and sharding.

4. _______ scaling adds more CPU and storage resources to increase capacity.
a) Horizontal
b) Vertical
c) Partition
d) All of the mentioned

View Answer

Answer: b [Reason:] When the primary steps down, the mongod closes all client connections.

5. Point out the wrong statement :
a) Scaling by adding capacity do not have limitations.
b) cloud-based providers may only allow users to provision smaller instances
c) There is a practical maximum capability for vertical scaling
d) All of the mentioned

View Answer

Answer: a [Reason:] High performance systems with large numbers of CPUs and large amount of RAM are disproportionately more expensive than smaller systems

6. _______ divides the data set and distributes the data over multiple servers, or shards.
a) Vertical
b) Sharding
c) Partition
d) All of the mentioned

View Answer

Answer: b [Reason:] Each shard is an independent database, and collectively, the shards make up a single logical database.

7. MongoDB supports sharding through the configuration of a sharded ______
a) shapes
b) clusters
c) sets
d) all of the mentioned

View Answer

Answer: b [Reason:] Sharding reduces the number of operations each shard handles.

8. How many components are present in sharded cluster ?
a) 1
b) 2
c) 3
d) 4

View Answer

Answer: b [Reason:] Sharded cluster has the following components: shards, query routers and config servers.

9. To provide high availability and data consistency, in a production sharded cluster, each shard is a :
a) replica set
b) cluster
c) partition
d) all of the mentioned

View Answer

Answer: a [Reason:] Each shard stores less data as the cluster grows.

10. _________ interface with client applications and direct operations to the appropriate shard or shards.
a) Query Parsers
b) Query Routers
c) Query Executors
d) None of the mentioned

View Answer

Answer: b [Reason:] The query router processes and targets operations to shards and then returns results to the clients.

MongoDB MCQ Set 4

1. The _________ process is responsible for redistributing the chunks of a sharded collection evenly among the shards for every sharded collection.
a) Balancer
b) Sharder
c) Replicator
d) All of the mentioned

View Answer

Answer: a [Reason:] By default, the balancer process is always enabled.

2. Point out the correct statement:
a) Splitting is the process MongoDB uses to distribute data of a sharded collection evenly across a sharded cluster
b) Any mongos instance in the cluster can start a balancing round
c) When a shard has too many of a sharded collection’s chunks compared to other shards, MongoDB splits balances the chunks across the shards
d) All of the mentioned

View Answer

Answer: b [Reason:] When a balancer process is active, the responsible mongos acquires a “lock” by modifying a document in the lock collection in the Config Database.

3. Use _______ migration to distribute data during bulk inserts.
a) automatic
b) manual
c) temporary
d) all of the mentioned

View Answer

Answer: b [Reason:] Shard keys are immutable and cannot be changed after insertion.

4. The balancer process sends the _______ command to the source shard.
a) moveChunkShard
b) migChunk
c) moveChunk
d) all of the mentioned

View Answer

Answer: c [Reason:] The source starts the move with an internal moveChunk command.

5. Point out the wrong statement :
a) When fully synchronized, the destination shard connects to the config database and updates the cluster metadata with the new location for the chunk
b) The destination shard builds any indexes required by the source that do not exist on the destination
c) The destination shard begins requesting documents in the chunk and starts receiving copies of the data
d) None of the mentioned

View Answer

Answer: d [Reason:] After the destination shard completes the update of the metadata, and once there are no open cursors on the chunk, the source shard deletes its copy of the documents.

6. The source shard is responsible for incoming ______ operations for the chunk.
a) read
b) write
c) read-write
d) all of the mentioned

View Answer

Answer: b [Reason:] During the migration process, operations to the chunk route to the source shard.

7. ________ can alter the behavior so that the delete phase of the current migration blocks the start of the next chunk migration.
a) _waitForUpdate
b) _waitForDelete
c) _waitForInsert
d) All of the mentioned

View Answer

Answer: b [Reason:] The _waitForDelete is generally for internal testing purposes.

8. The default value _________ becomes true for all chunk migrations.
a) secThrottle
b) secondaryThrottle
c) primaryThrottle
d) all of the mentioned

View Answer

Answer: b [Reason:] The new writeConcern field in the balancer configuration document allows you to specify a write concern semantics the _secondaryThrottle option.

9. You can set the _________ option on the balancer configuration to set different write concern semantics.
a) writeConcern
b) updateConcern
c) readConcern
d) all of the mentioned

View Answer

Answer: a [Reason:] By default, each document operation during chunk migration propagates to at least one secondary before the balancer proceeds with the next document

10. With __________ enabled, the source shard archives the documents in the migrated chunks in a directory named after the collection namespace.
a) sharding.archiveChunks
b) sharding.archiveMovedChunks
c) shard.archiveMovedChunks
d) none of the mentioned

View Answer

Answer: b [Reason:] Starting in MongoDB 2.6, sharding.archiveMovedChunks is enabled by default.

MongoDB MCQ Set 5

1. __________ references the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage.
a) CURRENT
b) ROOT
c) PRUNE
d) All of the mentioned

View Answer

Answer: b [Reason:] CURRENT is modifiable.

2. Point out the wrong statement :
a) Variables can hold any BSON type data
b) Aggregation expressions can use both user-defined and system variables
c) To access the value of the variable, use a string with the variable name prefixed with double dollar signs ($$)
d) None of the mentioned

View Answer

Answer: d [Reason:] If the variable references an object, to access a specific field in the object, use the dot notation; i.e. “$$.“.

3. Which of the operator is similar to order by clause in RDBMS ?
a) $sort
b) $match
c) $sortby
d) None of the mentioned

View Answer

Answer: a [Reason:] In the mongo shell, when you assign the cursor returned from the find() method to a variable using the var keyword, the cursor does not automatically iterate.

4. Which of the following provides similar functionality to join ?
a) $unwindelem
b) $unwind
c) $unwin
d) None of the mentioned

View Answer

Answer: c [Reason:] $unwind operator allows for somewhat similar functionality like join, but with fields embedded within the document.

5. Point out the wrong statement :
a) CURRENT references the start of the field path being processed in the aggregation pipeline stage
b) All stages start with CURRENT the same as ROOT
c) DESCENDING is one of the allowed results of a $let expression
d) None of the mentioned

View Answer

Answer: c [Reason:] However, since $<field> is equivalent to $$CURRENT., rebinding CURRENT changes the meaning of $ accesses.

6. ________ limits the number of documents in result set
a) $project
b) $geo
c) $limit
d) None of the mentioned

View Answer

Answer: c [Reason:] $limit takes a positive integer that specifies the maximum number of documents to pass along.

7. Which of the following is used to retrieve like SELECT clause in SQL?
a) $reduce
b) $select
c) $project
d) None of the mentioned

View Answer

Answer: c [Reason:] The $project takes a document that can specify the inclusion of fields, the suppression of the _id field, the addition of new fields, and the resetting the values of existing fields.

8. _______ groups documents by some specified expression and outputs to the next stage a document for each distinct grouping.
a) $setcon
b) $group
c) $match
d) None of the mentioned

View Answer

Answer: b [Reason:] $group works similar to group by clause in SQL.

9. ____________ works similar to HAVING clause in SQL
a) $setcon
b) $group
c) $match
d) None of the mentioned

View Answer

Answer: c [Reason:] Place the $match as early in the aggregation pipeline as possible..

10. COUNT function is provided by _________ in MongoDB.
a) $end
b) $sum
c) $max
d) All of the mentioned

View Answer

Answer: b [Reason:] $sum ignores non-numeric values just like SQL.