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 wrong statement.(a) When fully synchronized, the destination shard connects to the config database and updates the cluster metadata with the new location for the chunk(b) The destination shard builds any indexes required by the source that do not exist on the destination(c) The destination shard begins requesting documents in the chunk and starts receiving copies of the data(d) None of the mentionedThe question was posed to me in quiz.My query is from Sharding Mechanics topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct choice is (d) None of the mentioned

For explanation I would say: After the destination shard completes the UPDATE of the METADATA, and once there are no open cursors on the chunk, the SOURCE shard deletes its copy of the DOCUMENTS.

52.

Use _______ migration to distribute data during bulk inserts.(a) automatic(b) manual(c) temporary(d) all of the mentionedI got this question by my college director while I was bunking the class.My doubt stems from Sharding Mechanics in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct CHOICE is (B) manual

To explain: SHARD KEYS are IMMUTABLE and cannot be changed after insertion.

53.

Point out the correct statement.(a) Splitting is the process MongoDB uses to distribute data of a sharded collection evenly across a sharded cluster(b) Any mongos instance in the cluster can start a balancing round(c) When a shard has too many of a sharded collection’s chunks compared to other shards, MongoDB splits balances the chunks across the shards(d) All of the mentionedThis question was posed to me in an international level competition.I need to ask this question from Sharding Mechanics topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer» CORRECT answer is (b) Any mongos instance in the CLUSTER can START a balancing round

For explanation I would say: When a balancer process is active, the RESPONSIBLE mongos acquires a “LOCK” by modifying a document in the lock collection in the Config Database.
54.

A shard key that increases monotonically will not hinder performance if most of your write operations are ____ operations.(a) insert()(b) update()(c) delete()(d) all of the mentionedI got this question in a national level competition.This question is from Sharded Cluster Behavior topic in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct choice is (B) update()

Best explanation: Generally, choose shard KEYS that have both HIGH CARDINALITY and will distribute write operations across the entire CLUSTER.

55.

The _________ process is responsible for redistributing the chunks of a sharded collection evenly among the shards for every sharded collection.(a) Balancer(b) Sharder(c) Replicator(d) All of the mentionedI got this question in homework.This intriguing question originated from Sharding Mechanics topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The correct CHOICE is (a) BALANCER

To EXPLAIN I would say: By DEFAULT, the balancer PROCESS is always enabled.

56.

MongoDB generates _______ values upon document creation to produce a unique identifier for the object.(a) ObjectId(b) CompId(c) DoctId(d) All of the mentionedThe question was posed to me by my college professor while I was bunking the class.My question comes from Sharded Cluster Behavior topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct choice is (a) ObjectId

The best explanation: Some possible shard KEYS will allow your APPLICATION to take advantage of the increased WRITE capacity that the CLUSTER can provide, while others do not.

57.

You can control how many chunks MongoDB will create with the ___________ parameter.(a) numChunks(b) numInitialChunks(c) numberofchunks(d) all of the mentionedI have been asked this question in an online quiz.Enquiry is from Sharded Cluster Behavior topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct CHOICE is (B) numInitialChunks

Explanation: APPLICATIONS do not need to COMPUTE HASHES.

58.

MongoDB automatically computes the hashes when resolving queries using ______ indexes.(a) hashed(b) unique(c) muiltkey(d) all of the mentionedThis question was posed to me in an interview.This interesting question is from Sharded Cluster Behavior topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct answer is (C) muiltkey

Easiest explanation: During a chunk MIGRATION, the destination shard is sent all the CURRENT documents in the chunk from the origin shard.

59.

Point out the correct statement.(a) Hashed keys do not work well with fields that increase monotonically like ObjectId values or timestamps(b) If you shard an empty collection using a hashed shard key, MongoDB will automatically create and migrate chunks so that each shard has two chunks(c) Hashed keys work well with ObjectId values only(d) All of the mentionedI had been asked this question by my school teacher while I was bunking the class.Origin of the question is Sharded Cluster Behavior in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The correct answer is (b) If you SHARD an empty collection using a hashed shard KEY, MongoDB will automatically create and migrate chunks so that each shard has two chunks

