Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

The ________ field contains optional custom information about the user.(a) customDataAll(b) OptmData(c) customData(d) all of the mentionedThis question was addressed to me in homework.My question comes from User and Role Management topic in chapter Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right OPTION is (C) customData

Explanation: The system.users collection in the admin database STORES user authentication and authorization information.

2.

Which of the following can be used to generate unique strings for use in passwords?(a) openssl(b) openssd(c) oppstringpwd(d) none of the mentionedI got this question by my college professor while I was bunking the class.I would like to ask this question from User and Role Management in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Correct OPTION is (a) openssl

Explanation: You can use the openssl program to generate unique strings for use in passwords, as in the FOLLOWING COMMAND: openssl rand -base64 48

3.

You must have the _________ action on a database to modify the password of any user on that database.(a) changePassword(b) changeAnyPassword(c) removePassword(d) none of the mentionedI had been asked this question in exam.This intriguing question comes from User and Role Management in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The CORRECT CHOICE is (B) changeAnyPassword

To elaborate: To CHANGE your own password, you must have the changeOwnPassword action on your database.

4.

You must have the __________ action on a database to revoke a role on that database.(a) revokePrivelege(b) revokeUser(c) revokeRole(d) all of the mentionedThe question was posed to me during an interview for a job.I need to ask this question from User and Role Management topic in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer» RIGHT option is (c) revokeRole

The best EXPLANATION: USER can remove any ROLE from any user from any DATABASE in the system.
5.

Which of the following method is used to identify the privileges granted by the roles?(a) rolesUser(b) rolesInfo(c) rolesView(d) all of the mentionedThis question was addressed to me during an interview.My question comes from User and Role Management topic in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The CORRECT ANSWER is (C) rolesView

Easy explanation: db.getRole() wraps the rolesInfo COMMAND.

6.

____________ removes a one or more roles from a user on the current database.(a) db.revokeRolesUser()(b) db.revokeRoles()(c) db.revokeRolesFromUser()(d) none of the mentionedThe question was posed to me during an interview for a job.I'm obligated to ask this question of User and Role Management in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Correct ANSWER is (C) db.revokeRolesFromUser()

The BEST explanation: To specify a ROLE that exists in the same database where db.revokeRolesFromUser() runs, you can either specify the role with the NAME of the role.

7.

Point out the wrong statement.(a) You must have the createUser action on a database to create a new user on that database(b) You must have the grantRole action on a role’s database to grant the role to another user(c) If your MongoDB deployment has no users, you must connect to mongod using the localhost exception(d) None of the mentionedThis question was posed to me in an interview for job.Question is taken from User and Role Management topic in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Correct answer is (a) You must have the createUser action on a database to CREATE a NEW user on that database

The best explanation: You can use –noauth OPTION when starting mongod to GAIN full access the system.

8.

Point out the correct statement.(a) To provide user administrators, MongoDB has userAdmin and userAdminAnyDatabase roles(b) A user administrator can grant any privilege in the database and can create new ones(c) Specifically, a user with the userAdmin role can grant itself any privilege in the database(d) All of the mentionedThe question was asked in a national level competition.This interesting question is from User and Role Management in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The CORRECT answer is (d) All of the mentioned

For explanation I would say: A user assigned either the userAdmin role on the ADMIN DATABASE or the USERADMINANYDATABASE can grant itself any privilege in the system.

9.

Grant the user the role using the ________ method.(a) db.grantRole()(b) db.grantRolesToUser()(c) db.grantToUser()(d) all of the mentionedI got this question in quiz.This interesting question is from User and Role Management in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right CHOICE is (B) db.grantRolesToUser()

EXPLANATION: If the user requires ADDITIONAL privileges, GRANT to the user the role, or roles, with the required set of privileges.

10.

______________ enables a set of internal commands useful for internal testing operations.(a) enableTestAll(b) enableTest(c) enableTestCommands(d) all of the mentionedI had been asked this question during a job interview.Enquiry is from Access Control in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The correct OPTION is (c) enableTestCommands

To explain I WOULD say: enableTestCommands is only AVAILABLE when starting mongod and you cannot use setParameter to MODIFY this PARAMETER.

11.

