MongoDB INTERVIEW QUESTION CHEATSHEET

MongoDB is becoming the most popular database and many popular websites use MongoDB. So, here is a collection of the most asked #MongoDB interview questions.

Please RT for reach and bookmark for easy recall.

🧵THREAD🧵

#100DaysOfCode
1. What kind of NoSQL database MongoDB is?

MongoDB is a document-oriented database. It stores data in the form of BSON structure-based documents. These documents are stored in a collection.

#100DaysOfCode
2. Which are the most important features of MongoDB?

The flexible data model in form of documents
Agile and highly scalable database
Faster than traditional databases
Expressive query language

#100DaysOfCode
3. What is a Namespace in MongoDB?

A Namespace is the concatenation of the database name and collection name. For e.g. school.students with the school as the database and students as the collection

#100DaysOfCode
4. Which languages can be used with MongoDB?

Currently, MongoDB provides official driver support for C, C++, C#, Java, Node.js, Perl, PHP, Python, Ruby, Scala, Go, and Erlang. MongoDB can easily be used with any of these languages.

#100DaysOfCode
5. Compare SQL databases and MongoDB at a high level.

SQL databases store data in form of tables, rows, columns, and records. MongoDB in contrast uses a flexible structure that can be easily modified and extended.

#100DaysOfCode
6. How is MongoDB better than other SQL databases?

MongoDB allows a highly flexible and scalable document structure. Also, MongoDB databases are faster as compared to SQL databases due to efficient indexing and storage techniques.

#100DaysOfCode
7. Compare MongoDB and CouchDB at a high level.

Both of these databases are document-oriented, MongoDB is a better choice for applications that need dynamic queries and good performance On the other side, CouchDB is better used for applications with occasionally changing queries
8. Does MongoDB need a lot of RAM?

No. MongoDB can be run even on a small amount of RAM. MongoDB dynamically allocates and de-allocates RAM based on the requirements of other processes.

#100DaysOfCode
9. Does MongoDB push the writes to disk immediately or lazily?

MongoDB pushes the data to disk lazily. It updates the immediately written to the journal but writing the data from journal to disk happens lazily.

#100DaysOfCode
10. Explain the structure of ObjectID in MongoDB.

ObjectID is a 12-byte BSON type with:

4-bytes value representing seconds
3-byte machine identifier
2-bytes process id
3-bytes counter

#100DaysOfCode
11. What are Indexes in MongoDB?

Indexes support the efficient execution of queries in MongoDB. Without indexes, MongoDB must perform a collection scan, i.e. scan every document in a collection, to select those documents that match the query statement.

#100DaysOfCode
12. How many indexes does MongoDB create by default for a new collection?

By default, MongoDB created the _id collection for every collection.

#100DaysOfCode
13. Mention the command to list all the indexes on a particular collection.

db.collection.getIndexes()

#100DaysOfCode
14. Why are MongoDB data files large in size?

MongoDB preallocates data files to reserve space and avoid file system fragmentation when you set up the server.

#100DaysOfCode

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Hemant Joshi (he/him)🌱

Hemant Joshi (he/him)🌱 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @8bithemant

8 Sep
Popular JavaScript Interview Questions with Answers.

JavaScript is the most popular language with ample of job opportunities. Here is the list of 20 most asked javascript interview questions to speed up your preparation.

🧵 Thread 🧵
#100DaysOfCode #DEVCommunity
1. what's the difference between undefined and null?

"undefined" is the default value of a variable that has not been assigned a specific value and "null" is a value that represents no value.

#100DaysOfCode
2. What does the && operator do?

The && or Logical AND operator finds the first falsy expression in its operands and returns it and if it does not find any falsy expression it returns the last expression.

#100DaysOfCode
Read 23 tweets
4 Sep
SQL INTERVIEW QUESTION CHEATSHEET.

SQL is the most popular database and many popular websites use SQL. So, here is a collection of the most asked #SQL interview questions to help you prepare.

Please RT for reach and bookmark for easy recall.

🧵Thread🧵

#100DaysOfCode
1. What is Database?

A database is an organized collection of data, stored and retrieved digitally from a remote or local computer system. Databases can be vast and complex, and such databases are developed using fixed design and modeling approaches.

#100DaysOfCode
2. What is DBMS?

DBMS stands for Database Management System. DBMS is a system software responsible for the creation, retrieval, updating and management of the database.

#100DaysOfCode
Read 23 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!