Interview Questions.

Mongodb Interview Questions 2019

fluid

Mongodb Interview Questions 2019

Q1. Compare MongoDB and Cassandra

Ans:

CRITERIA

Data Model

Database scalability

Querying of statistics

MONGODB

Document

Read

Multi-listed

CASSANDRA

Big Table like

Write

Using Key or ScanMongoDB is considered to be exceptional NoSQL database due to :Document-orientated (DO)

High performance (HP)

High availability (HA)

Easy scalability

Rich question language

Q2. What makes MongoDB the quality?

Ans: MongoDB is considered to be pleasant NoSQL database due to :Document-oriented (DO)

High performance (HP)

High availability (HA)

Easy scalability

Rich query language

Q3. How to do transactions/locking in MongoDB?

Ans: MongoDB does not use conventional locking with reduction, as it's miles planned to be light, excessive-velocity and knowable in its presentation. It may be considered as parallel to the MySQL MyISAM car entrust sculpt. With only enterprise maintain, overall performance is more advantageous, mainly in a structure with numerous servers.

Q4. When and to what extent does Data get extended to Multi-slice?

Ans: The MongoDB scrap stands on a set. So an album of all substances is stored in a lump or mass. Only whilst there's an extra time slot, there might be a variety of slice information success selections, but whilst there's extra than 1 lump, statistics receives prolonged to a variety of slices and it may be extended to 64 MB.

Q5. Judge against MongoDB with Couchbase and CouchbaseDB?

Ans: Although Mongo DB with Couchbase and Couchbase DB are common in lots of methods, however nevertheless they are one-of-a-kind within the case of necessities for execution of the version, crossing factors, storage, duplications, and many others.

Q6. When do we use Namespace in MongoDB?

Ans: During sequencing of the names of the database and collection name Namespace is used.

Q7. If you dispose of an item characteristic, is it deleted from the database?

Ans: Yes, it's miles deleted. So higher put off the attribute after which keep the object once more.

Q8. How can we circulate the old file in the moveChunk listing?

Ans: Once the functions are carried out, the antique files are transformed to backup files and moved to the moveChunk listing at the time of balancing the slices.

Q9. Explain the scenario while an index does not healthy into RAM?

Ans: When an index is too big to healthy into RAM, then MongoDB reads the index, which is faster than studying RAM because the indexes without difficulty match into RAM if the server has were given RAM for indexes along with the last set.

Q10. How does MongoDB provide consistency?

Ans: MongoDB uses the reader-author locks, allowing simultaneous readers to access any supply like a database or any collection. But always gives private get entry to to singles writes.

Q11. Why is MongoDB now not selected for a 32-bit system?

Ans: Mongo DB isn't considered as a 32-bit system due to the fact for jogging the 32-bit MongoDB, with the server, facts and indexes require 2 GB. So simplest it is not utilized in 32-bit gadgets.

Q12. How does Journaling paintings in MongoDB?

Ans: Write operations are saved within the reminiscence while journaling is going on. The on-disk journal documents are without a doubt dependable for the cause that the journal writes are recurring. Inside dbPath, a magazine subdirectory is designed by MongoDB.

Q13. How are you able to isolate our cursors from intervening with the write operations?

Ans: Snapshot () approach is used to isolate cursors from intervening with writes. This approach negotiates the index and makes positive that every query comes to any article handiest as soon as.

Q14. Define MongoDB.

Ans: It is document oriented database that is used to high availability, smooth scalability and high overall performance. It supports the dynamic schema design.

Q15. Explain reproduction set.

Ans: It is a set of mongo times that maintain identical data set. Replica sets provide redundancy and high availability, and are the basis for all production deployments.

Q16. What are the important thing capabilities of mongodb?

Ans: There are 3 major capabilities of mongodb which are automatic scaling, High overall performance and excessive availability.

Q17. What is CRUD?