To view a role’s information, you must be explicitly granted the role or must have the _________ action on the role’s database.(a) viewUser(b) viewRole(c) grantRole(d) none of the mentionedI had been asked this question in a national level competition.This key question is from User and Role Management in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer» RIGHT option is (b) viewRole

The explanation is: The LOCALHOST EXCEPTION allows you to enable AUTHORIZATION before creating the FIRST user in the system.
12.

enableLocalhostAuthBypass is not available using _________ database command.(a) setParameter(b) enableParameter(c) removeParameter(d) none of the mentionedThe question was posed to me in an interview.Question is from Access Control topic in chapter Production Checklist, Security Concepts and Network Security of MongoDB

Answer» CORRECT OPTION is (a) setParameter

Easy EXPLANATION: Use the setParameter option in the configuration file or the –setParameter option on the command line.
13.

The ________ client authentication allows clients to authenticate to servers with certificates rather than with a username and password.(a) x.209(b) x.509(c) x.709(d) None of the mentionedI had been asked this question in an internship interview.This interesting question is from Access Control in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer» RIGHT ANSWER is (B) x.509

To explain I WOULD SAY: MongoDB supports x.509 certificate authentication for use with a secure TLS/SSL connection.
14.

Point out the wrong statement.(a) Authentication does not require an authentication mechanism(b) To enable authentication on a sharded cluster, you must enable authentication individually on each component of the cluster(c) The content of the key file must be the same on all cluster members(d) All of the mentionedThis question was posed to me in unit test.Question is from Access Control topic in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer» RIGHT choice is (a) AUTHENTICATION does not require an authentication mechanism

To ELABORATE: Authentication REQUIRES an authentication mechanism and, in most cases, a KEY file.
15.

If you use the localhost exception when deploying a new MongoDB system, the first user you create must be in the ________ database.(a) head(b) local(c) admin(d) all of the mentionedThe question was posed to me in an interview for internship.This intriguing question comes from Access Control topic in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer» CORRECT answer is (C) admin

Best explanation: In the case of a sharded cluster, the localhost EXCEPTION applies to each shard individually as WELL as to the cluster as a whole.
16.

If you need to disable access control for any reason, restart the process with ______ setting.(a) KeyFile(b) Authentication(c) Authorization(d) All of the mentionedThis question was posed to me by my school teacher while I was bunking the class.Query is from Access Control topic in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer» CORRECT choice is (a) KeyFile

Explanation: LOGIN in with the user ADMINISTRATOR’s credentials and create ADDITIONAL users.
17.

Point out the correct statement.(a) After you create the user administrator, the localhost exception is no longer available(b) Enabling access control on a MongoDB instance restricts access to the instance by requiring that users identify themselves when connecting(c) The mongo shell executes a number of commands at start up(d) All of the mentionedI have been asked this question in exam.I'd like to ask this question from Access Control topic in chapter Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The correct answer is (d) All of the mentioned

The EXPLANATION is: As a result, when you LOG in as the USER administrator, you MAY see authentication errors from one or more commands.

18.

If you create the user administrator before enabling access control, MongoDB disables the ________ exception.(a) localhost(b) server(c) runtime(d) none of the mentionedI had been asked this question during an internship interview.Origin of the question is Access Control in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Correct choice is (a) localhost

For explanation I WOULD say: The localhost exception ALLOWS you to enable AUTHORIZATION before creating the first user in the system.

19.

MongoDB supports the execution of JavaScript code for certain server-side operations like ____________(a) where(b) group(c) mapreduce(d) all of the mentionedThe question was posed to me in exam.The question is from Security Checklist topic in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer» CORRECT choice is (d) all of the mentioned

To explain I would say: If you do not use these OPERATIONS, disable server-side SCRIPTING by using the –noscripting OPTION on the command line.
20.

Which of the following is used to display the replica set configuration object?(a) rs.config(b) rs.conf(c) rs.confrepl(d) none of the mentionedThis question was posed to me in semester exam.This interesting question is from Security Checklist topic in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The CORRECT answer is (b) rs.conf

The best EXPLANATION: rs.conf() RETURNS a document that contains the current replica SET configuration.

21.

