MongoDB C100DBA Practice Test Questions and Exam Dumps Part7 Q121-140

View Full MongoDB C100DBA Exam Dumps and Practice Test Dumps

 

Question 121

Which MongoDB setting controls the number of milliseconds between replica heartbeats?

  1. electionTimeoutMillis
  2. heartbeatTimeoutSecs
  3. replicationInterval
  4. heartbeatIntervalMillis

Correct Answer: 4

Explanation:

heartbeatIntervalMillis controls how frequently replica set members send heartbeats to one another. These heartbeats allow members to monitor the availability and state of other members. Regular heartbeat communication is essential for detecting failures and maintaining accurate replica set topology information. It works together with election-related settings that determine when a member should consider another member unavailable and potentially begin an election. DBAs should understand that changing heartbeat-related settings can affect failure detection behavior. Network reliability, latency, and deployment topology should all be considered before modifying replica-set timing parameters.

Question 122

Which MongoDB authentication method uses username and password credentials with SCRAM?

  1. X.509
  2. SCRAM
  3. Kerberos
  4. LDAP certificate

Correct Answer: 2

Explanation:

SCRAM, or Salted Challenge Response Authentication Mechanism, is a password-based authentication mechanism supported by MongoDB. It allows clients to authenticate using database usernames and passwords without sending the password directly across the network as plaintext. MongoDB supports SCRAM mechanisms such as SCRAM-SHA-256 and SCRAM-SHA-1, depending on deployment configuration and version. TLS should still be used to protect network traffic. DBAs must also ensure that users have appropriate roles and that password policies, credential management, and authentication configuration align with organizational security requirements.

Question 123

Which MongoDB command shows the current server feature compatibility setting?

  1. db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
  2. db.versionCompatibility()
  3. db.serverVersionMode()
  4. db.compatibilityStatus()

Correct Answer: 1

Explanation:

The getParameter administrative command can be used to inspect the current featureCompatibilityVersion setting. This setting determines which MongoDB feature behavior is enabled for the deployment and is especially important during version upgrades. Administrators commonly verify the feature compatibility state before and after upgrade procedures to ensure that the deployment is operating with the intended feature set. The installed MongoDB binary version and feature compatibility version are related but not identical concepts. DBAs should follow the upgrade documentation for the specific MongoDB release and avoid changing compatibility settings without understanding upgrade and downgrade implications.

Question 124

Which option makes a replica member invisible to normal driver discovery?

  1. priority: 0
  2. hidden: true
  3. votes: 0
  4. secondaryOnly: true

Correct Answer: 2

Explanation:

A replica set member configured with hidden: true is excluded from normal client discovery. The member continues maintaining replicated data but is not normally selected by drivers for application operations. Hidden members can be useful for dedicated administrative workloads, reporting, or backup processes. Hiding a member does not stop replication and does not automatically prevent it from participating in all replica-set functions. Administrators should combine hidden status with suitable priority and voting settings when designing specialized members. The purpose is to separate a member from normal client routing while preserving its role within the replica set.

Question 125

Which MongoDB command can modify a replica set configuration document?

  1. rs.changeConfig()
  2. rs.updateMembers()
  3. rs.reconfig()
  4. rs.modifySet()

Correct Answer: 3

Explanation:

rs.reconfig() is used to apply a new replica set configuration. Administrators can use it to add or remove members and modify settings such as priorities, votes, hidden status, and other supported member properties. Replica-set reconfiguration is a sensitive administrative operation because an incorrect configuration can affect elections and availability. DBAs should first inspect the existing configuration and verify member health before applying changes. In production environments, configuration changes should be performed according to MongoDB’s supported procedures, with careful attention to quorum, voting members, and the current primary.

Question 126

Which MongoDB storage option specifies the WiredTiger cache size?

  1. storage.wiredTiger.engineConfig.cacheSizeGB
  2. storage.cache.limitGB
  3. wiredTiger.memorySizeGB
  4. engine.cacheCapacity

Correct Answer: 1

Explanation:

The storage.wiredTiger.engineConfig.cacheSizeGB setting controls the configured size of the WiredTiger internal cache. MongoDB also calculates a default cache size based on available system memory and deployment characteristics, so administrators should not change this value without a specific reason. An excessively large cache allocation can reduce memory available for the operating system and other processes, while an unnecessarily small cache can increase storage reads and cache eviction activity. DBAs should evaluate workload characteristics, operating-system memory, container limits, and MongoDB version behavior before adjusting cache configuration.

Question 127

Which command can return statistics specifically for a collection’s indexes?

  1. db.indexSummary()
  2. db.collection.aggregate([{ $indexStats: {} }])
  3. db.collection.listIndexUsage()
  4. db.collection.indexReport()

