Skip to main content

MongoDB Interview Cheat Sheet

Top 50 interview questions with concise answers. Print this page or save as PDF for offline study.

View All MongoDB Questions

1. What is MongoDB?

2. What is a document in MongoDB?

3. What is a collection?

4. What is a database in MongoDB?

5. What is BSON?

6. What is an ObjectId?

7. What is a schema in MongoDB?

8. What is the purpose of the find() method?

9. What is the difference between find() and findOne()?

10. What does the updateOne() function do?

11. What is a deleteOne() operation?

12. What is field projection in MongoDB?

13. What is an index in MongoDB?

14. What is a primary key in MongoDB?

15. What is a replica set?

16. What is sharding in MongoDB?

17. What is MongoDB Atlas?

18. What is the difference between MongoDB and a relational database?

19. What is the purpose of the $set operator?

20. What does the $inc operator do?

21. What is a capped collection and when should it be used?

22. What is the difference between $push and $addToSet?

23. What is an embedded document and when is embedding recommended?

24. What is data referencing in MongoDB?

25. What is the purpose of the aggregation pipeline?

26. What is $lookup used for?

27. What is the difference between insertOne and insertMany?

28. What is the purpose of TTL indexes?

29. What is the explain function and why is it useful?

30. What is a write concern?

31. What is a read preference?

32. What is journaling in MongoDB?

33. What is $regex used for?

34. What is the difference between save and update?

35. What is sharding key selection and why is it important?

36. How does MongoDB handle schema flexibility while still allowing schema validation?

37. What are the main differences between embedding and referencing in MongoDB?

38. How do compound indexes improve query performance?

39. What is an index prefix and why does it matter in compound indexing?

40. What is the purpose of an aggregation pipeline’s $facet stage?

41. What is $unwind and why is it used?

42. What is a covered query in MongoDB?

43. What is index cardinality and how does it affect performance?

44. What are multi-key indexes?

45. What is the difference between $in and $nin in performance?

46. What is write concern and why is it important?

47. What is read concern in MongoDB?

48. How does MongoDB ensure durability during crashes?

49. What are write-ahead logs (journal files) and how do they work?

50. What is a MongoDB transaction and when is it needed?

Ready to level up? Start Practice