Explanation: Hashed keys work well with fields that INCREASE MONOTONICALLY like ObjectId values or timestamps.

60.

Hashed shard keys use a ________ index of a single field as the shard key to partition data across your sharded cluster.(a) hashed(b) unique(c) multkikey(d) all of the mentionedI had been asked this question in an online interview.My question is based upon Sharded Cluster Behavior in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct option is (a) HASHED

Explanation: The field you choose as your hashed shard KEY should have a good cardinality, or large NUMBER of different VALUES.

61.

The index on the shard key cannot be a _________ index.(a) single(b) multkikey(c) unique(d) all of the mentionedThe question was posed to me in examination.The origin of the question is Sharded Cluster Behavior in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The correct choice is (B) multkikey

To elaborate: Shard KEYS are immutable and cannot be CHANGED after INSERTION.

62.

Point out the correct statement.(a) The shard key determines the distribution of the collection’s documents among the cluster’s shards(b) The shard key is either an indexed field or an indexed compound field that exists in every document in the collection(c) Each range, or chunk, defines a non-overlapping range of shard key values(d) All of the mentionedThis question was posed to me in semester exam.The question is from Sharded Cluster Behavior in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right answer is (d) All of the mentioned

For explanation: MONGODB DISTRIBUTES the CHUNKS, and their documents, among the shards in the CLUSTER.

63.

When a chunk grows beyond the chunk size, MongoDB attempts to split the chunk into smaller chunks, always based on ranges in the _____________(a) replica set(b) shard key(c) tag sets(d) all of the mentionedThe question was posed to me in an international level competition.My question is taken from Sharded Cluster Behavior topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The CORRECT OPTION is (c) tag sets

For EXPLANATION: Administrators create and associate tags with ranges of the shard key, and then ASSIGN those tags to the shards.

64.

The ______ instances are the routers for the cluster.(a) mongod(b) mongos(c) collection(d) all of the mentionedI have been asked this question in semester exam.Asked question is from Cluster Architectures in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer» CORRECT CHOICE is (b) mongos

The BEST explanation: Typically, DEPLOYMENTS have one mongos instance on each application server.
65.

For most deployments, the default value of chunk is _____ megabytes is ideal.(a) 16(b) 32(c) 64(d) 72The question was posed to me in an internship interview.I want to ask this question from Cluster Architectures topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer» RIGHT choice is (c) 64

To explain I WOULD say: CHUNK size is user configurable.
66.

The shards manage _______ migrations as a background operation between an origin shard and a destination shard.(a) cluster(b) shard(c) chunk(d) all of the mentionedThis question was addressed to me in class test.I need to ask this question from Cluster Architectures topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right answer is (c) chunk

For EXPLANATION: During a chunk migration, the destination shard is sent all the CURRENT DOCUMENTS in the chunk from the ORIGIN shard.

67.

_________ is a background process that keeps chunks from growing too large.(a) Splitting(b) Balancing(c) Chunking(d) All of the mentionedThis question was addressed to me in an online quiz.Enquiry is from Cluster Architectures topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The correct ANSWER is (a) Splitting

For EXPLANATION: When a chunk grows beyond a specified chunk SIZE, MongoDB splits the chunk in half. Inserts and updates TRIGGERS splits.

68.

Point out the wrong statement.(a) To create splits, MongoDB does migrate any data or affect the shards(b) The addition of new data or the addition of new servers can result in data distribution imbalances within the cluster(c) The balancer can run from any of the query routers in a cluster(d) All of the mentionedI have been asked this question in a job interview.This interesting question is from Cluster Architectures topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The CORRECT option is (a) To create SPLITS, MongoDB does migrate any data or affect the shards

Easy explanation: The balancer is a BACKGROUND process that manages CHUNK migrations.

69.

How many background process runs behind balanced cluster?(a) 1(b) 2(c) 3(d) All of the mentionedI got this question in final exam.This interesting question is from Cluster Architectures in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer» RIGHT option is (b) 2

The explanation is: MongoDB ensures a BALANCED cluster using TWO background process: SPLITTING and the balancer.
70.