_____________ is used to initiate relica member set.(a) rs.rep()(b) rs.init()(c) rs.initiate()(d) none of the mentionedThis question was posed to me in semester exam.Question is from Security Checklist topic in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The CORRECT answer is (c) rs.initiate()

Best explanation: MONGODB initiates a set that consists of the current member and that uses the default REPLICA set configuration.

22.

To generate pseudo-random data to use for a keyfile, issue the following __________ command.(a) openhss(b) openssd(c) openssl(d) all of the mentionedThis question was addressed to me in quiz.My question is from Security Checklist topic in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer» CORRECT answer is (c) openssl

To explain I would say: ALWAYS ensure that the PASSWORD stored in the key file is both long and contains a HIGH amount of entropy. USING openssl in this manner helps generate such a key.
23.

Use the __________ option to ensure that MongoDB listens for connections from applications on configured addresses.(a) bind_ipadd(b) bind_ip(c) bind_service(d) none of the mentionedThis question was posed to me in exam.This interesting question is from Security Checklist in chapter Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right choice is (B) bind_ip

The explanation is: For a geographically distributed replica SETS, ensure that the majority of the set’s mongod INSTANCES RESIDE in the PRIMARY site.

24.

Point out the wrong statement.(a) User principal names have the form: @(b) For MongoDB, the defaults to mongodb(c) Every MongoDB mongod and mongos instance must have an associated service principal(d) All of the mentionedThis question was posed to me in examination.The query is from Security Checklist topic in chapter Production Checklist, Security Concepts and Network Security of MongoDB

Answer» RIGHT option is (b) For MongoDB, the defaults to mongodb

For explanation: USER PRINCIPAL names have the form: @.
25.

___________ allows administrators to define and limit the resources and operations that a user can access.(a) Access(b) Authentication(c) Authorization(d) All of the mentionedThe question was posed to me in semester exam.My question is from Security Checklist topic in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Correct OPTION is (c) Authorization

For explanation: USING AUTHENTICATION and authorization is a key part of a complete SECURITY strategy.

26.

With ___________ enabled, MongoDB forces all clients to identify themselves before granting access to the server.(a) access(b) authentication(c) authorization(d) all of the mentionedThis question was posed to me in an interview for internship.I'm obligated to ask this question of Security Checklist in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The correct ANSWER is (B) authentication

For explanation I would say: KDC uses the client’s SECRET and the server’s secret to construct the ticket which allows the client and server to mutually AUTHENTICATE each other, while keeping the secrets hidden.

27.

On Linux, MongoDB clients can use Kerberos’s _______ program to initialize a credential cache for authenticating the user principal to servers.(a) knight(b) kinit(c) Knite(d) None of the mentionedI got this question during an online interview.My question is taken from Kerberos Authentication in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right option is (b) kinit

The explanation is: Unlike on Linux SYSTEMS, mongod and mongos INSTANCES RUNNING on Windows do not require ACCESS to keytab files.

28.

Use __________ to encrypt communication between mongod and mongos components of a MongoDB client as well as between all applications and MongoDB.(a) SSD(b) TLS(c) MEAN(d) None of the mentionedThis question was addressed to me in a national level competition.The doubt is from Security Checklist in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Correct answer is (b) TLS

Easy EXPLANATION: CREATE roles that DEFINE the EXACT access a SET of users needs.

29.

Linux systems can store Kerberos authentication keys for a service principal in ______ files.(a) Client(b) Server(c) keytab(d) All of the mentionedThis question was addressed to me in an online quiz.My doubt stems from Kerberos Authentication in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right choice is (c) keytab

Easy explanation: To keep keytab files secure, use FILE PERMISSIONS that RESTRICT ACCESS to only the user that runs the mongod or mongos process.

30.

To specify a different value for , use ________ during the start up of mongod.(a) servicepwd(b) serviceName(c) servicelogin(d) none of the mentionedThe question was posed to me during an interview.This question is from Kerberos Authentication topic in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right ANSWER is (b) serviceName

The best explanation: mongo shell or other clients may ALSO specify a DIFFERENT SERVICE principal name using serviceName.

31.

To authenticate using Kerberos, you must add the Kerberos user principals to MongoDB to the _________ database.(a) $internal(b) $external(c) $extern(d) None of the mentionedI have been asked this question during an internship interview.My question is from Kerberos Authentication in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right option is (b) $external

