MongoDB LinkedIn Skill Assessment Answer

Here, We see MongoDB LinkedIn Skill Assessment Answer. This assessment test consists 15-20 MCQs to demonstrate your knowledge in your selected skills. MCQs comes from different topics – MongoDB Indexing, MongoDB CLI, MongoDB Shell, MongoDB Structure, Replica Set.

MongoDB LinkedIn Skill Assessment :-

Q1. Which command adds members to the replica set from MongoDB shell?

  1. rs.add("")✔️
  2. replicaSetAdd("")
  3. rs.insert("")
  4. replica.add("")

Q2. Which MongoDB shell command should you use to back up a database?

  1. restore
  2. backup
  3. mongobackup
  4. mongodump✔️

Q3. Which shell query displays all citizens with an age greater than or equal to 21?

  1.'WHERE age >= 21')
  2. db.citizens.where('age >= 21')
  3. db.citizens.find('WHERE age >= 21')
  4. db.citizens.find({age: {$gte: 21}})✔️

Q4. What does a MongoDB collection consist of?

  1. data
  2. documents✔️
  3. fields
  4. rows

Q5. Given an ObjectId in _id, how do you get the time it was created?

  1. getDateTime(_id)
  2. _id.createDate()
  3. _id.getTimestamp()✔️
  4. _id.getDateTime()

Q6. Given a cursor named myCursor, which command returns a boolean value?

  1. myCursor.hasNext()✔️
  2. myCursor.sort()
  4. myCursor.find()

Q7. Which command returns a specific document in the user’s collection?

  1. db.users.find({_id: 1})✔️
  2.{_id: 1})
  3. db.users.query({_id: 1})
  4. db.query.users({_id: 1})

Q8. To import a JSON array into Mongo, what flags are needed with MongoDBimport?

  1. --type jsonArray
  2. --json
  3. --type json
  4. --jsonArray✔️

Q9. Choose the shell command that connects to a MongoDB database.

  1. mongo✔️
  2. mongod
  3. mongoconnect
  4. dbconnect

Q10. In the MongoDB shell, how can you tell if an index was used with a query?

  1. db.customers.find({lastName: ‘smith’}).explain()✔️
  2. db.customers.find({lastName: ‘smith’}).perf()
  3. db.customers.find({lastName: ‘smith’}).plan()
  4. db.customers.find({lastName: ‘smith’}).usedIndex()

Q11. Suppose your aggregation pipeline terminated with an exception referring to exceeded memory limit. What is the best way to resolve the issue?

  1. Set useMemory to twice amount indicated in exception.
  2. Switch a 64 bit instance of MongoDB.
  3. Increase the memory of the MongoDB server.
  4. Set allowDiskUse to true.✔️

Q12. What is the recommended way to delete a user?

  1. db.deleteUser(“user”)
  2. db.removeUser(“user”) DEPRECATED
  3. db.remove(“user”)
  4. db.dropUser(“user”)✔️

Q13. What the primary database in a replica set fails, when does failover begin?

  1. once the primary has been down for 10 minutes
  2. once the primary reboots
  3. immediately✔️
  4. after the administrator reboots the primary

Q14. What is the correct option to set up Kerberos when starting MongoDBd?

  1. --setParameter authenticationMechanisms=GSSAPI✔️
  2. --setAuthentication=GSSAPI
  3. --setParam auth=K
  4. --setAuth method=Kerberos

Q15. What is the purpose of an arbiter in a replica set?

  1. It monitors replica set and sends email in case of failure
  2. It casts the tie-breaking vote in an election.✔️
  3. It holds a backup copy of the database.
  4. It reboots the failed server.

Q16. You want to know how many types of items you have in each category. Which query does this?

  1.{_id: "$category", count: {$sum:1}})
  2. db.product.aggregate($sum: {_id: "$category", count: {$group:1}})
  3. db.product.aggregate($group: {_id: "$category", count: {$sum:1}})✔️
  4. db.product.aggregate($count: {_id: "$category", count: {$group:1}})

Q17. To restrict the number of records coming back from a query, which command should you use?

  1. take
  2. limit✔️
  3. max
  4. skip

Q18. You have a collection named restaurants with the geographical information stored in the location property, how do you create a geospatial index on it?

  1. db.restaurants.CreateIndex({location: "2dsphere"})✔️
  2. db.restaurants.geospatial({location: "2dsphere"})
  3. db.restaurants.CreateIndex("2dsphere":"location")
  4. db.restaurants.CreateIndex({geospatial: "location"})

