MongoDB C100DBA Practice Test Questions and Exam Dumps Part18 Q341-360

View Full MongoDB C100DBA Exam Dumps and Practice Test Dumps

 

Question 341

Which fill method carries the last observed value forward?

  1. $locf
  2. $carryForward
  3. $forwardFill
  4. $previousValue

Correct Answer: 1

Explanation:

The $locf expression implements last observation carried forward behavior for missing values in supported aggregation workflows. When a value is unavailable, MongoDB can use the most recently observed non-null value according to the specified ordering and partitioning context. This is useful for time-series analysis where a measurement remains applicable until a newer measurement arrives. For example, a status or configuration value can sometimes be propagated across missing time points. $carryForward, $forwardFill, and $previousValue are not the MongoDB expression names used for this specific filling behavior.

Question 342

Which fill method calculates missing values using linear interpolation?

  1. $interpolate
  2. $linearFill
  3. $linearInterpolate
  4. $estimateLine

Correct Answer: 2

Explanation:

The $linearFill expression fills missing values by using linear interpolation between surrounding known values. It is particularly useful for ordered numerical or time-series data where missing measurements can reasonably be estimated from neighboring observations. The calculation considers the values before and after the missing point according to the pipeline’s ordering. This differs from carrying the previous observation forward because the resulting value can fall between two known measurements. $interpolate, $linearInterpolate, and $estimateLine are not the standard MongoDB expression names for this operation.

Question 343

Which accumulator returns the bottom N values by sorting criteria?

  1. $lowestN
  2. $minNValues
  3. $bottomN
  4. $leastN

Correct Answer: 3

Explanation:

The $bottomN accumulator returns the bottom N documents or values according to a specified sort definition. It is useful when an aggregation needs several lowest-ranked results rather than only a single minimum. For example, an analytical report could use it to identify the lowest-performing products within each group. The accumulator supports a configurable n value and sorting criteria that determine which records belong in the result. $lowestN, $minNValues, and $leastN are not the standard MongoDB aggregation accumulator names for retrieving multiple bottom results.

Question 344

Which transaction command permanently applies its operations?

  1. finishTransaction
  2. commitTransaction
  3. saveTransaction
  4. completeTransaction

Correct Answer: 2

Explanation:

The commitTransaction command commits the operations performed within a transaction. Once successfully committed, the transaction’s changes become durable according to the applicable write concern and transaction semantics. Applications normally use a driver API rather than issuing the command manually, but the underlying transaction protocol includes the commit operation. If a transaction cannot successfully complete, an application may instead abort it. finishTransaction, saveTransaction, and completeTransaction are not MongoDB transaction command names. Proper transaction handling also requires applications to account for transient errors and retryable transaction outcomes where appropriate.

Question 345

Which transaction command discards its uncommitted changes?

  1. abortTransaction
  2. cancelTransaction
  3. rollbackTransaction
  4. discardTransaction

Correct Answer: 1

Explanation:

The abortTransaction command terminates an active transaction without committing its pending operations. The transaction’s uncommitted changes are discarded, allowing the application to recover from an error or intentionally abandon a transaction. Drivers typically expose transaction-abort functionality through session APIs rather than requiring applications to issue the command directly. Aborting is especially important when application logic detects that continuing the transaction would produce an invalid or unwanted state. cancelTransaction, rollbackTransaction, and discardTransaction are not the standard MongoDB command names for explicitly aborting a transaction.

Question 346

Which write concern option specifies a time limit for acknowledgment?

  1. ackTimeout
  2. wtimeout
  3. writeDeadline
  4. confirmTimeout

Correct Answer: 2

Explanation:

The wtimeout write concern option specifies how long MongoDB should wait for the requested write-concern acknowledgment before reporting a timeout. It does not cancel the underlying write operation simply because the client stopped waiting for the acknowledgment. This distinction is important when applications interpret write-concern errors. A timeout therefore indicates that the requested acknowledgment was not received within the configured period rather than automatically proving that the write never occurred. ackTimeout, writeDeadline, and confirmTimeout are not the standard MongoDB write concern option names.

Question 347

Which write concern option requests journal acknowledgment?

  1. journaled
  2. durable
  3. j
  4. diskConfirm

Correct Answer: 3

Explanation:

