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. MongoDB supports tagging a range of _______ key values to associate that range with a shard or group of shards.
a) primary
b) secondary
c) shard
d) all of the mentioned

View Answer

Answer: c [Reason:] Those shards receive all inserts within the tagged range.

2. Point out the correct statement :
a) Shard key range tags are distinct from replica set member tags
b) Balancer does not obey tagged range associations
c) Hash-based sharding only supports tag-aware sharding on an entire collection
d) All of the mentioned

View Answer

Answer: c [Reason:] Tag sets let you customize write concern and read preferences for a replica set.

3. The _______ migrates chunks of documents in a sharded collection to the shards associated with a tag.
a) balancer
b) compounder
c) fixer
d) all of the mentioned

View Answer

Answer: a [Reason:] During balancing rounds, if the balancer detects that any chunks violate configured tags, the balancer migrates those chunks to shards associated with those tags.

4. 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.

5. Point out the wrong statement :
a) Read preferences consider the value of a tag when selecting a member to read from
b) Shard ranges are always exclusive of the lower value and inclusive of the upper boundary
c) Write concerns do not use the value of a tag to select a member except to consider whether or not the value is unique
d) None of the mentioned

View Answer

Answer: c [Reason:] Shard ranges are always inclusive of the lower value and exclusive of the upper boundary.

6. By default, an application directs its ______ operations to the primary member in a replica set.
a) read
b) write
c) read and write
d) none of the mentioned

View Answer

Answer: a [Reason:] Read preference describes how MongoDB clients route read operations to the members of a replica set.

7. Which of the following should not be used to provide extra capacity for reads ?
a) primary
b) primaryPreferred
c) secondary
d) none of the mentioned

View Answer

Answer: c [Reason:] Use primaryPreferred if you want an application to read from the primary under normal circumstances.

8. Read preference modes are also available to clients connecting to a sharded cluster through :
a) MMS
b) mongos
c) mongod
d) none of the mentioned

View Answer

Answer: b [Reason:] The mongos instance obeys specified read preferences when connecting to the replica set that provides each shard in the cluster.

9. All read preference modes except _______ may return stale data.
a) primary
b) primaryPreferred
c) secondary
d) none of the mentioned

View Answer

Answer: a [Reason:] Ensure that your application can tolerate stale data if you choose to use a non-primary mode.

10. Which of the following preference does not affect the visibility of data ?
a) read
b) write
c) read and write
d) none of the mentioned

View Answer

Answer: a [Reason:] Regardless of write concern, other clients can see the result of the write operations before the write operation is acknowledged to the issuing client.

MongoDB MCQ Set 2

1. On Linux the ______ manager can create a snapshot.
a) LVM
b) SVM
c) MMS
d) All of the mentioned

View Answer

Answer: a [Reason:] You can create a backup by copying MongoDB’s underlying data files.

2. Point out the correct statement :
a) The mechanics of snapshots depend on the underlying storage system
b) To get a consistent snapshot of a sharded system, you must disable the balancer
c) If your storage system does not support snapshots, you can copy the files directly using cp, rsync, or a similar tool
d) All of the mentioned

View Answer

Answer: d [Reason:] Backups produced by copying the underlying data do not support point in time recovery for replica sets and are difficult to manage for larger sharded clusters.

3. When connected to a MongoDB instance, mongodump can adversely affect ______ performance.
a) mdump
b) mongodump
c) mongod
d) all of the mentioned

View Answer

Answer: c [Reason:] If your data is larger than system memory, the queries will push the working set out of memory.

4. To mitigate the impact of mongodump on the performance of the replica set, use mongodump to capture backups from a _________ member of a replica set.
a) primary
b) secondary
c) snaphot
d) none of the mentioned

View Answer

Answer: b [Reason:] Alternatively, you can shut down a secondary and use mongodump with the data files directly.

5. Point out the wrong statement :
a) If you shut down a secondary to capture data with mongodump ensure that the operation can complete before its oplog becomes too stale to continue replicating
b) MongoDB Cloud Manager continually backs up MongoDB replica sets
c) Sharded cluster snapshots are easy to achieve with other MongoDB backup methods
d) None of the mentioned

View Answer

Answer: c [Reason:] Sharded cluster snapshots are difficult to achieve with other MongoDB backup methods.

6. ________ an on-premise solution, has similar functionality to the cloud version
a) Opscore Manager
b) Ops Manager
c) Mongod
d) None of the mentioned

View Answer

Answer: b [Reason:] This tool is available with Enterprise Advanced subscriptions.