The BEST I can explain: For EVERY user you want to authenticate using Kerberos, you must create a corresponding user in MONGODB in the $external DATABASE.

32.

For a client-server authentication, the client requests from the KDC a ________ for access to a specific asset.(a) ticket(b) local(c) token(d) userI got this question in a job interview.I would like to ask this question from Kerberos Authentication in chapter Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The CORRECT answer is (a) ticket

Best explanation: KDC USES the client’s secret and the server’s secret to construct the ticket which allows the client and server to MUTUALLY authenticate each other, while keeping the secrets HIDDEN.

33.

Point out the correct statement.(a) MongoDB Enterprise provides support for Kerberos authentication of MongoDB clients to mongod and mongos(b) Kerberos is an industry standard authentication protocol for large client/server systems(c) Kerberos allows MongoDB and applications to take advantage of existing authentication infrastructure and processes(d) All of the mentionedI have been asked this question in a national level competition.I want to ask this question from Kerberos Authentication in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer» CORRECT answer is (d) All of the mentioned

The EXPLANATION: In a Kerberos-based SYSTEM, every participant in the AUTHENTICATED communication is known as a “principal”, and every principal must have a unique name.
34.

For each _______ the Kerberos Key Distribution Center (KDC) maintains a database of the realm’s principal and the principal’s associated “secret keys”.(a) key(b) realm(c) document(d) none of the mentionedI got this question in an interview for internship.Asked question is from Kerberos Authentication topic in chapter Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The correct choice is (B) realm

For explanation I would say: Principals belong to administrative UNITS CALLED realms.

35.

The _________ message limit can result in the truncation of the audit messages.(a) oplog(b) syslog(c) evallog(d) none of the mentionedI have been asked this question in an online quiz.The doubt is from Auditing in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Correct OPTION is (b) syslog

For explanation: The auditing system will neither DETECT the truncation nor error upon its OCCURRENCE.

36.

The _____________ option accepts either full path name or relative path name.(a) –auditPathLog(b) –logPath(c) –auditPath(d) None of the mentionedI had been asked this question during an internship interview.This interesting question is from Auditing topic in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer» RIGHT choice is (c) –auditPath

The explanation: To enable AUDITING and print AUDIT events to a file in BSON binary format, specify file for the –auditDestination setting, BSON for the –auditFormat setting, and the output FILENAME for the –auditPath.
37.

To view the contents of the file, pass the file to the MongoDB utility ___________(a) bsonlog(b) bsonout(c) bsondump(d) SelectIndexesThis question was posed to me by my school teacher while I was bunking the class.The doubt is from Auditing in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Correct choice is (C) bsondump

Best EXPLANATION: The following converts the AUDIT log into a human-readable FORM and output to the TERMINAL: bsondump data/db/auditLog.bson .

38.

The audit file rotates at the same time as the ________ log file.(a) Client(b) Server(c) Application(d) All of the mentionedThis question was addressed to me in an interview for internship.My question comes from Auditing in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The correct OPTION is (b) Server

The best I can explain: PRINTING audit events to a file in JSON format DEGRADES server PERFORMANCE more than printing to a file in BSON format.

39.

Use the ____________ option to enable auditing and specify where to output the audit events.(a) –auditLocation(b) –auditOutput(c) –auditDestination(d) None of the mentionedI had been asked this question in an online quiz.This question is from Auditing in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The CORRECT choice is (c) –auditDestination

For explanation I WOULD say: For sharded clusters, if you enable auditing on mongos instances, you must enable auditing on all mongod instances in the cluster, i.e. shards and CONFIG SERVERS.

40.

Enabling _____________ degrades performance more than logging only the authorization failures.(a) auditAuthorizationFailure(b) auditAuthorizationSuccess(c) auditAuthorizationlog(d) none of the mentionedThe question was posed to me in an interview for job.Question is from Auditing topic in section Production Checklist, Security Concepts and Network Security of MongoDB

Answer» CORRECT choice is (b) auditAuthorizationSuccess

To EXPLAIN: System Event Audit Message is AVAILABLE only in MONGODB Enterprise.
41.