Q19. How do you find documents with a matching item in an embedded array?

  1. db.customers.findmatch ({"jobs":"secretary"})
  2. db.customers.find ({"jobs:secretary"})
  3. db.customers.find ({"jobs":["secretary"]})
  4. db.customers.find ({"jobs":"secretary"})✔️

Q20. Which query bypasses the first 5 customers and returns the next 10?

  1. db.customers.find({}, {skip: 5, limit: 10})
  2. db.customers.find({}.page(5).take(10))
  3. db.customers.find({}).skip(5).take(10)
  4. db.customers.find({}).skip(5).limit(10)✔️

Q21. How do you create a text index?

  1. db.customers.createIndex({firstName, lastName})
  2. db.customers.createTextIndex({firstName, lastName})
  3. db.customers.createIndex({firstName: "text", lastName: "text"})✔️
  4. db.customers.createText({firstName: 1, lastName: 1})

Q22. Assuming you have customers collection with a firstName and lastName field, which is the correct MongoDB shell command to create an index on lastName, then firstName both ascending?

  1. db.customers.createIndex("lastName, firstName, ASC")
  2. db.customers.addIndex({lastName:"ASC", firstName: "ASC"})
  3. db.customers.newIndex({lastName:1, firstName:1})
  4. db.customers.createIndex({lastName:1, firstName: 1})✔️

Q23. One of the documents in your collection has an _id based upon an older database design and you want to change it. You write an update command to find the document and replace the _id but the _id isn’t changed. How should you fix the issue?

  1. Set the replace option to true.
  2. Use the replaceOne() command instead.
  3. You can’t. Once set, the _id field cannot be changed.✔️
  4. Use the updateOne() command instead.

Q24. A compound index allows you to _ ?

  1. Calculate interest quickly.
  2. Accomplish nothing, since compound indexes aren’t allowed in Mongo.
  3. Use more than one field per index.
  4. Combine fields in different collations.✔️

Q25. Why are ad-hoc queries useful?

  1. They do not have to use the same operators.
  2. You do not need to structure the database to support them.
  3. They autogenerate reports.
  4. They run faster than indexed queries.✔️

Q26. How often do the members of a replica set send heartbeats to each other?

  1. every 2 minutes
  2. every 5 seconds
  3. every 2 seconds✔️
  4. every 10 seconds

Q27. Which command returns all of the documents in the customers collection?

  1. db.customers.all();
  2. db.find().customers();
  3. db.customers.find();✔️

Q28. Given a cursor named myCursor, pointing to the customers collection, how to you get basic info about it?

  1. myCursor.stats()
  2. myCursor.dump()
  4. myCursor.explain()✔️

Q29. What is true about indexes?

  1. They speed up read access while slowing down writes.✔️
  2. They secure the database from intruders.
  3. They speed up reads and writes.
  4. They speed up write access while slowing down reads.

Q30. What is the preferred format to store geospatial data in MongoDB?

  1. Latitude, longitude
  2. XML
  3. GeoJSON✔️
  4. BSON

Q31. Which programming language is used to write MongoDB queries? (Alternative: In the MongoDB shell, what programming language is used to make queries?)

  1. Python
  2. JavaScript✔️
  3. SQL
  4. TypeScript

Q32. You have two text fields in your document and you’d like both to be quickly searchable. What should you do?

  1. Create a text index on each field.✔️
  2. MongoDB is not able to do this.
  3. Create a compound text index using both fields.
  4. Create a text index on one field and a single field index on the other.

Q33. To import a CSV file into MongoDB, which command should you issue?

  1. mongorestore
  2. mongoi
  3. upload
  4. mongoimport✔️

Q34. In an MongoDB mapReduce command, the reduce function should _.

  1. access the database
  2. be called only when the key has a single value
  3. access the database only to perform read operations
  4. not access the data✔️

Q35. On a newly created collection, which field will have an index?

  1. the name field
  2. the ObjectId field
  3. the _id field✔️
  4. no field will have an index

Q36. You have a collection of thousands of students. You’d like to return the second set of 20 documents from the sorted collection. What is the proper order in which to apply the operations?

  1. limit, skip, sort
  2. sort, limit, skip
  3. limit, sort, skip
  4. sort, skip, limit✔️

Q37. You would like the stats() command to return kilobytes instead of bytes. Which command should you run?

  1. db.vehicle.stats(1024)✔️
  2. db.vehicle.stats("kilobytes")
  3. db.vehicle.stats(true)
  4. db.vehicle.stats("kb")

Q38. You want to modify an existing index. What is the best way to do this?

  1. Use the reIndex() command to modify the index.
  2. Delete the original index and create a new index.✔️
  3. Call the createIndex() command with the update option.
  4. Use the updateIndex() command.