The j write concern option requests acknowledgment after the write has been committed to the journal, subject to MongoDB’s applicable journaling and storage behavior. Journal acknowledgment is different from simply requesting that a specified number of replica-set members acknowledge a write. Applications can combine write concern settings when they need particular durability and replication guarantees. The exact behavior also depends on deployment configuration and storage engine characteristics. journaled, durable, and diskConfirm are not the standard MongoDB write concern option names used to request journal acknowledgment.

Question 348

Which read preference selects the nearest suitable member?

  1. nearest
  2. closest
  3. localNearest
  4. lowestLatency

Correct Answer: 1

Explanation:

The nearest read preference mode directs MongoDB drivers to select among suitable members based on network latency rather than preferring the primary or a specific secondary role. This can help applications distribute read workloads among geographically or topologically close replica-set members. The driver considers eligible servers according to the deployment’s topology and configured latency window. nearest does not simply mean choosing the physically closest server; suitability and measured network latency are involved. closest, localNearest, and lowestLatency are not standard MongoDB read preference mode names.

Question 349

Which read preference can use a secondary but falls back to primary?

  1. secondaryPreferred
  2. secondaryFallback
  3. replicaPreferred
  4. secondaryFirst

Correct Answer: 1

Explanation:

The secondaryPreferred read preference mode prefers secondary members for eligible reads but can fall back to the primary when suitable secondary members are unavailable. This can help distribute read workloads while retaining a primary-based fallback path. Applications should consider data freshness because secondary reads can observe replication lag. The mode is therefore different from secondary, which restricts selection to eligible secondary members rather than normally falling back to the primary. secondaryFallback, replicaPreferred, and secondaryFirst are not standard MongoDB read preference mode names.

Question 350

Which option identifies a client certificate and private key file?

  1. tlsKeyFile
  2. tlsCertificateKeyFile
  3. tlsClientIdentity
  4. tlsCredentialFile

Correct Answer: 2

Explanation:

The tlsCertificateKeyFile connection or server configuration option identifies a PEM file containing a TLS certificate and its associated private key. MongoDB can use this credential when mutual TLS authentication is configured and the server or client must present a certificate. The certificate establishes the identity of the endpoint, while the private key proves possession of that identity. File permissions should be protected because the private key is sensitive credential material. tlsKeyFile, tlsClientIdentity, and tlsCredentialFile are not the standard MongoDB option name for this combined certificate-key file.

Question 351

Which option specifies trusted certificate authorities for TLS?

  1. tlsTrustFile
  2. tlsRootFile
  3. tlsCAFile
  4. tlsAuthorityPath

Correct Answer: 3

Explanation:

The tlsCAFile option specifies a PEM file containing certificate authority certificates that MongoDB uses to validate TLS certificates. This is important when connecting to servers whose certificates are signed by a private or organizational CA rather than a public CA already trusted by the operating environment. Correct CA configuration helps prevent certificate validation failures while maintaining TLS trust verification. Administrators should ensure that the CA file contains the appropriate trust chain and is protected from unauthorized modification. tlsTrustFile, tlsRootFile, and tlsAuthorityPath are not the standard MongoDB option names.

Question 352

Which authentication mechanism uses an external OIDC identity provider?

  1. SCRAM
  2. OIDC
  3. PLAIN
  4. X509

Correct Answer: 2

Explanation:

OIDC, or OpenID Connect, provides an authentication mechanism that can integrate MongoDB clients with an external identity provider. Instead of relying solely on locally managed database passwords, supported MongoDB deployments and drivers can use OIDC-based identity flows. This can be useful in environments where centralized identity management is already established. OIDC authentication has deployment, driver, and identity-provider requirements that must be configured consistently. SCRAM uses MongoDB-managed credentials, X.509 relies on certificates, and PLAIN uses a username and password mechanism appropriate to its configured authentication environment.

Question 353

Which authentication method uses a shared keyfile between cluster members?

  1. SCRAM
  2. OIDC
  3. Keyfile
  4. X509

Correct Answer: 3

Explanation:

A keyfile can be used for internal authentication between MongoDB cluster members when the deployment is configured for keyfile-based cluster authentication. The participating members use the shared secret material to authenticate one another. Keyfiles must be protected carefully because possession of the secret can provide the ability to authenticate as a cluster member. Modern deployments may instead use certificate-based internal authentication depending on security requirements. SCRAM is generally associated with client authentication, OIDC uses an external identity provider, and X.509 uses certificates rather than a shared keyfile.

Question 354