_________ contains the local ip address and the port number of the running instance.(a) ts(b) local(c) remote(d) usersI had been asked this question during an interview.The query is from Auditing in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer» CORRECT ANSWER is (b) local

The best explanation: Remote document contains the remote ip address and the port number of the incoming CONNECTION ASSOCIATED with the EVENT.
42.

Point out the correct statement.(a) When a process writes to a resource, it takes an exclusive write lock to prevent other processes from writing to or reading from that resource(b) As clients insert new documents into the capped collection, the tailable cursor continues to retrieve documents(c) Write concern allows your application to detect insertion errors or unavailable mongod instances(d) All of the mentionedI had been asked this question during an online interview.The question is from Auditing in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer» RIGHT answer is (d) All of the mentioned

Explanation: MongoDB Enterprise INCLUDES an AUDITING capability for mongod and mongos INSTANCES.
43.

The auditing facility can write audit events to the console, the _________ a JSON file, or a BSON file.(a) oplog(b) syslog(c) evallog(d) none of the mentionedI had been asked this question in an international level competition.I want to ask this question from Auditing in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The CORRECT CHOICE is (b) syslog

To explain: MONGODB provides an option to send output to the host’s syslog SYSTEM.

44.

Config servers, host the _______ database that stores metadata for sharded clusters.(a) head(b) master(c) config(d) none of the mentionedI have been asked this question in final exam.This question is from Security and MongoDB API Interfaces in division Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

The correct OPTION is (c) config

Easiest explanation: Each production cluster has three config servers, INITIATED using the MONGOD –configsvr option.

45.

Config servers listen for connections on port __________(a) 27011(b) 27019(c) 27107(d) None of the mentionedThis question was posed to me at a job interview.I'm obligated to ask this question of Security and MongoDB API Interfaces topic in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right choice is (B) 27019

Easiest EXPLANATION: You also can run a CONFIG server by USING the configsvr value for the clusterRole setting in a configuration file.

46.

________ instances provide query routing for sharded clusters.(a) mongod(b) mongos(c) netstats(d) selectindexesThe question was posed to me in homework.The doubt is from Security and MongoDB API Interfaces in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer» CORRECT OPTION is (b) mongos

Easy explanation: CLIENTS connect to mongos INSTANCES, which behave from the client’s perspective as MONGOD instances.
47.

The _______ API to MongoDB provides additional information and write access on top of the HTTP status interface.(a) Web(b) REST(c) RestFul(d) All of the mentionedI have been asked this question in a job interview.Query is from Security and MongoDB API Interfaces in chapter Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right option is (b) REST

The best I can explain: The REST interface is disabled by DEFAULT, and is not RECOMMENDED for PRODUCTION use.

48.

The HTTP interface is always available on the port numbered _________ greater than the primary mongod port.(a) 1000(b) 2000(c) 3000(d) None of the mentionedThis question was addressed to me in a national level competition.Enquiry is from Security and MongoDB API Interfaces in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Correct answer is (a) 1000

Easiest EXPLANATION: By default, the HTTP interface port is 28017, but is INDIRECTLY set using the port OPTION which ALLOWS you to configure the primary mongod port.

49.

Point out the wrong statement.(a) REST does provide administrative access, and its accessibility represents a vulnerability in a secure environment(b) REST API does provide any support for insert, update, or remove operations(c) The net.http.RESTInterfaceEnabled configuration makes the http status interface, which is read-only by default, fully interactive(d) None of the mentionedThe question was asked by my school principal while I was bunking the class.Query is from Security and MongoDB API Interfaces topic in portion Production Checklist, Security Concepts and Network Security of MongoDB

Answer» RIGHT CHOICE is (b) REST API does provide any SUPPORT for INSERT, update, or remove operations

The best I can explain: REST API does not provide any support for insert, update, or remove operations.
50.

On _________ mongo.exe reads the .mongorc.js file from %HOME%.mongorc.js.(a) Windows(b) Linux(c) Mac(d) SolarisThe question was asked in final exam.My question is from Security and MongoDB API Interfaces topic in chapter Production Checklist, Security Concepts and Network Security of MongoDB

Answer»

Right choice is (a) Windows

Easiest EXPLANATION: On Linux and UNIX SYSTEMS, mongo READS the .mongorc.js file from $HOME/.mongorc.js.