7. Ops Manager provides Ops Manager ________ and Ops Manager Backup, which helps users optimize clusters and mitigate operational risk.
a) Performance
b) Administration
c) Monitoring
d) None of the mentioned

View Answer

Answer: c [Reason:] Ops Manager is a package for managing MongoDB deployments.

8. Ops Manager _________ provides an interface for configuring MongoDB nodes and clusters and for upgrading your MongoDB deployment.
a) Automation
b) Performance
c) Monitoring
d) None of the mentioned

View Answer

Answer: a [Reason:] Ops Manager Monitoring provides real-time reporting, visualization, and alerting on key database and hardware indicators.

9. Ops Manager ______ provides scheduled snapshots and point-in-time recovery of your MongoDB replica sets and sharded clusters.
a) Automation
b) Performance
c) Monitoring
d) Backup

View Answer

Answer: d [Reason:] Backup can also create snapshots of standalones that are run as single-member replica sets.

10. Sharded clusters snapshots temporarily stop the balancer via :
a) Mongod
b) MMS
c) MonitorMMS
d) mongos

View Answer

Answer: d [Reason:] Backup takes and stores snapshots based on a user-defined snapshot retention policy.

MongoDB MCQ Set 3

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) MongoDB uses a locking system to ensure data set consistency
b) If certain operations are long-running or a queue forms, performance will degrade as requests and operations wait for the lock
c) Long queries can result from ineffective use of indexes
d) All of the mentioned

View Answer

Answer: d [Reason:] Lock-related slowdowns can be intermittent.

3. ________ provide the number of times the lock acquisitions encountered deadlocks.
a) locks.deadlock
b) lock.deadlockCount
c) locks.deadlockCount
d) all of the mentioned

View Answer

Answer: c [Reason:] The globalLock data structure contains information regarding the database’s current lock state, historical lock status, current operation queue, and the number of active clients.

4. If __________ is high relative to uptime, the database has existed in a lock state for a significant amount of time.
a) globalLock.halfTime
b) globalLock.totalTime
c) globalLock.downTime
d) all of the mentioned

View Answer

Answer: b [Reason:] The value of totalTime represents the time, in microseconds, since the database last started and creation of the globalLock.

5. Point out the wrong statement :
a) The storage.wiredTiger.indexConfig.prefixCompression setting does not affect all indexes created
b) Database profiling can impact database performance
c) The default storage.wiredTiger.engineConfig.cacheSizeGB setting assumes that there is a single mongod instance per node
d) None of the mentioned

View Answer

Answer: a [Reason:] If you change the value of storage.wiredTiger.indexConfig.prefixCompression on an existing MongoDB deployment, all new indexes will use prefix compression.

6. The __________ data structure value provides more granular information concerning the number of operations queued because of a lock.
a) currentQueue
b) curQueue
c) currentQu
d) none of the mentioned

View Answer

Answer: a [Reason:] The serverStatus command returns a document that provides an overview of the database process’s state

7. serverStatus includes all fields by default, except _________ .
a) rangeDeleter
b) rangeDelete
c) rangeDEL
d) none of the mentioned

View Answer

Answer: b [Reason:] You may only dynamically include top-level fields from the serverStatus document that are not included by default.

8. ______ field contains total number of current clients that connect to the database instance.
a) available
b) current
c) always avail
d) none of the mentioned

View Answer

Answer: b [Reason:] available contains the total number of unused connections available for new clients.

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. Which of the following setting defines what constitutes a “slow” operation ?
a) slowOpThresholdGs
b) fastOpThresholdMs
c) slowOpThresholdMs
d) none of the mentioned

View Answer

Answer: c [Reason:] The operationProfiling.slowOpThresholdMs setting is available only for mongod.

MongoDB MCQ Set 4

1. Comparison expressions return a boolean except for ________ which returns a number.
a) $copy
b) $cmp
c) $num
d) None of the mentioned

View Answer

Answer: b [Reason:] The $cmp compares both value and type, using the specified BSON comparison order for values of different types.

2. Point out the correct statement :
a) The comparison expressions take two argument expressions and compare both value and type, using the specified Java comparison order for values of different types
b) $gte returns true if the first value is greater than the second
c) $gte returns true if the first value is greater than or equal to the second
d) All of the mentioned

View Answer

Answer: c [Reason:] In general, these expressions take an array of arguments and have the following form: { <operator>: [ <argument1>, <argument2> … ] }

3. ______ returns true if the first value is less than the second.
a) $lte
b) $lt
c) $setEquals
d) None of the mentioned

View Answer