Q39. You need to delete the index you created on the description field. Which command will accomplish this?

  1. db.vehicle.dropIndex("description_text")✔️
  2. db.vehicle.dropIndex({"description":"text"})
  3. db.vehicle.removeIndex({"description":"text"})
  4. db.vehicle.removeIndex("description_text")

Q40. You would like to know how many different categories you have. Which query will best get the job done?

  1. db.vehicle.distinct("category")
  2. db.vehicle.unique("category")
  3. db.vehicle.distinct("category").count()✔️
  4. db.vehicle.distinct("category").length

Q41. From the MongoDB shell, how do you create a new document in the customers collection?

  1. db.customers.add({name: "Bob"})
  2.{name: "Bob"})✔️
  3. db.customers.create({name: "Bob"})
  4.{name: "Bob"})

Q42. Which field is required of all MongoDB documents?

  1. _id✔️
  2. _name
  3. ObjectId
  4. mongoDB is schema-less so no field is required

Q43. A MongoDB instance has at least what three files?

  1. data, namespace, and journal✔️
  2. namespace, journal, and log
  3. journal, data, and database
  4. data, log, and journal

Q44. You’d like a set of documents to be returned in last name, ascending order. Which query will accomplish this?

  1. db.persons.find().sort({lastName: -1}}
  2. db.persons.find().sort({lastName: 1}}✔️
  3. db.persons.find().sort({lastName: ascending}}
  4. db.persons.find().sort({lastName: $asc}}

Q45. What is NOT a standard role in MongoDB?

  1. restore
  2. read/write
  3. dbadmin✔️
  4. delete collections

Q46. Which MongoDB shell command deletes a single document?

  1. db.customers.delete({_id: 1});
  2. db.customers.drop({_id: 1});
  3. db.drop.customers({_id: 1});
  4. db.customers.remove({_id: 1});✔️

Q47. Using the MongoDB shell, how do you remove the customer collection and its indexes?

  1. db.customers.remove({}).indexes();
  2. db.customers.remove({});
  3. db.customers.drop();✔️
  4. db.customers.delete();

Q48. By default, applications direct their read operations to which member of the replica set?

  1. primary
  2. arbiter✔️
  3. secondary
  4. backup

Q49. You need to get the names of all the indexes on your current collection. What is the best way to accomplish this?

  1. db.people.getName();
  2. db.people.reIndex({names: 1});
  3. db.people.getIndexKeys();
  4. db.people.getIndexes();✔️

Q50. You are going to do a series of updates to multiple records. You find setting the multi option of the update() command too tiresome. What should you do instead?

  1. Use the replaceMany() command instead
  2. Use the updateMulti() command instead
  3. Use the updateMany() command instead✔️
  4. Set the global multi option to True

Q51. To cleanly shut down MongoDB, what command should you use from the MongoDB shell?

  1. quit()
  2. exit()
  3. db.shutdownServer()✔️
  4. db.shutdown()

Q52. Given a customer collection which includes fields for gender and city, which aggregate pipeline shows the number of female customers in each city? (Alternative: How can you view the execution performance statistics for a query?)

  1. db.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number: {$sum: 1}}}, {$sort :{number: -1}}])✔️
  2. db.members.find({$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number: {$sum: 1}}}.$sort ({number: -1})
  3. db.members.find([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number: {$sum: 1}}}, {$sort :{number: -1}}])
  4. db.members.aggregate([ {$match: {gender: "Female"}}, {$sort :{number: -1}}])

Q53. When no parameters are passed to explain(), what mode does it run in?

  1. wireTiger mode
  2. executionStats mode
  3. queryPlanner mode✔️
  4. allPlansExecution mode

Q54. What is the correct query to find all of the people who have a home phone number defined?

  1. db.person.find({exists: 'homePhone'});
  2. db.person.exists({homePhone: true});
  3. db.person.find({homePhone: {$exists: true}});✔️
  4. db.person.has('homePhone');

Q55. Which file in the MongoDB directly holds the MongoDB daemon?

  1. mongodb
  2. mongo-daemon✔️
  3. daemon
  4. mongod✔️

Q56. You have just secured your previously unsecured MongoDB server, but the server is still not requiring authentication. What is the best option?

  1. Restart the mongod process.✔️
  2. Issue the secure() command.
  3. Issue the mongoimport command.
  4. Issue the authenticate() command.

Q57. What is the most accurate statement regarding MongoDB and ad hoc queries?

  1. MongoDB does not allow ad hoc queries; all queries require an index.✔️
  2. Ad hoc queries are allowed only in the paid version.
  3. Ad hoc queries are allowed only through the ad hoc command.
  4. MongoDB allows ad hoc queries.✔️

