MongoDB C100DBA Practice Test Questions and Exam Dumps Part3 Q41-60

View Full MongoDB C100DBA Exam Dumps and Practice Test Dumps

 

Question 41

Which WiredTiger feature periodically persists dirty data to disk?

  1. Oplog rotation
  2. Query planning
  3. Journal replay
  4. Checkpoint processing

Correct Answer: 4

Explanation:

WiredTiger uses checkpoints to create consistent on-disk snapshots of data files. During checkpoint processing, modified or dirty pages are written to disk, allowing MongoDB to maintain a recoverable storage state. Checkpoints work together with journaling rather than replacing it. Journaling records operations so recent changes can be recovered if a failure occurs before the next checkpoint completes. Understanding this distinction is important for DBA troubleshooting because checkpoints influence disk I/O patterns and recovery behavior. Monitoring checkpoint activity can also help identify storage performance issues when workloads generate substantial amounts of modified data.

Question 42

Which command displays the currently configured server startup options?

  1. db.serverCmdLineOpts()
  2. db.serverStatus()
  3. db.currentOp()
  4. db.hostInfo()

Correct Answer: 1

Explanation:

db.serverCmdLineOpts() reports the command-line options and configuration-file settings used by the running MongoDB server. This is useful when administrators need to verify operational configuration without inspecting the original startup environment directly. It can help confirm settings related to networking, storage, replication, security, and other server behavior. serverStatus() instead provides runtime metrics, while currentOp() focuses on active operations. hostInfo() provides host-level information. For troubleshooting configuration discrepancies between expected and actual server behavior, examining the effective startup options is an important diagnostic step.

Question 43

What is the primary purpose of a hidden replica set member?

  1. Accepting normal client reads
  2. Providing an isolated replica
  3. Becoming the preferred primary
  4. Handling shard metadata

Correct Answer: 3

Explanation:

A hidden replica set member is configured so that applications do not normally discover it for client operations. It can still maintain a copy of the dataset and participate in replication, making it useful for specialized workloads such as dedicated backups, reporting, or analytics. Hidden members are commonly assigned priorities that prevent them from becoming primary. They continue receiving replicated operations from the set while remaining unavailable for ordinary application routing. This separation allows administrators to use the member for maintenance or secondary workloads without exposing those activities to normal client traffic.

Question 44

Which read concern requests data acknowledged by a majority of replica set voting members?

  1. local
  2. majority
  3. available
  4. snapshot

Correct Answer: 2

Explanation:

The majority read concern allows reads to return data that has been acknowledged by a majority of voting members, providing stronger consistency guarantees than a simple local read. This is especially useful when applications need protection against reading data that could be rolled back after a primary failure. The exact behavior depends on the deployment and transaction context, but the central concept is that majority acknowledgment provides a stronger durability and consistency boundary. Read concern is distinct from write concern: write concern controls how writes are acknowledged, while read concern determines the consistency characteristics of returned data.

Question 45

Which replica set member can intentionally lag behind other members?

  1. Delayed member
  2. Hidden router
  3. Arbiter node
  4. Config server

Correct Answer: 1

Explanation:

A delayed replica set member intentionally maintains a replication delay behind the primary. Administrators can configure the delay so that the member preserves an older version of the dataset for a defined period. This can provide a recovery option when unwanted changes, such as accidental deletions, are detected after they occur. A delayed member should generally be hidden and prevented from becoming primary because its data is intentionally stale. It also requires sufficient storage and monitoring because the member must retain and apply operations according to the configured delay.

Question 46

Which authentication mechanism uses X.509 certificates?

  1. SCRAM-SHA-256
  2. LDAP binding
  3. MONGODB-X509
  4. Kerberos tickets

Correct Answer: 3

Explanation:

MONGODB-X509 is MongoDB’s authentication mechanism for clients and servers using X.509 certificates. It relies on TLS and certificate-based identity rather than a username and password exchange through SCRAM. The server must be configured appropriately for certificate authentication, including trusted certificate authorities and suitable certificate subject information. X.509 authentication is particularly useful in environments that already use a public-key infrastructure for identity management. Administrators should ensure certificates are properly issued, trusted, and renewed because expired or incorrectly configured certificates can prevent clients from establishing authenticated connections.

Question 47

Which index type can restrict indexed documents using a filter expression?

  1. Partial index
  2. Sparse index
  3. Text index
  4. Hashed index

Correct Answer: 1

Explanation:

A partial index indexes only documents that satisfy a specified partialFilterExpression. This can reduce index size and maintenance overhead when queries primarily target a subset of documents. For example, an application might index only active records rather than every document in a collection. Partial indexes are more flexible than sparse indexes because the administrator can define conditions beyond simple field existence. Queries must still satisfy the relevant indexing conditions for the index to provide useful query support. Choosing an appropriate partial filter can improve storage efficiency while preserving performance for targeted workloads.

Question 48

Which command terminates a running MongoDB operation by its operation identifier?

  1. db.stopOperation()
  2. db.killOp()
  3. db.abortOp()
  4. db.cancelQuery()

Correct Answer: 2

Explanation:

db.killOp() is used by administrators to terminate an active database operation identified by its operation ID. Administrators typically identify the operation through current-operation information before deciding whether intervention is necessary. This can be useful when a query, administrative task, or other operation is consuming excessive resources or is no longer needed. Killing an operation should be performed carefully because terminating database activity can affect application behavior or leave expected work incomplete. Appropriate privileges are also required. In production systems, investigating the reason for the problematic operation is preferable to repeatedly terminating similar operations.

Question 49

What does the collStats command primarily provide?

  1. Authentication policies
  2. Replica elections
  3. Collection statistics
  4. Shard credentials

Correct Answer: 3

Explanation:

The collStats command provides statistics about a specific collection. Depending on the storage engine and MongoDB version, the information can include document counts, storage sizes, index statistics, and other collection-level measurements. DBAs can use these metrics to investigate storage consumption, collection growth, and indexing characteristics. collStats is different from broader server-level monitoring commands because its focus is a particular collection. Examining collection statistics can help identify unusually large collections, excessive index overhead, or unexpected data growth that may require capacity planning or schema and indexing review.

Question 50

Which MongoDB aggregation stage combines documents from another collection?

  1. $merge
  2. $group
  3. $unwind
  4. $lookup

Correct Answer: 4

Explanation:

The $lookup aggregation stage performs a left outer join-like operation between documents in the current pipeline and documents from another collection. It can match fields between the two collections and add related documents to the pipeline output. $lookup is useful for workloads where related information is stored separately, although excessive use can create significant memory and processing requirements. Effective indexes on the fields involved in the matching operation can improve performance. DBAs should evaluate the data model and workload before relying heavily on cross-collection joins, particularly for high-volume production workloads.

Question 51

Which replica set setting determines whether a member can become primary?

  1. votes
  2. priority
  3. hidden
  4. tags

Correct Answer: 2

Explanation:

The priority setting influences a replica set member’s eligibility and preference for becoming primary during elections. Members with higher priority are generally preferred over members with lower priority when the election process selects a new primary. A priority of zero prevents a member from becoming primary. Administrators can therefore use priority values to control which members should normally serve as primary while considering factors such as hardware capacity, geographic placement, and network characteristics. Changing replica configuration requires careful planning because elections and configuration changes can temporarily affect application connectivity.

Question 52

Which command reports active operations on a MongoDB server?

  1. db.currentOp()
  2. db.indexStats()
  3. db.hostInfo()
  4. db.stats()

Correct Answer: 1

Explanation:

db.currentOp() provides information about operations currently running on a MongoDB instance. Administrators can use it to investigate long-running queries, active writes, waiting operations, client connections, and other database activity. The information can help identify operations contributing to high CPU, memory, locking, or I/O usage. It is often used during performance troubleshooting together with profiling and server metrics. Because active-operation output can contain substantial information, DBAs commonly filter or inspect the relevant fields rather than treating every listed operation as problematic. Proper authorization is required to obtain sensitive operational details.

Question 53

Which feature protects MongoDB data stored on disk through encryption?

  1. Queryable Encryption
  2. Client-side compression
  3. Encryption at rest
  4. Replica synchronization

Correct Answer: 3

Explanation:

Encryption at rest protects MongoDB data files and related stored information from being readable as plaintext if storage media or files are accessed outside the database’s normal security controls. It is different from TLS, which protects data while it travels between clients, servers, and cluster components. Encryption at rest can therefore complement network encryption rather than replace it. Depending on the deployment, key management can involve local or external key-management systems. DBAs should consider key protection, rotation procedures, operational recovery, and performance implications when implementing encryption for production database infrastructure.

Question 54

What does a unique index prevent?

  1. Unindexed documents
  2. Duplicate indexed values
  3. Missing collection metadata
  4. Repeated query plans

Correct Answer: 2

Explanation:

A unique index enforces uniqueness for the indexed key values. MongoDB rejects an insert or update when it would create a duplicate indexed value, subject to the specific behavior of the index definition and handling of missing or null values. Unique indexes are commonly used to enforce application-level identity requirements, such as unique usernames, account identifiers, or other business keys. They should be designed carefully because an incorrectly chosen uniqueness constraint can prevent legitimate records from being stored. Unique indexing therefore serves both query-performance and data-integrity purposes when applied to appropriate fields.

Question 55

Which command displays statistics about indexes used by a collection?

  1. db.indexUsage()
  2. db.getIndexes()
  3. db.indexStats()
  4. db.showIndexes()

Correct Answer: 3

Explanation:

db.collection.aggregate([{ $indexStats: {} }]) provides usage statistics for indexes on a collection. These statistics can help DBAs determine whether indexes are actually being accessed by queries. This is valuable when reviewing index overhead because every additional index can increase storage requirements and add work to insert and update operations. An index that appears unnecessary should not automatically be removed solely because its usage counter is low; workload patterns and monitoring periods must be considered. Index statistics are therefore most useful when combined with query analysis, application knowledge, and representative workload observations.

Question 56

Which option can make a replica set member unavailable for client discovery while it continues replicating?

  1. priority: 2
  2. votes: 1
  3. hidden: true
  4. arbiterOnly: true

Correct Answer: 3

Explanation:

Setting a replica set member as hidden prevents normal client discovery from selecting that member for reads while allowing it to continue maintaining replicated data. Hidden members can be useful for dedicated operational tasks such as backups, reporting, or other workloads that administrators do not want mixed with normal application traffic. A hidden member is different from an arbiter because an arbiter does not maintain a copy of the data. The hidden setting is therefore particularly useful when administrators need a fully replicated database member that remains outside normal client routing.

Question 57

Which command requests a replica set member to step down from primary?

  1. rs.stepDown()
  2. rs.leavePrimary()
  3. rs.demote()
  4. rs.transferPrimary()

Correct Answer: 1

Explanation:

rs.stepDown() causes the current primary to relinquish its primary role, allowing the replica set election process to select another eligible member. This command can be useful during planned maintenance, server replacement, or controlled operational procedures. A stepdown can temporarily interrupt writes because the new primary must be elected and applications must reconnect or rediscover the new primary. Administrators should therefore perform stepdowns carefully and understand the configured priorities and member health before initiating one. Properly configured drivers generally handle replica set topology changes automatically after the election completes.

Question 58

Which aggregation stage expands an array into separate pipeline documents?

  1. $project
  2. $match
  3. $unwind
  4. $sort

Correct Answer: 3

Explanation:

The $unwind stage deconstructs an array field so that each element can become a separate document in the aggregation pipeline. For example, a document containing several order items can be transformed into multiple pipeline documents, one for each item. This is particularly useful when individual array elements need to be filtered, grouped, sorted, or analyzed independently. $unwind can increase the number of documents flowing through subsequent stages, so DBAs should consider the resulting workload when optimizing aggregation pipelines. Proper filtering before expansion can sometimes reduce unnecessary processing.

Question 59

Which setting helps prevent a replica set member from becoming primary while retaining voting participation?

  1. hidden: true
  2. priority: 0
  3. secondaryDelaySecs
  4. buildIndexes: false

Correct Answer: 2

Explanation:

A replica set member configured with priority: 0 cannot become primary. It can still participate in replication and, when configured appropriately, can retain its voting role. This is useful for members that should contribute to elections but should never host primary workloads, such as members in particular geographic locations or systems with operational constraints. This setting differs from hidden, which controls client discovery, and from delayed replication settings, which intentionally make a member’s data stale. Administrators should understand how priority, votes, hidden status, and delay interact when designing replica set topology.

Question 60

Which feature allows MongoDB clients to maintain related operations across multiple commands?

  1. Database profiler
  2. Collection validator
  3. Storage checkpoint
  4. Client session

Correct Answer: 4

Explanation:

A client session provides a logical context that can span multiple MongoDB operations. Sessions are used by drivers and applications for features such as transactions, causal consistency, and retryable operations. A session gives the server additional context for associating related commands and maintaining the required operation state. Applications generally rely on the MongoDB driver to create and manage sessions rather than manually implementing the underlying protocol details. Understanding sessions is important for DBAs because session behavior affects transaction management, connection usage, timeout configuration, and the way modern applications interact with MongoDB clusters.