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.

51.

Point out the correct statement.(a) Journal must reside on the same logical volume as the other MongoDB data files(b) To get a consistent snapshot of a sharded system, you must disable the balancer(c) Backups produced by copying the underlying data do not support point in time recovery(d) All of the mentionedThe question was asked in class test.This question is from MongoDB Administration topic in division GridFS, BSON Datatype and Administration Concepts of MongoDB

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

To ELABORATE: They are difficult to MANAGE for larger sharded CLUSTERS.
52.

To get a correct snapshot of a running mongod process, you must have _________ enabled.(a) journaling(b) replication(c) MMS(d) all of the mentionedThe question was posed to me during an online exam.I'd like to ask this question from MongoDB Administration in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer» RIGHT choice is (a) journaling

For EXPLANATION: WITHOUT journaling enabled, there is no GUARANTEE that the snapshot will be consistent or valid.
53.

The $rename operator logically performs a _______ of both the old name and the new name.(a) $unset(b) $set(c) $Nested(d) None of the mentionedThis question was posed to me in an international level competition.The query is from MongoDB documents in division GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer» CORRECT option is (a) $unset

Best explanation: If the field to RENAME does not EXIST in a DOCUMENT, $rename does nothing.
54.

Updates that include _________ of field names may result in the reordering of fields in the document.(a) Renaming(b) Joining(c) Nesting(d) None of the mentionedThis question was addressed to me in an online interview.This intriguing question originated from MongoDB documents in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Right answer is (a) Renaming

To explain: The $rename OPERATOR UPDATES the NAME of a FIELD.

55.

If your driver has a version number of 2.9.1, What is the major version?(a) 1(b) 2(c) 9(d) None of the mentionedThe question was asked during an online interview.Asked question is from MongoDB documents in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct choice is (b) 2

The best I can explain: DRIVER version NUMBERS use SEMANTIC versioning or “major.minor.patch” versioning SYSTEM.

56.

User-defined indexes on multiple fields is called ___________(a) composite index(b) secondary index(c) compound index(d) none of the mentionedThe question was posed to me in unit test.Asked question is from MongoDB documents topic in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer» RIGHT ANSWER is (C) compound index

Explanation: The order of FIELDS listed in a compound index has significance.
57.

An application communicates with MongoDB by way of a client library, called _____________(a) Driver(b) Parent(c) Rank(d) None of the mentionedThe question was asked during an online interview.This interesting question is from MongoDB documents in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer» CORRECT choice is (a) Driver

The best explanation: Driver HANDLES all INTERACTION with the database in a language APPROPRIATE to the APPLICATION.
58.

Point out the correct statement.(a) Update definitions define what fields to modify during an update(b) Query specifications, which define what fields to index(c) Index selectors, which define what records to select for read, update, and delete operations(d) All of the mentionedI had been asked this question in an interview for internship.This key question is from MongoDB documents in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct answer is (a) UPDATE definitions define what fields to modify during an update

To EXPLAIN: MongoDB stores all data in documents, which are JSON-style data structures COMPOSED of field-and-value PAIRS.

59.

Which of the following data structures are documents in MongoDB?(a) All database records(b) Query selectors(c) Update definitions(d) All of the mentionedI have been asked this question in an online interview.I need to ask this question from MongoDB documents in section GridFS, BSON Datatype and Administration Concepts of MongoDB

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

To EXPLAIN I WOULD say: Most user-accessible data STRUCTURES in MongoDB are DOCUMENTS.
60.

Index keys that are of the _______ type are more efficiently stored in the index.(a) Materialized Paths(b) BinData(c) String(d) None of the mentionedI got this question at a job interview.I'd like to ask this question from MongoDB documents topic in division GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

The CORRECT CHOICE is (B) BinData

The best explanation: Most MongoDB driver clients will INCLUDE the _id field and GENERATE an ObjectId before sending the insert operation to MongoDB.

61.

To store documents larger than the maximum size, MongoDB provides the _______ API.(a) Grid(b) MMS(c) GridFS(d) None of the mentionedI had been asked this question in an internship interview.My question is based upon MongoDB documents in chapter GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Right choice is (c) GridFS

To explain I WOULD say: MongoDB preserves the order of the document FIELDS following WRITE OPERATIONS.

62.

Point out the wrong statement.(a) Some documents created by internal MongoDB processes may have duplicate fields(b) no MongoDB process will ever add duplicate fields to an existing user document(c) The maximum BSON document size is 16 megabytes(d) None of the mentionedI had been asked this question during an interview.The above asked question is from MongoDB documents in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Right choice is (c) The maximum BSON document size is 16 megabytes

To EXPLAIN I WOULD say: The maximum document size helps ensure that a single document cannot USE EXCESSIVE AMOUNT of RAM or, during transmission, excessive amount of bandwidth.

63.

MongoDB documents are composed of field-and-value pairs and have the following structure?(a) field1:; value1(b) field1: value1;(c) field1: value1(d) none of the mentionedI have been asked this question in an online quiz.Origin of the question is MongoDB documents topic in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