Ans: Mongodb provides CRUD operations which might be create, Read, Update, Delete.

Q18. What is sharding?

Ans: Sharding means to save the data on the a couple of machines.

Q19. What is Aggregation in MongoDB?

Ans: Aggregations are operations that procedure facts records and go back computed results.

Q20. Define the namespace in mongodb?

Ans: It is the concatenation of series call and database.

Q21. Which syntax is used to create collection in mongodb?

Ans: db.CreateCollection(call,options) is used to create series in mongodb.

Q22. Which syntax is used to drop series in mongodb?

Ans: db.Series.Drop() is used to drop series in mongodb.

Q23. Explain Replication.

Ans: Replication is the technique of synchronizing information across a couple of servers.

Q24. What is the usage of Index in mongodb?

Ans: Indexes offer excessive performance examine operations for frequently used queries.

Q25. Which command is used for inserting a file?

Ans: database.Series.Insert (record) is used for putting a record.

Q26. What is locate of GridFS in mongodb?

Ans: GridFS is used for storing and retrieving the huge documents like audio, Images, Video files.

Q27. What is the use journaling?

Ans: Journaling is used to safe backups in mongodb.

Q28. Which command is used to see the relationship?

Ans: db_adminCommand (“connPoolStats”); is used to see the connection.

Q29. Define number one reproduction units?

Ans: The number one reproduction set accepts all write operations from clients.

Q30. Define secondary duplicate units.

Ans: The secondaries (page 565) mirror the primary’s oplog and follow the operations to their records units such that the secondaries’ records units mirror the number one’s records set.

Q31. What is the use of profiler?

Ans: Profiler is used to reveal the performance characteristics of every operation against the database.

Q32. Which kind of facts mongodb save?

Ans: MongoDB stores records in the form of documents, which can be JSON-like subject and fee pairs.

Q33. What is purpose of replication?

Ans: Replication provides redundancy and will increase information availability.

Q34. What's embedded documents?

Ans: Embedded documents seize relationships between information with the aid of storing associated information in a single document shape.

Q35. Define utility level encryption.

Ans: Application Level Encryption affords encryption on a in step with-field or in keeping with-record basis within the application layer.

Q36. What is storage encryption?

Ans: Storage Encryption encrypts all MongoDB statistics on the storage or working machine to make certain that best authorized processes can get admission to included records.

Q37. Which method is used to create an index?

Ans: CreateIndex() approach is used to create an index.

Q38. What is reproduction set oplog?

Ans: The oplog information all operations that adjust the records in the reproduction set.

Q39. What is vertical scaling?

Ans: Vertical scaling provides more CPU and garage sources to boom ability.

Q40. Define horizontal scaling.

Ans: It divides the information set and distributes the statistics over a couple of servers, or shards.

Q41. What are the additives of shared cluster?

Ans: Sharded cluster has the following additives: shards, query routers and config servers.

Q42. Which command is find to create database?

Ans: DATABASE_NAME command is used to create database.

Q43. Which command is locate to drop database?

Ans: db.DropDatabse() command is used to drop the database.

Q44. What is the use of quite() technique?

Ans: Pretty() approach is used to show the consequences in a formatted manner.

Q45. Which technique is used to cast off the report form the collection?

Ans: Remove() approach is used to remove the report shape the collection.

Q46. Define Mongodb projection.

Ans: Projection is used to pick most effective important data.It did not pick complete facts of a record.

Q47. What is the use of restrict() approach?

Ans: Limit() approach is used to restrict the statistics in database.

Q48. What is the syntax of limit() approach?

Ans: db.COLLECTION_NAME.Discover().Limit(NUMBER) syntax is used.

Q49. What is the syntax of sort() method?

Ans: db.COLLECTION_NAME.Find().Sort(KEY:1) syntax is used for sorting the files.

Q50. Which command is used to create the backup of database?

Ans: Mongodump command is used to create the backup of database.




CFG