Which role provides broad cluster administration privileges?

  1. clusterAdmin
  2. clusterManager
  3. systemAdmin
  4. serverOperator

Correct Answer: 1

Explanation:

The clusterAdmin built-in role provides broad administrative privileges for managing MongoDB cluster resources and operations. It is intended for users who need extensive cluster-level administrative capabilities rather than ordinary application data access. Assigning broad roles should be done carefully according to the principle of least privilege because unnecessary administrative privileges increase operational risk. Other built-in roles provide narrower capabilities for specific administrative tasks. clusterManager, systemAdmin, and serverOperator are not the standard MongoDB built-in role names corresponding to this broad cluster administration role.

Question 355

Which role allows administration of database users across databases?

  1. userManagerAnyDatabase
  2. userAdminAnyDatabase
  3. accountAdminAnyDatabase
  4. securityUserManager

Correct Answer: 2

Explanation:

The userAdminAnyDatabase built-in role provides privileges for managing users and roles across databases, subject to the permissions associated with that role. It is intended for administrative accounts responsible for user and authorization management throughout a deployment. It should be assigned carefully because user-management privileges can affect access to many databases. The role is different from data-oriented roles that primarily permit reading or writing application collections. userManagerAnyDatabase, accountAdminAnyDatabase, and securityUserManager are not the standard MongoDB built-in role names for this capability.

Question 356

Which role permits reading from all databases?

  1. readEveryDatabase
  2. readAllDatabases
  3. readAnyDatabase
  4. globalReader

Correct Answer: 3

Explanation:

The readAnyDatabase built-in role grants read privileges across databases. It is useful for accounts that require broad read access without requiring general write permissions. This can support certain monitoring, reporting, or centralized data-consumption workloads while keeping access narrower than full administrative roles. Administrators should still evaluate whether all-database access is necessary and consider more narrowly scoped roles where possible. readEveryDatabase, readAllDatabases, and globalReader are not the standard MongoDB built-in role names for granting broad read access.

Question 357

Which transaction property groups operations into one atomic unit?

  1. Session pooling
  2. Transaction atomicity
  3. Read routing
  4. Cursor batching

Correct Answer: 2

Explanation:

Transaction atomicity means that the operations in a transaction are committed as a unit or are not committed as the completed transaction. This property is important when several related changes must succeed together to maintain application consistency. For example, transferring value between two records may require multiple writes that should not become partially visible as a completed business operation. MongoDB multi-document transactions provide atomicity across supported operations. Session pooling, read routing, and cursor batching are separate concepts and do not provide the transaction-wide atomic behavior described here.

Question 358

Which setting controls the replica-set member voting count?

  1. votes
  2. memberVotes
  3. electionVotes
  4. voteCount

Correct Answer: 1

Explanation:

The votes replica-set member setting determines whether a member participates in elections and, when configured as a voting member, contributes a vote to replica-set election decisions. MongoDB replica-set configuration uses this setting to define voting behavior for individual members. Voting configuration must follow the deployment’s supported limits and election requirements. It should be considered together with member priority and other replica-set settings when designing high availability. memberVotes, electionVotes, and voteCount are not the standard replica-set configuration field names used for this purpose.

Question 359

Which command returns information about a user’s assigned roles?

  1. userRoles
  2. rolesForUser
  3. usersInfo
  4. showUserRoles

Correct Answer: 3

Explanation:

The usersInfo command retrieves information about specified MongoDB users, including their assigned roles when the requesting account has the necessary privileges. This command is useful for auditing authorization configuration and verifying how user accounts are configured. Administrators can use it to inspect users in a particular database or retrieve relevant user information according to the command’s supported syntax. userRoles, rolesForUser, and showUserRoles are not the standard MongoDB command names for retrieving user information and role assignments.

Question 360

Which command returns information about configured roles?

  1. roleDetails
  2. rolesInfo
  3. showRoles
  4. getRoleDefinitions

Correct Answer: 2

Explanation:

The rolesInfo command retrieves information about MongoDB roles. It can be used to inspect built-in or custom roles and, when permitted, examine privileges and inherited role relationships. This makes it useful for authorization audits, troubleshooting permission issues, and reviewing role design. Understanding inherited roles is especially important because a user’s effective privileges may come from multiple levels of role inheritance. roleDetails, showRoles, and getRoleDefinitions are not the standard MongoDB command names for retrieving role information.