The CORRECT answer is (C) field1: value1

The EXPLANATION: The value of a field can be any of the BSON data TYPES, including other documents, ARRAYS, and arrays of documents.

64.

Point out the correct statement.(a) MongoDB stores chunks on disk in the XML serialization format(b) MongoDB stores documents on disk in the BSON serialization format(c) MongoDB stores documents on RAM in the JSON serialization format(d) All of the mentionedI got this question during a job interview.Question is taken from MongoDB documents topic in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct choice is (a) MongoDB STORES chunks on disk in the XML serialization format

The EXPLANATION: BSON DOCUMENTS may have more than one field with the same name.

65.

BSON is a binary representation of ________ documents.(a) JSON(b) XML(c) JScript(d) All of the mentionedThis question was addressed to me in an interview for internship.This question is from MongoDB documents topic in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct answer is (a) JSON

Easy explanation: BSON CONTAINS more data TYPES than JSON.

66.

The __________ JavaScript shell and the MongoDB language drivers translate between BSON and the language-specific document representation.(a) mongod(b) mongo(c) iscript(d) none of the mentionedThis question was posed to me during an online exam.I'm obligated to ask this question of MongoDB documents in division GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct CHOICE is (B) mongo

Explanation: The value of a field can be any of the BSON data TYPES.

67.

Which of the following query is used to generate a new ObjectId, use the ObjectId() constructor with no argument?(a) x = ObjectIdAdd()(b) x = addObjectId()(c) x = ObjectId()(d) none of the mentionedThis question was addressed to me by my school principal while I was bunking the class.My doubt stems from ObjectId topic in chapter GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer» RIGHT option is (c) X = ObjectId()

The best I can EXPLAIN: ObjectId() constructor is USED with no argument for new OBJECT.
68.

__________ returns the JavaScript representation in the form of a string literal.(a) toStringJava()(b) toString()(c) String()(d) none of the mentionedI have been asked this question in an interview.This intriguing question comes from ObjectId in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Right option is (b) TOSTRING()

To EXPLAIN I would say: In previous VERSIONS, toString() returns the HEXADECIMAL string REPRESENTATION, which as of version 2.2 can be retrieved by the str property.

69.

The ______ field is always the first field in the document.(a) _id(b) id(c) Ob_id(d) None of the mentionedI got this question in an online quiz.This question is from ObjectId topic in division GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Right OPTION is (a) _id

For EXPLANATION: Updates that include renaming of FIELD NAMES may RESULT in the reordering of fields in the document.

70.

To ensure functioning replication, do not store values that are of the _______ regular expression type in the _id field.(a) JSON(b) XML(c) JScript(d) None of the mentionedThis question was addressed to me in an internship interview.I would like to ask this question from ObjectId topic in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Right option is (d) NONE of the mentioned

Best EXPLANATION: The _id FIELD may CONTAIN values of any BSON data type, other than an array.

71.

Point out the wrong statement.(a) The field names cannot start with the dollar sign ($) character(b) The field names cannot contain the dot (.) character(c) The field names cannot contain the null character(d) None of the mentionedThis question was posed to me in examination.I would like to ask this question from ObjectId in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

The correct ANSWER is (d) None of the mentioned

For EXPLANATION I WOULD say: Documents have CERTAIN RESTRICTIONS on field names.

72.

Which of the field is reserved for use as a primary key?(a) _id(b) _uid(c) _uuid(d) All of the mentionedI have been asked this question in an online quiz.My question is taken from ObjectId in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct answer is (a) _id

Easiest explanation: ID value value MUST be unique in the COLLECTION, is IMMUTABLE, and may be of any type other than an ARRAY.

73.

Object_Id is similar to _________ key in Relational Databases.(a) primary(b) secondary(c) composite(d) all of the mentionedI had been asked this question at a job interview.The question is from ObjectId in chapter GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

The CORRECT OPTION is (a) primary

Explanation: Object_Id is UNIQUE and cannot be CHANGED.

74.

Each data type has a corresponding number that can be used with the _______ operator to query documents by BSON type.(a) $type(b) $server(c) $agent(d) None of the mentionedI have been asked this question in a national level competition.My question is from BSON in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct ANSWER is (a) $type

The best I can explain: $type selects the documents where the value of the FIELD is an instance of the SPECIFIED numeric BSON type.

75.

There is _________ byte counter in BSON, starting with a random value.(a) 2(b) 3(c) 4(d) None of the mentionedThis question was posed to me in quiz.Query is from BSON topic in chapter GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer» RIGHT CHOICE is (b) 3

Easy explanation: OBJECTID is a 12-byte BSON type
76.

Point out the wrong statement.(a) BSON Date is a 32-bit integer that represents the number of milliseconds(b) The BSON timestamp type is for internal MongoDB use(c) If you need to query the database for exact, mathematically valid matches, use Ambiguity Precision(d) None of the mentionedI had been asked this question by my school teacher while I was bunking the class.I'm obligated to ask this question of BSON topic in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct answer is (a) BSON Date is a 32-bit integer that represents the NUMBER of milliseconds