Correct Answer: 2

Explanation:

The $indexStats aggregation stage provides usage information for indexes associated with a collection. Administrators can use it to investigate whether indexes are actually being accessed by queries. This information can be valuable during index cleanup because indexes consume storage and increase maintenance work for writes. However, low usage does not automatically mean an index is unnecessary. Some indexes support infrequent but important operations. DBAs should collect usage information over a representative period and compare it with application requirements, query plans, and workload schedules before deciding whether an index should be removed.

Question 128

Which sharding strategy is generally suited to range-based queries?

  1. Hashed distribution
  2. Random distribution
  3. Ranged sharding
  4. Round-robin placement

Correct Answer: 3

Explanation:

Ranged sharding distributes documents according to ranges of shard-key values. This approach can be effective when applications frequently issue range queries because MongoDB can target relevant shard ranges rather than necessarily contacting every shard. The shard key must still be selected carefully because monotonically increasing values can create uneven write distribution in some workloads. Administrators should evaluate cardinality, query patterns, data distribution, and write behavior before selecting a range-based strategy. A shard key that works well for one workload may perform poorly for another, so testing against realistic application traffic is important.

Question 129

Which command provides the current database profiler configuration?

  1. db.getProfilingStatus()
  2. db.profilerConfig()
  3. db.getProfilerStatus()
  4. db.profileStatus()

Correct Answer: 1

Explanation:

db.getProfilingStatus() reports the current database profiling configuration. MongoDB’s database profiler can collect information about operations according to configured profiling levels and thresholds. Administrators can use the status information to verify whether profiling is disabled, collecting slow operations, or recording more broadly. Profiling can provide valuable diagnostic information but may add overhead, particularly at aggressive settings. DBAs should therefore configure it deliberately and monitor the resulting data volume. Profiling information can be combined with query analysis to identify inefficient operations and determine where indexing or application changes may be beneficial.

Question 130

Which MongoDB command can inspect active client connections through server metrics?

  1. db.connectionList()
  2. db.serverStatus()
  3. db.clients()
  4. db.networkUsers()

Correct Answer: 2

Explanation:

db.serverStatus() includes connection-related metrics that allow administrators to monitor the number and behavior of client connections. These metrics can help identify unusual connection growth, application connection-pool problems, or resource pressure. A high connection count does not automatically indicate a fault because expected levels depend on application architecture and workload. DBAs should examine current, available, and historical connection patterns together with operating-system resources. Connection monitoring is particularly important in environments where many application instances independently maintain connection pools to the same MongoDB deployment.

Question 131

Which aggregation stage can replace or merge output into a target collection?

  1. $sort
  2. $replaceWith
  3. $merge
  4. $project

Correct Answer: 3

Explanation:

The $merge stage allows aggregation results to be written into a target collection. It can support different behaviors when a generated document corresponds to an existing document, making it useful for maintaining derived datasets and materialized results. The destination collection can be the same as or different from the source collection depending on supported pipeline requirements. Administrators should evaluate indexing, write volume, concurrency, and matching behavior when using $merge. Because the operation performs writes, it should also be monitored for resource consumption when processing large aggregation workloads.

Question 132

Which MongoDB feature maintains a history of selected database operations for diagnostics?

  1. Query profiler
  2. Replica heartbeat
  3. Storage journal
  4. Cluster balancer

Correct Answer: 1

Explanation:

The MongoDB database profiler records information about database operations according to the configured profiling level and thresholds. It is primarily a diagnostic feature that helps administrators investigate slow or otherwise relevant operations. Profiler records can reveal query patterns, execution durations, namespaces, and other useful details. Because collecting detailed operation information can introduce overhead and generate significant data, DBAs should configure profiling carefully. It is particularly useful when combined with explain plans and application monitoring. Profiling should normally support a specific troubleshooting or performance-analysis objective rather than being enabled indiscriminately at maximum detail.

Question 133

Which MongoDB command reports the server’s startup arguments and parsed options?

  1. db.serverOptions()
  2. db.startupInfo()
  3. db.serverCmdLineOpts()
  4. db.runtimeArguments()

Correct Answer: 3

Explanation:

db.serverCmdLineOpts() returns information about the command-line arguments and parsed configuration options used by the MongoDB server. This makes it useful when administrators need to verify the effective startup configuration. It can help identify unexpected values related to networking, storage, security, replication, or logging. The command is particularly valuable when the configuration file and operational behavior appear inconsistent. DBAs should distinguish startup configuration information from runtime performance metrics, which are provided by commands such as serverStatus(). Reviewing effective options is often an important step in configuration troubleshooting.

Question 134