Q58. In MongoDB, what does a projection do?

  1. allows you to do a calculation on the results
  2. allows you to run queries on the server
  3. allows you to select which fields should be in the return data✔️
  4. allows you to format the results for a display

Q59. To remove a database and all of its records from MongoDB, what operator should you use?

  1. dropDatabase()✔️
  2. removeAll()
  3. clear()
  4. deleteDatabase()

Q60. What option can be passed to start the MongoDB shell without connecting to a database?

  1. -db=null
  2. --shell-only
  3. --free
  4. -nodb✔️

Q61. How can you improve the appearance of the output JSON that contains the _id?

  1. Use db.collection.set({$_id:pretty})
  2. Create a second index
  3. Use db.collection.format(numeric)✔️
  4. Use $_id = value

Q62. What happens to a Replica set oplog if it runs out of memory?

  1. The oplog will be saved on one of the secondary servers.✔️
  2. The oplog is capped collection and can't run out of memory
  3. The MongoDB instance will fail
  4. The oplog will stop recording logging information

Q63. MongoDB ships with a variety of files. Which file runs the MongoDB shell?

  1. mongo✔️
  2. mongo-s
  3. shell
  4. mongo-shell

Q64. How can you view the execution performance statistics for a query?

  1. db.performance.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id:{city:"$city"}, number: {$sum: 1}}}, {$sort : {number: -1}}])
  2. db.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number:{$sum:1}}}, {$sort: {number:-1}}]).explain("executionStats")✔️
  3. db.members.aggregate([ {$match: {gender: "Female"}}, {$group:{_id: {city: "$city"}, number: {$sum: 1}}}, {$sort: {number: -1}}]).explain()
  4. db.members.aggregate([ {$match: {gender: """Female"""}}, {$group: {_id: {city: """$city"""}, number: {$sum:1}}}, {$sort: {number: -1}}]).number()

Q65. From the MongoDB shell, how do you execute a JavaScript file named list.js?

  1. node ‘list.js’
  2. exec(‘list.js)
  3. run(‘list.js)
  4. load(‘list.js)✔️

Q66. Which MongoDB shell query will sort the customer’s collection by name descending?

  1. db.customers.sort({name: -1}.find({})
  2. db.customers.sort({name: -1})
  3. db.customers.find({}).sort({name: -1})✔️
  4. db.customers.find({}).sort({name: 1})

Q67. Suppose you are using the mongoimport command to import personnel data and there is a unique index on the email field. What happens when there are duplicate emails in the import?

  1. The import command aborts without importing any records.
  2. The import command imports records upto but not including the record, and then aborts.
  3. The import command doesn’t import the bad document but does import the rest.
  4. The import command prompts you to correct the bad record.✔️

Q68. You have a collection with millions of documents. Each time you attempt to sort. MongoDB runs out of memory. What might help?

  1. Use the purge operator before the sort.
  2. Return the entire collection and sort on the client.
  3. Pass the –more-memory option.
  4. Create an index on the field you are sorting.✔️

Q69. You need to be able to quickly find a word in a text field. What should you do?

  1. Create a text index on the field and do a $text Query.
  2. Create an single field index in descending order, and do a query for the word.
  3. Do a $text query.✔️
  4. Create a $regex on the fields, and do a $regex query.

Link for more programming Language Quiz Answer

LinkedIn MongoDB Quiz Answers, LinkedIn MongoDB Assessment Answers, MongoDB LinkedIn Quiz Answers, MongoDB Assessment LinkedIn Answers, LinkedIn Skill Quiz Answers MongoDB, LinkedIn MongoDB Quiz, MongoDB LinkedIn Quiz, LinkedIn Quiz Answers MongoDB, LinkedIn MongoDB Assessment Quiz Answers, LinkedIn Skill Assessment MongoDB Answers, MongoDB LinkedIn Quiz, LinkedIn MongoDB Assessment Test Answers, LinkedIn MongoDB Test Answers, LinkedIn MongoDB Skill Assessment Answers, LinkedIn Skill Assessment Answers MongoDB, MongoDB LinkedIn Assessment Answers, LinkedIn MongoDB Assessment Answers, MongoDB LinkedIn Assessment Answers, Answers to LinkedIn Quizzes, LinkedIn Skill Assessment Answers GitHub, LinkedIn Assessment Test Answers, LinkedIn Skill Assessments Answers, MongoDB LinkedIn Skill Assessment Answer, MongoDB LinkedIn Skill Assessment Answer, MongoDB LinkedIn Skill Assessment Answer, MongoDB LinkedIn Skill Assessment Answer

Leave a Comment

Scroll to Top