MongoDB Interview Questions
Documents & collections, BSON, indexing, aggregation pipeline, data modeling, sharding, replica sets, transactions and consistency.
61 questions
Popular Searches
1. What is MongoDB and how does a document database differ from a relational database?
easyFundamentals 6 mins2. What is a document and a collection in MongoDB?
easyFundamentals 5 mins3. What is BSON and how does it differ from JSON in MongoDB?
mediumData Formats 6 mins4. How does indexing work in MongoDB and what types of indexes exist?
mediumPerformance 7 mins5. What is the MongoDB aggregation pipeline and how does it work?
mediumAggregation 8 mins6. What is the difference between embedding and referencing in MongoDB data modeling?
mediumData Modeling 8 mins7. How does sharding work in MongoDB and why is it used?
hardScaling 8 mins8. What is a replica set in MongoDB and how does it provide high availability?
mediumReplication 7 mins9. What is the difference between find() and aggregate() in MongoDB?
mediumQueries 7 mins10. How do write concern and read concern work in MongoDB?
hardDurability & Consistency 7 mins11. What is the _id field in MongoDB and how are ObjectIds generated?
easyDocuments & Keys 6 mins12. How do you model a one-to-many relationship in MongoDB?
mediumData Modeling 7 mins13. What are MongoDB transactions and when should you use them?
mediumData Consistency 7 mins14. What is the difference between updateOne, updateMany, and replaceOne in MongoDB?
easyCRUD Operations 6 mins15. How does the MongoDB query optimizer choose an index?
hardIndexing & Performance 8 mins16. What is a compound index and how does the index prefix rule work?
mediumIndexing 7 mins17. What is the difference between a covered query and a normal query in MongoDB?
mediumQuery Performance 7 mins18. How does MongoDB handle schema validation?
mediumData Modeling 7 mins19. What are the trade-offs between normalization and denormalization in MongoDB?
mediumData Modeling 7 mins20. What is capped collection in MongoDB and when is it useful?
mediumCollections 6 mins21. How does the $lookup stage perform joins in MongoDB aggregation?
mediumAggregation 7 mins22. What is the difference between findOneAndUpdate and updateOne in MongoDB?
mediumCRUD Operations 6 mins23. How do TTL indexes work in MongoDB?
mediumIndexing 6 mins24. What is the aggregation $group stage and how does it work?
mediumAggregation 7 mins25. How does MongoDB pagination work and why is skip/limit inefficient at scale?
mediumQuerying 7 mins26. What is the difference between MongoDB and a key-value store like Redis?
mediumNoSQL Concepts 7 mins27. How do you ensure data consistency in a sharded MongoDB cluster?
hardSharding 8 mins28. What is the oplog in MongoDB and what role does it play in replication?
mediumReplication 7 mins29. What are the different BSON data types in MongoDB?
easyData Modeling 6 mins30. How does the MongoDB aggregation $match stage differ from a find filter?
mediumAggregation 7 mins31. What is MongoDB?
easyFundamentals 5 mins32. What is a Document in MongoDB?
easyFundamentals 5 mins33. What is a Collection in MongoDB?
easyFundamentals 5 mins34. What is BSON?
easyFundamentals 5 mins35. What is an Index in MongoDB?
easyPerformance 6 mins36. What is Aggregation in MongoDB?
easyQuerying 6 mins37. What is Sharding in MongoDB?
mediumScalability 7 mins38. What is Replication in MongoDB?
mediumAvailability 7 mins39. What Is a Capped Collection in MongoDB?
mediumStorage & Collections 6 mins40. What Is WiredTiger in MongoDB?
mediumStorage Engine 6 mins41. What Is an Upsert in MongoDB?
hardCRUD Operations 7 mins42. What Is a Compound Index in MongoDB?
hardIndexing & Performance 7 mins43. What Is the _id Field in MongoDB?
hardData Modeling 7 mins44. What Is Schema Design in MongoDB?
hardData Modeling 8 mins45. What Is Mongoose in MongoDB?
hardTools & Ecosystem 7 mins46. How Do You Decide Field Order in a MongoDB Compound Index (the ESR Rule)?
hardIndexing & Query Planning 9 mins47. How Do You Read a MongoDB Explain Plan with executionStats?
hardIndexing & Query Planning 9 mins48. How Does the MongoDB Plan Cache Work and Why Do Rejected Plans Matter?
hardIndexing & Query Planning 9 mins49. Why Does Aggregation Stage Order Matter, and What Does the Optimiser Rewrite?
mediumAggregation 8 mins50. What Happens When an Aggregation Stage Exceeds Its Memory Limit?
hardAggregation 9 mins51. Why Is $lookup Expensive, and What Would You Do Instead?
hardAggregation 9 mins52. How Do Read Preference, Read Concern and Write Concern Differ?
mediumReplication & Consistency 9 mins53. What Is a Causally Consistent Session in MongoDB and When Do You Need One?
hardReplication & Consistency 9 mins54. What Are the Practical Limits of MongoDB Multi-Document Transactions?
hardTransactions 10 mins55. How Do You Choose a Shard Key, and What Makes a Bad One?
hardSharding 10 mins56. What Is a Jumbo Chunk, and What Does Chunk Migration Cost a Live Cluster?
hardSharding 9 mins57. How Do Change Streams Work, and What Is a Resume Token For?
mediumChange Streams 9 mins58. Why Do TTL-Expired Documents Still Appear, and How Do You Operate TTL Indexes Safely?
mediumIndexing & Operations 8 mins59. What Is the Working Set, and How Do You Tell If It No Longer Fits in Memory?
hardPerformance & Operations 9 mins60. How Do You Size a MongoDB Connection Pool, and What Goes Wrong If You Get It Wrong?
mediumPerformance & Operations 9 mins61. How Do You Use the Database Profiler to Diagnose Slow Queries in Production?
hardPerformance & Operations 10 mins