Answer: b [Reason:]$lte returns true if the first value is less than or equal to the second.

4. $ne returns true if the values are not _______
a) equivalent
b) null
c) 0
d) none of the mentioned

View Answer

Answer: a [Reason:]$ne compares two values and returns false when the values are equivalent.

5. Point out the wrong statement :
a) Boolean expressions evaluate their argument expressions as booleans and return a boolean as the result
b) Arithmetic expressions perform mathematic operations on numbers
c) Arithmetic expressions does not support date arithmetic
d) None of the mentioned

View Answer

Answer: c [Reason:] Some arithmetic expressions can also support date arithmetic.

6. $multiply __________ numbers to return the result.
a) multiplies
b) divides
c) comapres
d) all of the mentioned

View Answer

Answer: a [Reason:]$multiply accepts any number of argument expressions.

7. _______ adds numbers to return the sum, or adds numbers and a date to return a new date.
a) $addnum
b) $setadd
c) $adds
d) $add

View Answer

Answer: d [Reason:] If adding numbers and a date, treats the numbers as milliseconds.

8. _______ returns the remainder of the first number divided by the second.
a) $rem
b) $mod
c) $div
d) None of the mentioned

View Answer

Answer: b [Reason:]$divide returns the result of dividing the first number by the second.

9. String expressions, with the exception of ________ only have a well-defined behavior for strings of ASCII characters.
a) $setcon
b) $concatenation
c) $concat
d) None of the mentioned

View Answer

Answer: c [Reason:]$concat behavior is well-defined regardless of the characters used.

10. ________ subtracts two dates to return the difference in milliseconds
a) $rem
b) $mod
c) $div
d) $subtract

View Answer

Answer: a [Reason:] The $subtract expression has the following syntax: { $subtract: [ , ] }.

MongoDB MCQ Set 5

1. $dayOfMonth returns the day of the month for a date as a number between :
a) 1 and 31
b) 1 and 30
c) 1 and 28
d) None of the mentioned

View Answer

Answer: a [Reason:] The $dayOfMonth expression has the following syntax: { $dayOfMonth: }.

2. Point out the wrong statement :
a) $second returns the seconds for a date as a number between 0 and 60 (leap seconds)
b) $minute returns the minute for a date as a number between 0 and 59
c) $millis returns the milliseconds of a date as a number between 0 and 1000
d) All of the mentioned

View Answer

Answer: c [Reason:] $millisecond returns the milliseconds of a date as a number between 0 and 999.

3. __________ returns the day of the year for a date as a number between 1 and 366
a) $dayofWeekend
b) $dayOfWeek
c) $dayOfYear
d) None of the mentioned

View Answer

Answer: c [Reason:] The $dayOfYear expression has the following syntax:{ $dayOfYear: }.

4. Which of the following returns year for particular date ?
a) $year
b) $yearday
c) $syearofmonth
d) None of the mentioned

View Answer

Answer: a [Reason:] $year returns the year for a date as a number (e.g. 2014).

5. Point out the wrong statement :
a) $weekDay returns the week number for a date as a number between 0 and 53 (leap year)
b) $cond accepts either two expressions in an ordered list or three named parameters
c) $toLower only has a well-defined behavior for strings of ASCII characters
d) None of the mentioned

View Answer

Answer: [Reason:] $cond is a ternary operator that evaluates one expression, and depending on the result, returns the value of one of the other two expressions.

6. Which of the following returns the hour for a date as a number between 0 and 23 ?
a) $minute
b) $hour
c) $seconds
d) All of the mentioned

View Answer

Answer: b [Reason:] The argument in hour statement can be any expression as long as it resolves to a date.

7. __________ returns the date as a formatted string.
a) $toString
b) $dateToString
c) $letString
d) None of the mentioned

View Answer

Answer: b [Reason:] $dateToString converts a date object to a string according to a user-specified format.

8. _______ result encompasses instances of undefined values or missing fields.
a) Number
b) String
c) Null
d) None of the mentioned

View Answer

Answer: c [Reason:] Null value does not imply zero.

9. ___________ returns either the non-null result of the first expression.
a) $Null
b) $ifNull
c) $ElseNull
d) None of the mentioned

View Answer

Answer: b [Reason:]$ifNull returns the result of the second expression if the first expression results in a null result.

10. __________ take as input a single expression, evaluating the expression once for each input document, and maintain their state for the group of documents.
a) Computer
b) Monitors
c) Accumulators
d) Performoner

View Answer

Answer: c [Reason:] Accumulators are available only for the $group stage.