To explain: This RESULTS in a representable date range of about 290 million YEARS into the past and future.

77.

Which of the following data type is depreciated?(a) Double(b) String(c) Object(d) UndefinedThe question was asked during an internship interview.My query is from BSON topic in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct option is (d) Undefined

The best I can EXPLAIN: MongoDB treats some TYPES as an EQUIVALENT for COMPARISON purposes.

78.

Point out the correct statement.(a) ObjectIds are small, likely unique, fast to generate, and ordered(b) ObjectIds are large, likely unique, and ordered(c) ObjectIds values consists of 18-byte(d) All of the mentionedI have been asked this question during an online exam.I want to ask this question from BSON in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

The correct choice is (a) OBJECTIDS are SMALL, likely unique, FAST to generate, and ordered

Explanation: In MongoDB, DOCUMENTS stored in a collection require a unique _id field that acts as a PRIMARY key.

79.

The ___ field contains the sequence number of the chunk.(a) x(b) array(c) field(d) nThe question was asked in quiz.Origin of the question is GridFS topic in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct option is (d) n

Explanation: GridFS NUMBERS all CHUNKS, STARTING with 0.

80.

_________ is a binary serialization format used to store documents and make remote procedure calls in MongoDB.(a) BSON(b) GridFS(c) JSON(d) None of the mentionedThe question was posed to me at a job interview.Question is taken from BSON in division GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct answer is (a) BSON

For EXPLANATION: BSON supports MANY DATA types as VALUES in documents.

81.

GridFS uses a _________ index on the chunks collection for the files_id and n fields.(a) unique(b) single(c) non unique(d) none of the mentionedI have been asked this question during an online exam.Question is from GridFS in division GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

The CORRECT ANSWER is (a) unique

The explanation is: The files_id field CONTAINS the _id of the chunk’s “PARENT” document.

82.

Each document in the __________ collection represents a distinct chunk of a file as represented in the GridFS store.(a) chunks(b) files(c) bson(d) none of the mentionedI have been asked this question by my school teacher while I was bunking the class.My question comes from GridFS in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

The correct ANSWER is (a) chunks

To elaborate: Each chunk is identified by its unique OBJECTID STORED in its _id field.

83.

MongoDB represents queries as ___________ objects.(a) BSON(b) JSON(c) GSON(d) None of the mentionedThis question was addressed to me during an online interview.My question comes from GridFS in chapter GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer» CORRECT choice is (a) BSON

To elaborate: As a client program ASSEMBLES a query in MONGODB, it BUILDS a BSON OBJECT, not a string.
84.

Point out the wrong statement.(a) Chunks in the context of GridFS is related to the use of the term chunks in the context of sharding(b) The default chunk size changed from 256k to 255k(c) If you need to query the database for exact, mathematically valid matches, use Ambiguity Precision(d) None of the mentionedThis question was addressed to me in class test.My question is taken from GridFS in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct choice is (a) CHUNKS in the CONTEXT of GridFS is related to the USE of the term chunks in the context of sharding

For EXPLANATION: By default, GridFS uses two collections with names prefixed by fs bucket.

85.

When you query a GridFS store for a file, the _______ will reassemble the chunks as needed.(a) client(b) Server(c) Agent(d) None of the mentionedI got this question in quiz.My question comes from GridFS topic in division GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Right answer is (a) client

Easiest explanation: You also can ACCESS information from ARBITRARY sections of FILES, which allows you to “skip” into the MIDDLE of a VIDEO or audio file.

86.

By default GridFS limits chunk size to ______ k.(a) 225(b) 255(c) 256(d) None of the mentionedThis question was posed to me in an interview for internship.This question is from GridFS in section GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer»

Correct choice is (b) 255

Best EXPLANATION: GridFS is useful not only for storing files that EXCEED 16MB but also for storing any files for which you want access WITHOUT having to load the entire file into MEMORY.

87.

Point out the correct statement.(a) GridFS uses two collections to store files(b) You cannot perform range queries on files stored through GridFS(c) Applications that handle temporal and spatial data often require capturing fractional units of currency(d) All of the mentionedI got this question in an online interview.This intriguing question originated from GridFS topic in division GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer» RIGHT option is (a) GRIDFS uses two collections to STORE files

The EXPLANATION is: One collection stores the file chunks, and the other stores file metadata.
88.

___________ is a specification for storing and retrieving files that exceed the BSON-document size limit of 16MB.(a) FSpec(b) GridFS(c) Grid(d) None of the mentionedThis question was addressed to me in final exam.I need to ask this question from GridFS topic in portion GridFS, BSON Datatype and Administration Concepts of MongoDB

Answer» CORRECT CHOICE is (b) GridFS

The explanation: Instead of storing a file in a single document, GridFS divides a file into PARTS, or chunks.