

InterviewSolution
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. |
_________ is an internal command that supports the sharding functionality.(a) getBalancerHost()(b) getShardMap(c) enableSharding()(d) all of the mentionedThe question was posed to me during a job interview.Query is from Sharded Cluster Data Management topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Right option is (B) getShardMap |
|
2. |
You can only issue listShards against the ________ database.(a) local(b) admin(c) temp(d) none of the mentionedThe question was asked during an online interview.This intriguing question comes from Sharded Cluster Data Management topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The CORRECT CHOICE is (B) admin |
|
3. |
Which of the following command is used to determine split points?(a) splitVector(b) medianKey(c) movePrimary(d) none of the mentionedThe question was posed to me in semester exam.I need to ask this question from Sharded Cluster Data Management in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct choice is (a) splitVector |
|
4. |
Which of the following command that validates index on shard key?(a) checkShardingIndex(b) checkSIndex(c) enableSharding(d) all of the mentionedThe question was posed to me in class test.This key question is from Sharded Cluster Data Management topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The CORRECT choice is (a) checkShardingIndex |
|
5. |
Point out the wrong statement.(a) moveChunks provides the ability to combine chunks on a single shard(b) setShardVersion is used to set the config server version(c) shardCollection enables the sharding functionality for a collection, allowing the collection to be sharded(d) none of the mentionedI had been asked this question in exam.This intriguing question comes from Sharded Cluster Data Management in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct answer is (d) none of the mentioned |
|
6. |
_______ forces an update to the cluster metadata cached by a mongos.(a) config(b) flushconf(c) flushRouterConfig(d) all of the mentionedI had been asked this question by my school principal while I was bunking the class.The question is from Sharded Cluster Data Management topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The correct option is (c) flushRouterConfig |
|
7. |
_________ waits for a change in ping state from one of the mongos in the sharded cluster.(a) sh.waitForBalancer()(b) sh.startBalancer()(c) sh.waitForPingChange()(d) all of the mentionedThis question was addressed to me in semester exam.The above asked question is from Sharded Cluster Data Management topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct option is (c) sh.waitForPingChange() |
|
8. |
Point out the correct statement.(a) sh.deadForDLock() waits for a specified distributed sharded cluster lock(b) sh.waitForBalancerOff() waits until the balancer stops running(c) sh.statusserver() reports on the status of a sharded cluster, as db.printShardingStatus()(d) all of the mentionedThe question was asked by my school teacher while I was bunking the class.I need to ask this question from Sharded Cluster Data Management in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct OPTION is (a) sh.deadForDLock() waits for a specified distributed SHARDED cluster lock |
|
9. |
_______ enables the balancer and waits for balancing to start.(a) sh.waitForBalancer()(b) sh.startBalancer()(c) sh.waitForDLock()(d) all of the mentionedThe question was asked in exam.My question is from Sharded Cluster Data Management topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct ANSWER is (B) sh.startBalancer() |
|
10. |
_______ activates the sharded collection balancer process if previously disabled using sh.disableBalancing().(a) sh.getBalancerHost()(b) sh.enableBalancing()(c) sh.enableSharding()(d) all of the mentionedI got this question by my school principal while I was bunking the class.Origin of the question is Sharded Cluster Data Management topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The CORRECT CHOICE is (a) sh.getBalancerHost() |
|
11. |
_________ disable balancing on a single collection in a sharded database.(a) sh.removeTagRange()(b) sh._checkMongos()(c) sh.disableBalancing()(d) none of the mentionedThis question was posed to me during an interview.My enquiry is from Sharded Cluster Data Management topic in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» RIGHT ANSWER is (c) sh.disableBalancing() To explain: sh.disableBalancing() does not AFFECT balancing of other collections in a sharded CLUSTER. |
|
12. |
_________ removes an association between a range shard keys and a shard tag.(a) sh.removeTagRange()(b) sh._checkMongos()(c) sh.disableBalancing()(d) none of the mentionedI have been asked this question in an international level competition.My question is based upon Sharded Cluster Data Management topic in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct ANSWER is (a) sh.removeTagRange() |
|
13. |
_________ reports on the last chunk migration.(a) sh._checkMongos()(b) sh.addShard()(c) sh._lastMigration()(d) all of the mentionedThe question was asked in an interview for internship.I want to ask this question from Sharded Cluster Data Management topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The correct CHOICE is (c) sh._lastMigration() |
|
14. |
Point out the wrong statement.(a) The best way to ensure a field has unique values is to generate universally unique identifiers (UUID,) such as MongoDB’s ‘ObjectId values(b) Most deployments will not need to shard the files collection(c) The files collection is typically small, and only contains metadata(d) None of the mentionedThis question was addressed to me during an internship interview.Origin of the question is Sharded Cluster Data Management topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct option is (d) NONE of the mentioned |
|
15. |
________ tests to see if the mongo shell is connected to a mongos instance.(a) sh._checkMongos()(b) sh.addShard()(c) sh._lastMigration()(d) all of the mentionedThis question was posed to me by my college director while I was bunking the class.Question is taken from Sharded Cluster Data Management in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT OPTION is (a) sh._checkMongos() Explanation: The sh._checkMongos() method throws an error message if the mongo shell is not CONNECTED to a mongos INSTANCE. |
|
16. |
_______ reports on the active balancer lock, if it exists.(a) sh._checkFullName()(b) sh._adminCommand()(c) sh.getBalancerLockDetails()(d) all of the mentionedThe question was asked by my school principal while I was bunking the class.Query is from Sharded Cluster Data Management in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT option is (c) sh.getBalancerLockDetails() The best EXPLANATION: sh._checkFullName() TESTS a namespace to DETERMINE if its well FORMED. |
|
17. |
Point out the correct statement.(a) The unique constraint on indexes ensures that only one document can have a value for a field in a collection(b) MongoDB support creating new unique indexes in sharded collections(c) If you use a compound shard key, you cannot enforce uniqueness on the combination of component keys in the shard key(d) All of the mentionedI had been asked this question during an interview.I'd like to ask this question from Sharded Cluster Data Management topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Right ANSWER is (a) The UNIQUE constraint on indexes ensures that only one document can have a value for a FIELD in a collection |
|
18. |
_______ runs a database command against the admin database of a mongos instance.(a) sh._checkFullName()(b) sh._adminCommand()(c) sh.getBalancerLockDetails()(d) all of the mentionedI had been asked this question during an internship interview.I'm obligated to ask this question of Sharded Cluster Data Management topic in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT option is (b) sh._adminCommand() The best EXPLANATION: sh._adminCommand() runs a database command against the ADMIN database, like db.runCommand(), but can CONFIRM that it is ISSUED against a mongos. |
|
19. |
Use ________ to ensure that the balancer migrates documents that exist within the specified range to a specific shard.(a) sh.addShardTag()(b) sh.addTag()(c) sh.aShardTag()(d) all of the mentionedThis question was addressed to me during an interview.This interesting question is from Troubleshooting Sharded Cluster topic in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The CORRECT choice is (a) sh.addShardTag() |
|
20. |
Which of the following parameter represents minimum value of the shard key range to include in the tag?(a) min(b) max(c) maximum(d) minimumThe question was posed to me in an internship interview.I would like to ask this question from Troubleshooting Sharded Cluster in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Right option is (d) MINIMUM |
|
21. |
Each document in the tags holds the ________ of the sharded collection and a minimum shard key value.(a) tag(b) chunk(c) namespace(d) sizeI got this question in class test.My doubt is from Troubleshooting Sharded Cluster topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT choice is (c) namespace Explanation: In most circumstances, you should LEAVE chunk splitting to the AUTOMATED processes WITHIN MongoDB. |
|
22. |
To assign a tag to a range of shard keys use the _________ method when connected to a mongos instance.(a) sh.addTagRange()(b) sh.splitFind()(c) sh.Range()(d) all of the mentionedThe question was posed to me during an online interview.I would like to ask this question from Troubleshooting Sharded Cluster topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT choice is (a) sh.addTagRange() To explain I WOULD say: You may delete tag assignment from a shard KEY range by removing the CORRESPONDING DOCUMENT from the tags collection of the config database. |
|
23. |
Point out the wrong statement.(a) You cannot overlap defined ranges, or tag the same range more than once(b) The mongod provides a helper for removing a tag range(c) The output from sh.status() lists tags associated with a shard, if any, for each shard(d) None of the mentionedI had been asked this question during an interview for a job.The doubt is from Troubleshooting Sharded Cluster in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» RIGHT CHOICE is (b) The mongod provides a helper for REMOVING a TAG range To explain: The mongod does not provide a helper for removing a tag range. |
|
24. |
________ associates a shard with a tag or identifier.(a) sh.collects()(b) sh.addShardTag(c) sh.results()(d) all of the mentionedThis question was addressed to me in unit test.The origin of the question is Troubleshooting Sharded Cluster topic in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct answer is (b) sh.addShardTag |
|
25. |
_________ is used to remove tags from a particular shard.(a) sh.removeTag()(b) sh.removeShard()(c) sh.removeShardTag()(d) all of the mentionedI got this question at a job interview.My query is from Troubleshooting Sharded Cluster in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT answer is (c) sh.removeShardTag() Best explanation: You MAY REMOVE TAGS from a particular shard using the sh.removeShardTag() METHOD when connected to a mongos instance. |
|
26. |
Point out the correct statement.(a) In some instances, MongoDB cannot split the no-longer jumbo chunk, such as a chunk with a range of single shard key value(b) To ensure that mongos instances update their cluster information cache, run flushConfig in the admin database(c) In a sharded cluster, you cannot use tags to associate specific ranges of a shard key with a specific shard or subset of shards(d) All of the mentionedThe question was asked in an interview for internship.The above asked question is from Troubleshooting Sharded Cluster in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct CHOICE is (a) In some instances, MongoDB cannot split the no-longer JUMBO CHUNK, such as a chunk with a range of single shard key value |
|
27. |
The preferred way to clear the _________ flag from a chunk is to attempt to split the chunk.(a) boolean(b) jumbo(c) change(d) all of the mentionedThis question was addressed to me in an interview.My question is taken from Troubleshooting Sharded Cluster in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct ANSWER is (b) jumbo |
|
28. |
The mergeChunks command requires at least _______ empty input chunk.(a) one(b) two(c) three(d) all of the mentionedThis question was addressed to me in homework.Enquiry is from Sharded Cluster Maintenance topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct OPTION is (a) one |
|
29. |
sh.splitFind () Splits the chunk that contains the shard key value specified by the query at the chunk’s ______ point.(a) smean(b) stdev(c) median(d) all of the mentionedThis question was posed to me during an internship interview.The origin of the question is Sharded Cluster Maintenance in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT option is (C) median To explain I would say: It may be BENEFICIAL to pre-split MANUALLY an empty collection using methods such as sh.splitFind(). |
|
30. |
_________ splits a chunk at the shard key value specified by the query.(a) sh.Find()(b) sh.splitFind()(c) sh.split()(d) sh.splitAtThis question was addressed to me in quiz.This interesting question is from Sharded Cluster Maintenance topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Right answer is (d) sh.splitAt |
|
31. |
__________ splits the chunk that contains the shard key value specified by the query at the chunk’s median point.(a) sh.Find()(b) sh.splitFind()(c) sh.split()(d) all of the mentionedThe question was posed to me in final exam.This interesting question is from Sharded Cluster Maintenance in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The correct choice is (b) sh.splitFind() |
|
32. |
Point out the wrong statement.(a) If a collection already has data, MongoDB automatically splits the collection’s data when you enable sharding for the collection(b) Subsequent attempts to manually create splits can lead to unpredictable chunk ranges and sizes as well as inefficient or ineffective balancing behavior(c) MongoDB creates splits only after an insert operation(d) None of the mentionedThe question was asked in an interview for job.I'm obligated to ask this question of Sharded Cluster Maintenance in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The correct choice is (d) None of the mentioned |
|
33. |
Use ________ to determine the current chunk ranges across the cluster.(a) sh.collects()(b) sh.status()(c) sh.results()(d) all of the mentionedThis question was posed to me in unit test.Enquiry is from Sharded Cluster Maintenance in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The correct OPTION is (b) sh.status() |
|
34. |
MongoDB provides the _________ command to combine contiguous chunk ranges into a single chunk.(a) helpchunks(b) moveChunks(c) mergeChunks(d) all of the mentionedThe question was asked during an internship interview.Question is from Sharded Cluster Maintenance in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The CORRECT answer is (c) mergeChunks |
|
35. |
Point out the correct statement.(a) Pre-splitting the chunk ranges in an empty sharded collection allows clients to insert data into an already partitioned collection(b) MongoDB cannot create enough chunks or distribute data fast enough to support required throughput(c) Chunk migration does not require copying all the data in the chunk from one shard to another(d) All of the mentionedI had been asked this question during an internship interview.This question is from Sharded Cluster Maintenance in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The correct answer is (a) Pre-splitting the chunk ranges in an empty sharded collection ALLOWS clients to insert data into an ALREADY PARTITIONED collection |
|
36. |
Split empty chunks in your collection by manually performing the ______ command on chunks.(a) distrbute(b) split(c) change(d) all of the mentionedI had been asked this question in a national level competition.Asked question is from Sharded Cluster Maintenance topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Right CHOICE is (b) split |
|
37. |
If the collection is empty then MongoDB will create the index as part of the ________(a) shardCollectionkey()(b) shardCollection()(c) keyCollection()(d) all of the mentionedI got this question during an online exam.The origin of the question is Cluster Deployment in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct answer is (b) shardCollection() |
|
38. |
Changing the _______ option will change the port that mongod listens for incoming connections on.(a) –shardsrvkey(b) –shardsrv(c) –shard(d) All of the mentionedThis question was addressed to me during a job interview.This intriguing question comes from Cluster Deployment topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT ANSWER is (b) –shardsrv To elaborate: The single-shard CLUSTER is now a non-sharded replica set that will accept read and write OPERATIONS on the data set. |
|
39. |
The _______ collection keeps track of the active components in the sharded cluster.(a) deploys(b) lockpings(c) locks(d) all of the mentionedThe question was posed to me in an online interview.The query is from Cluster Deployment in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT option is (B) lockpings Best explanation: The locks COLLECTION STORES a distributed lock. |
|
40. |
________ is a string that holds the address of the client, a mongos instance that initiates this change.(a) config.changelog.serverAddr(b) config.changelog.clientAddr(c) config.changelog.time(d) all of the mentionedThis question was posed to me in an online quiz.Query is from Cluster Deployment topic in section Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The CORRECT OPTION is (b) config.changelog.clientAddr |
|
41. |
Point out the wrong statement.(a) Database servers store the metadata for a sharded cluster(b) Always back up the config database before doing any maintenance on the config server(c) The mongos instances cache metadata and use it to route read and write operations to shards(d) None of the mentionedThe question was posed to me in examination.My question is based upon Cluster Deployment in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» RIGHT choice is (a) DATABASE servers store the metadata for a sharded cluster For explanation: The metadata REFLECTS STATE and organization of the sharded data sets and SYSTEM. |
|
42. |
Point out the correct statement.(a) The local database supports sharded cluster operation(b) The config database is a dependable API, and users should not write data to the config database in the course of normal operation or maintenance(c) Modification of the config database on a functioning system may lead to instability or inconsistent data sets(d) All of the mentionedThe question was posed to me during an interview.This interesting question is from Cluster Deployment in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Right option is (C) Modification of the config DATABASE on a functioning system may lead to instability or INCONSISTENT data sets |
|
43. |
You can return a list of the collections, with the following helper ______________(a) show collects(b) show collection(c) show collections(d) all of the mentionedThe question was posed to me in an international level competition.I'm obligated to ask this question of Cluster Deployment topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Right CHOICE is (C) SHOW collections |
|
44. |
The _________ collection stores a document for each sharded collection in the cluster.(a) help(b) shards(c) collections(d) all of the mentionedThis question was posed to me during an interview.The above asked question is from Cluster Deployment in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The correct answer is (c) collections |
|
45. |
The ________ collection stores a document for each change to the metadata of a sharded collection.(a) version(b) changelog(c) settings(d) all of the mentionedThe question was posed to me by my college professor while I was bunking the class.My doubt stems from Cluster Deployment in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Right answer is (b) changelog |
|
46. |
You can set the _________ option on the balancer configuration to set different write concern semantics.(a) writeConcern(b) updateConcern(c) readConcern(d) all of the mentionedThis question was addressed to me by my college director while I was bunking the class.This interesting question is from Sharding Mechanics topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» The correct choice is (a) writeConcern |
|
47. |
The default value _________ becomes true for all chunk migrations.(a) secThrottle(b) secondaryThrottle(c) primaryThrottle(d) all of the mentionedI had been asked this question in an international level competition.My question is based upon Sharding Mechanics in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Correct answer is (b) secondaryThrottle |
|
48. |
________ can alter the behavior so that the delete phase of the current migration blocks the start of the next chunk migration.(a) _waitForUpdate(b) _waitForDelete(c) _waitForInsert(d) All of the mentionedThe question was posed to me in unit test.My doubt is from Sharding Mechanics in division Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» RIGHT answer is (b) _waitForDelete To explain I would SAY: The _waitForDelete is generally for INTERNAL TESTING PURPOSES. |
|
49. |
The source shard is responsible for incoming ______ operations for the chunk.(a) read(b) write(c) read-write(d) all of the mentionedThis question was posed to me in class test.The query is from Sharding Mechanics topic in chapter Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» Right option is (b) write |
|
50. |
The balancer process sends the _______ command to the source shard.(a) moveChunkShard(b) migChunk(c) moveChunk(d) all of the mentionedThe question was posed to me in quiz.The question is from Sharding Mechanics topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB |
Answer» CORRECT OPTION is (C) moveChunk For explanation: The source starts the MOVE with an INTERNAL moveChunk command. |
|