Which sharding component performs chunk balancing across eligible shards?

  1. Config server
  2. Balancer
  3. mongos
  4. Query planner

Correct Answer: 2

Explanation:

The sharded-cluster balancer manages the distribution of chunks among eligible shards to maintain balanced data placement. When data becomes unevenly distributed, balancing activity can initiate chunk migrations between shards. Balancing must consider shard-key ranges, zones, and other cluster constraints. Administrators should monitor balancing activity because migrations consume network, disk, and other resources. Excessive imbalance can affect storage utilization and workload distribution, while unnecessary migrations can create operational overhead. Proper shard-key selection and sufficient shard capacity are therefore important for maintaining a healthy sharded environment.

Question 135

Which setting identifies the replica set name used by a MongoDB server?

  1. replicaSet
  2. setName
  3. clusterName
  4. replName

Correct Answer: 1

Explanation:

The replicaSet configuration option specifies the name of the replica set for a MongoDB server configured as part of a replica-set deployment. The same replica set name is used by members so that they can recognize their common replication group. Client connection strings can also specify the replica set name to enable appropriate topology discovery and monitoring. A mismatch between the configured name and client expectations can cause connection or topology-discovery problems. DBAs should verify the replica set name when configuring new members, drivers, monitoring systems, or performing deployment migrations.

Question 136

Which MongoDB command reports the amount of replication lag for secondary members?

  1. rs.printSecondaryReplicationInfo()
  2. rs.showSecondaryLag()
  3. rs.secondaryStatus()
  4. rs.replicationDelay()

Correct Answer: 1

Explanation:

rs.printSecondaryReplicationInfo() displays replication information for secondary members, including timing details that help administrators assess how far secondaries are behind the primary. This command is useful when investigating replication delays or confirming that secondary members are keeping up with the workload. Replication lag should be evaluated together with network conditions, disk performance, CPU utilization, and write volume because several factors can cause a secondary to fall behind. Persistent lag can reduce the available recovery window and may indicate that the secondary requires additional resources or investigation.

Question 137

Which MongoDB index property enforces uniqueness across indexed keys?

  1. hidden
  2. partial
  3. unique
  4. sparse

Correct Answer: 3

Explanation:

The unique index option prevents multiple indexed documents from having conflicting key values according to the index’s uniqueness rules. Unique indexes are commonly used to enforce requirements such as unique usernames, identifiers, or other application keys. MongoDB will reject operations that violate the uniqueness constraint. DBAs should examine existing data before creating a unique index because duplicate values can prevent successful index creation. Unique constraints should reflect genuine data-integrity requirements rather than being added solely for performance. The hidden, partial, and sparse properties control different aspects of index behavior and do not independently provide uniqueness.

Question 138

Which MongoDB feature supports reading from a consistent snapshot inside a transaction?

  1. Local read preference
  2. Snapshot read concern
  3. Primary-only routing
  4. Majority write concern

Correct Answer: 2

Explanation:

The snapshot read concern can provide a consistent view of data for supported transactional workloads. It allows operations within a transaction to work against an appropriate snapshot rather than observing arbitrary changes made during the transaction’s execution. This is useful when an application requires a stable view while performing multiple related reads and writes. Transaction behavior depends on the deployment type and MongoDB version, so DBAs should verify supported combinations of read concern, write concern, and transaction settings. Snapshot semantics should be selected because the application requires them, not simply as a general performance setting.

Question 139

Which configuration helps prevent a MongoDB server from accepting remote connections through unintended interfaces?

  1. dbPath
  2. bindIp
  3. oplogSizeMB
  4. journalCompressor

Correct Answer: 2

Explanation:

The bindIp configuration determines which network addresses MongoDB listens on. Restricting this setting to the interfaces that actually require database connectivity can reduce unintended network exposure. Network access should also be controlled through firewalls, security groups, authentication, and TLS because bindIp alone does not provide complete database security. Incorrect binding can also prevent legitimate applications from connecting, so administrators must identify required client and cluster interfaces before making changes. Reviewing listening addresses is an important part of secure MongoDB deployment and network troubleshooting.

Question 140

Which MongoDB command displays general database statistics?

  1. db.collectionStats()
  2. db.databaseMetrics()
  3. db.stats()
  4. db.summary()

Correct Answer: 3

Explanation:

db.stats() returns statistics for the current database, including information related to collections, objects, storage, indexes, and data size. These measurements can help administrators understand database growth and resource consumption at a database-wide level. The output is different from collection-specific statistics because it aggregates information across the current database. DBAs can use database statistics for capacity planning and trend analysis, but individual values should be interpreted in the context of the storage engine, workload, and MongoDB version. For detailed investigation, collection-level and server-level metrics may be needed alongside database statistics.