{"id":2357,"date":"2014-04-21T08:13:26","date_gmt":"2014-04-21T08:13:26","guid":{"rendered":"http:\/\/blog.cloudthat.com\/?p=2357"},"modified":"2024-06-25T11:14:35","modified_gmt":"2024-06-25T11:14:35","slug":"sample-questions-for-mongodb-certified-dba-c100dba-exam-part-ii","status":"publish","type":"blog","link":"https:\/\/www.cloudthat.com\/resources\/blog\/sample-questions-for-mongodb-certified-dba-c100dba-exam-part-ii","title":{"rendered":"Sample Questions for MongoDB Certified DBA (C100DBA) exam &#8211; Part II"},"content":{"rendered":"<p>Here are some more sample questions for C100DBA: MongoDB Certified DBA Associate Exam.<\/p>\n<p dir=\"ltr\">Please give them a try and the answers are at the end of this blog post.<\/p>\n<p dir=\"ltr\">If you have not yet attempted <a href=\"https:\/\/blog.cloudthat.com\/sample-questions-for-mongodb-certified-dba-c100dba-exam\/\" target=\"_blank\" rel=\"noopener\">Part I of sample questions &#8211; they are available here<\/a>.<\/p>\n<h2 dir=\"ltr\"><strong>Section 1: Philosophy &amp; Features:<\/strong><\/h2>\n<p dir=\"ltr\"><strong>1. Which of the following are valid json documents? Select all that apply.<\/strong><\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">a. {\u201cname\u201d:\u201dFred Flintstone\u201d;\u201doccupation\u201d:\u201dMiner\u201d;\u201dwife\u201d:\u201dWilma\u201d}<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">b. {}<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">c. {\u201ccity\u201d:\u201dNew York\u201d, \u201cpopulation\u201d, 7999034, boros:{\u201cqueens\u201d, \u201cmanhattan\u201d, \u201cstaten island\u201d, \u201cthe bronx\u201d, \u201cbrooklyn\u201d}}<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">d. {\u201ca\u201d:1, \u201cb\u201d:{\u201cb\u201d:1, \u201cc\u201d:\u201dfoo\u201d, \u201cd\u201d:\u201dbar\u201d, \u201ce\u201d:[1,2,4]}}<\/p>\n<h2 dir=\"ltr\"><strong>Section 2: CRUD Operations:<\/strong><\/h2>\n<p dir=\"ltr\"><strong>1. Which of the following operators is used to updated a document partially?<\/strong><\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">a. $update<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">b. $set<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">c. $project<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">d. $modify<\/p>\n<h2 dir=\"ltr\"><strong>Section 3: Aggregation Framework:<\/strong><\/h2>\n<p dir=\"ltr\"><strong>Questions 1 to 3<\/strong><\/p>\n<p dir=\"ltr\"><strong>Below is a sample document of \u201corders\u201d collection<\/strong><\/p>\n<p dir=\"ltr\"><strong>{<\/strong><\/p>\n<p><strong> cust_id: &#8220;abc123&#8221;,<\/strong><\/p>\n<p><strong> ord_date: ISODate(&#8220;2012-11-02T17:04:11.102Z&#8221;),<\/strong><\/p>\n<p><strong> status: &#8216;A&#8217;,<\/strong><\/p>\n<p><strong> price: 50,<\/strong><\/p>\n<p><strong> items: [ { sku: &#8220;xxx&#8221;, qty: 25, price: 1 },<\/strong><\/p>\n<p><strong> { sku: &#8220;yyy&#8221;, qty: 25, price: 1 } ]<\/strong><\/p>\n<p><strong> }<\/strong><\/p>\n<p dir=\"ltr\"><strong>Select operators for the below query to determine the sum of \u201cqty\u201d fields associated with the orders for each \u201ccust_id\u201d.<\/strong><\/p>\n<p dir=\"ltr\"><strong>db.orders.aggregate( [<\/strong><\/p>\n<p><strong> { $OPR1: &#8220;$items&#8221; },<\/strong><\/p>\n<p><strong> {<\/strong><\/p>\n<p><strong> $OPR2: {<\/strong><\/p>\n<p><strong> _id: &#8220;$cust_id&#8221;,<\/strong><\/p>\n<p><strong> qty: { $OPR3: &#8220;$items.qty&#8221; }<\/strong><\/p>\n<p><strong> }<\/strong><\/p>\n<p><strong> }<\/strong><\/p>\n<p><strong> ] )<\/strong><\/p>\n<p dir=\"ltr\"><strong>1. OPR1 is<\/strong><\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">a. $group<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">b. $project<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">c. $unwind<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">d. $sum<\/p>\n<p dir=\"ltr\"><strong>2. OPR2 is<\/strong><\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">a. $group<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">b. $sort<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">c. $limit<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">d. $sum<\/p>\n<p dir=\"ltr\"><strong>3. OPR3 is<\/strong><\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">a. $match<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">b. $project<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">c. $skip<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">d. $sum<\/p>\n<h2 dir=\"ltr\"><strong>Section 4: Indexing:<\/strong><\/h2>\n<p dir=\"ltr\"><strong>1. Which of the following index would be optimum for the query? Select all valid.<\/strong><\/p>\n<p dir=\"ltr\"><strong>db.test.find( { a : 5, c : 2 })<\/strong><\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">a. db.test.ensureIndex( { a: 1, b :1, c:1, d:1})<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">b. db.test.ensureIndex( { a : 1, c: 1, d: 1, b : 1})<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">c. db.test.ensureIndex( { a :1, c:1})<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">d. db.test.ensureIndex( { c:1, a: 1})<\/p>\n<h2><strong>Section 5: Replication:<\/strong><\/h2>\n<p dir=\"ltr\"><strong>1. What is the replication factor for a replicated cluster with 1 primary, 3 secondaries with one of them hidden. The set also has an arbiter?<\/strong><\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">a. 3<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">b. 4<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">c. 5<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">d. None of the above<\/p>\n<h2 dir=\"ltr\"><strong>Section 6: Sharding:<\/strong><\/h2>\n<p dir=\"ltr\"><strong>1. Write the command(s) are correct to enable sharding on a database \u201ctestdb\u201d and shard a collection \u201ctestCollection\u201d with _id as shard key.<\/strong><\/p>\n<h2 dir=\"ltr\"><strong>Section 7: Server &amp; Application Administration:<\/strong><\/h2>\n<p dir=\"ltr\"><strong>1. To add a new user and enable authentication in MongoDB, which of the following steps need be executed?<\/strong><\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">a. update users collection and restart mongodb<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">b. update users collection and restart mongodb with &#8211;auth option<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">c. update users collection and run db.enableAuthentication()<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">d. All of the above<\/p>\n<h2 dir=\"ltr\"><strong>Section 8: Backup &amp; Restore:<\/strong><\/h2>\n<p dir=\"ltr\"><strong>1. Which of the following needs to be performed prior to initiate backup on a sharded cluster?<\/strong><\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">a. db.stopServer()<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">b. db.stopBalancer()<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">c. sh.stopServer()<\/p>\n<p dir=\"ltr\" style=\"padding-left: 30px;\">d. sh.stopBalancer()<\/p>\n<h3 dir=\"ltr\"><strong>Answers<\/strong><\/h3>\n<p dir=\"ltr\"><strong>Section 1: Philosophy &amp; Features:<\/strong><\/p>\n<p dir=\"ltr\">1. b,d<\/p>\n<p dir=\"ltr\"><strong>Section 2: CRUD Operations<\/strong><\/p>\n<p dir=\"ltr\">1. b<\/p>\n<p dir=\"ltr\"><strong>Section 3: Aggregation Framework<\/strong><\/p>\n<p dir=\"ltr\">1. c<\/p>\n<p dir=\"ltr\">2. a<\/p>\n<p dir=\"ltr\">3. d<\/p>\n<p dir=\"ltr\"><strong>Section 4: Indexing<\/strong><\/p>\n<p dir=\"ltr\">1. b,c<\/p>\n<p dir=\"ltr\"><strong>Section 5: Replication<\/strong><\/p>\n<p dir=\"ltr\">1. b<\/p>\n<p dir=\"ltr\"><strong>Section:6 Sharding<\/strong><\/p>\n<p dir=\"ltr\">1. sh.enableSharding(&#8220;testdb&#8221;) &amp; sh.shardCollection(&#8220;testdb.testCollection&#8221;, {_id : 1 }, true )<\/p>\n<p dir=\"ltr\"><strong>Section 7: Server &amp; Application Administration<\/strong><\/p>\n<p dir=\"ltr\">1. b<\/p>\n<p dir=\"ltr\"><strong>Section 8: Backup &amp; Restore<\/strong><\/p>\n<p dir=\"ltr\">1. d<\/p>\n<p>I will also be conducting a bootcamp for this certification in Bangalore and online. If you are interested to join, please <a href=\"https:\/\/cloudthat.in\/mongodb-certified-dba-inquiry\/\" target=\"_blank\" rel=\"noopener\">click here and fill out the form<\/a>.<\/p>\n<p>Also more sample questions are coming, so keep checking.. Please share if you liked the post by using the social buttons below.<\/p>\n<p><strong>Disclaimer:<\/strong> These questions are NOT what were in my certification exam. I personally or CloudThat do not have any official tie-up with MongoDB regarding the certification or the kind of questions asked. These are my best guesses for the kind of questions to expect, given my experience with MongoDB in general and with the examination.<\/p>\n","protected":false},"author":219,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"open","template":"","blog_category":[3639,3774],"user_email":"prarthitm@cloudthat.com","published_by":"324","primary-authors":"","secondary-authors":"","acf":[],"_links":{"self":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/2357"}],"collection":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/users\/219"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/comments?post=2357"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/2357\/revisions"}],"predecessor-version":[{"id":45971,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/2357\/revisions\/45971"}],"wp:attachment":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/media?parent=2357"}],"wp:term":[{"taxonomy":"blog_category","embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog_category?post=2357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}