Tags are the primary mechanism to control the behavior of the _______ and the distribution of chunks in a cluster.(a) Balancer(b) Collector(c) Compactor(d) All of the mentionedThis question was addressed to me in homework.This interesting question is from Cluster Architectures topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The CORRECT answer is (a) Balancer

To explain: Tag aware sharding SERVES to improve the LOCALITY of data for sharded clusters that SPAN multiple data centers

71.

Point out the correct statement.(a) Use sharded clusters if your data set approaches or exceeds the storage capacity of a single MongoDB instance(b) Use sharded clusters if a single MongoDB instance can meet the demands of your write operations, and all other approaches have not reduced contention(c) Use sharded clusters if the size of your system’s active working set will soon exceed the capacity of your system’s minimum RAM(d) All of the mentionedThis question was posed to me in an online interview.This intriguing question originated from Cluster Architectures in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct option is (a) USE sharded clusters if your data set approaches or EXCEEDS the storage capacity of a single MongoDB instance

To EXPLAIN: The balancer is a background PROCESS that manages chunk migrations.

72.

MongoDB allows administrators to direct the balancing policy using ______ aware sharding.(a) tag(b) replica(c) rack(d) all of the mentionedThis question was posed to me by my college director while I was bunking the class.The doubt is from Cluster Architectures in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The correct option is (c) rack

To ELABORATE: ADMINISTRATORS create and associate tags with ranges of the SHARD KEY, and then assign those tags to the shards.

73.

With hash based partitioning, two documents with _____ shard key values are unlikely to be part of the same chunk.(a) close(b) open(c) partially close(d) all of the mentionedThe question was posed to me during an interview.Asked question is from Sharding Concepts in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct OPTION is (a) close

The best I can explain: This ENSURES a more RANDOM DISTRIBUTION of a COLLECTION in the cluster.

74.

To divide the shard key values into chunks, MongoDB uses _____ based partitioning.(a) range(b) b tree(c) document(d) isMasterThe question was asked in examination.Query is from Sharding Concepts in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The correct ANSWER is (a) range

Explanation: Hash BASED PARTITIONING can ALSO be used.

75.

A _________ key is either an indexed field or an indexed compound field that exists in every document in the collection.(a) cluster(b) shard(c) partition(d) all of the mentionedI had been asked this question in a job interview.This intriguing question comes from Sharding Concepts in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right ANSWER is (B) shard

To elaborate: SHARDING PARTITIONS a collection’s data by the shard KEY.

76.

Production sharded clusters have exactly ______ config servers.(a) 1(b) 2(c) 3(d) 4I have been asked this question during a job interview.This intriguing question originated from Sharding Concepts topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The correct answer is (c) 3

Best EXPLANATION: Do not deploy PRODUCTION CLUSTERS without 3 config servers.

77.

Point out the wrong statement.(a) For hash-based sharding, MongoDB divides the data set into ranges determined by the shard key values to provide hash based partitioning(b) Cloud-based providers may only allow users to provision smaller instances(c) For hash based partitioning, MongoDB computes a hash of a field’s value, and then uses these hashes to create chunks(d) All of the mentionedThis question was addressed to me in final exam.My doubt stems from Sharding Concepts in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right choice is (a) For hash-BASED sharding, MongoDB divides the data set into ranges determined by the shard KEY values to PROVIDE hash based PARTITIONING

Easiest explanation: For range-based sharding, MongoDB divides the data set into ranges determined by the shard key values to provide range based partitioning.

78.

The query router uses __________ to target operations to specific shards.(a) metadata(b) cluster(c) replica(d) all of the mentionedI had been asked this question by my school principal while I was bunking the class.The origin of the question is Sharding Concepts in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right ANSWER is (a) metadata

Easy EXPLANATION: For development and testing PURPOSES only, each shard can be a single mongod INSTEAD of a replica SET.

79.

________ servers store the cluster’s metadata.(a) Local(b) Config(c) Master(d) All of the mentionedThis question was addressed to me during a job interview.I'd like to ask this question from Sharding Concepts in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer» RIGHT ANSWER is (a) Local

For explanation I would SAY: This DATA contains a mapping of the cluster’s data SET to the shards.
80.

Point out the correct statement.(a) MongoDB distributes data, or shards, at the collection level(b) To shard a document, you need to select a shard key(c) MongoDB divides the shard key values into replica sets(d) All of the mentionedI have been asked this question in final exam.This interesting question is from Sharding Concepts topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer» RIGHT ANSWER is (a) MONGODB distributes data, or shards, at the collection level

Easiest explanation: SHARDING partitions a collection’s data by the shard KEY.
81.

A sharded cluster can contain __________ query router to divide the client request load.(a) 1(b) 0(c) more than 1(d) all of the mentionedI had been asked this question in a job interview.I would like to ask this question from Sharding Concepts topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right choice is (c) more than 1

Explanation: A CLIENT sends REQUESTS to one query router. Most SHARDED clusters have many query ROUTERS.

82.

MongoDB uses _________ to support deployments with very large data sets and high throughput operations.(a) sharding(b) replication(c) replica sets(d) all of the mentionedI got this question in an interview for internship.I would like to ask this question from Sharding Introduction in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct choice is (a) SHARDING

Explanation: Sharding is a METHOD for storing DATA across MULTIPLE MACHINES.

83.

To provide high availability and data consistency, in a production sharded cluster, each shard is a ___________(a) replica set(b) cluster(c) partition(d) all of the mentionedThis question was posed to me in quiz.This intriguing question originated from Sharding Introduction topic in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Correct ANSWER is (a) replica set

Easiest explanation: Each SHARD stores less data as the cluster grows.

84.

How many components are present in sharded cluster?(a) 1(b) 2(c) 3(d) 4This question was addressed to me in a job interview.The query is from Sharding Introduction in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right ANSWER is (B) 2

The BEST I can explain: Sharded cluster has the following components: shards, query routers and CONFIG servers.

85.

MongoDB supports sharding through the configuration of a sharded ______(a) shapes(b) clusters(c) sets(d) all of the mentionedI got this question during an interview.The doubt is from Sharding Introduction in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer» RIGHT option is (b) clusters

The BEST EXPLANATION: Sharding reduces the NUMBER of operations each SHARD handles.
86.

_______ divides the data set and distributes the data over multiple servers, or shards.(a) Vertical(b) Sharding(c) Partition(d) All of the mentionedThis question was addressed to me in unit test.The question is from Sharding Introduction topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right answer is (B) Sharding

The EXPLANATION is: Each SHARD is an independent database, and COLLECTIVELY, the shards make up a single logical database.

87.

Point out the wrong statement.(a) Scaling by adding capacity do not have limitations.(b) cloud-based providers may only allow users to provision smaller instances(c) There is a practical maximum capability for vertical scaling(d) All of the mentionedThe question was posed to me in an international level competition.The above asked question is from Sharding Introduction topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The correct option is (a) Scaling by adding capacity do not have limitations.

Best explanation: HIGH performance systems with large NUMBERS of CPUs and large amount of RAM are disproportionately more EXPENSIVE than smaller systems

88.

_______ scaling adds more CPU and storage resources to increase capacity.(a) Horizontal(b) Vertical(c) Partition(d) All of the mentionedI have been asked this question during an online exam.This question is from Sharding Introduction in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The CORRECT answer is (b) Vertical

Easy explanation: When the PRIMARY STEPS down, the mongod closes all client connections.

89.

How many types of sharding exist in MongoDB?(a) 1(b) 2(c) 3(d) All of the mentionedThis question was posed to me in an international level competition.This interesting question is from Sharding Introduction in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right answer is (b) 2

The EXPLANATION is: MONGODB have two basic approaches: VERTICAL SCALING and SHARDING.

90.

Point out the correct statement.(a) High query rates can exhaust the CPU capacity of the server(b) Database systems with small data sets and high throughput applications can challenge the capacity of a single server(c) Smaller data sets exceed the storage capacity of a single machine(d) All of the mentionedI have been asked this question in a job interview.I need to ask this question from Sharding Introduction topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

The correct option is (a) High query rates can EXHAUST the CPU capacity of the server

Explanation: Working set SIZES larger than the SYSTEM’s RAM stress the I/O capacity of disk drives.