03 November 2020

#Mongodb

#MongoDB

Key Concepts


Topic SubTopics Basic Intermediate Advanced Expert
Introduction & Architecture NoSQL Concepts, BSON, JSON, Collections, Documents, Replica Sets ✔️ ✔️ ✔️ ✔️
Installation & Configuration Mongo Shell, Compass, Cluster Setup, Config Files, Atlas Cloud ✔️ ✔️
CRUD Operations Insert, Find, Update, Delete, Bulk Operations ✔️ ✔️
Indexes Single Field, Compound, Multikey, Text, Geospatial, Indexing Strategies ✔️ ✔️ ✔️
Aggregation Framework Pipeline, Stages, $match, $group, $lookup, $project, MapReduce ✔️ ✔️ ✔️
Data Modeling Embedding vs Referencing, Schema Design, Polymorphic Schemas ✔️ ✔️ ✔️ ✔️
Transactions & Concurrency ACID in MongoDB, Multi-Document Transactions, Write Concerns ✔️ ✔️ ✔️
Replication & High Availability Replica Sets, Failover, Elections, Oplog, Write Concern ✔️ ✔️ ✔️
Sharding & Scalability Shard Keys, Config Servers, Query Routing, Balancing ✔️ ✔️
Security Authentication, Authorization, Roles, SCRAM, TLS, Auditing ✔️ ✔️ ✔️ ✔️
Backup & Recovery mongodump, mongorestore, Snapshots, PITR, Atlas Backup ✔️ ✔️ ✔️
Monitoring & Performance Profiler, Logs, Index Analysis, Query Optimization, Metrics ✔️ ✔️ ✔️
MongoDB Tools Compass, Atlas, mongosh, mongoimport/export, mongostat, mongotop ✔️ ✔️
Integration & Drivers Java Driver, Python Driver, Node.js Driver, Spring Data MongoDB ✔️ ✔️ ✔️
Cloud & Modern Features MongoDB Atlas, Charts, Realm, Serverless Instances ✔️ ✔️ ✔️

Interview question

1. Introduction & Basics

  1. What is MongoDB, and how does it differ from relational databases?
  2. What are collections and documents in MongoDB?
  3. Explain BSON and its advantages.
  4. What are the main features of MongoDB?
  5. What are common use cases for MongoDB?
  6. Compare MongoDB vs. MySQL.
  7. Explain the CAP theorem and MongoDB?s position in it.
  8. What is the maximum document size in MongoDB?
  9. How do you install MongoDB on Linux/Windows?
  10. What is MongoDB Atlas?

2. CRUD Operations

  1. How do you insert documents in MongoDB?
  2. How do you retrieve data using find()?
  3. Difference between findOne() and find()?
  4. How do you update a document?
  5. How do you delete a document?
  6. What is upsert in MongoDB?
  7. How do you perform bulk insert?
  8. How do you query nested documents?
  9. What is the difference between $set and $unset?
  10. How do you perform range queries?

3. Indexes

  1. What is an index in MongoDB?
  2. Explain single field vs. compound index.
  3. What are multikey indexes?
  4. What is a text index?
  5. How do geospatial indexes work?
  6. What is index cardinality?
  7. How do indexes improve performance?
  8. What is covered query in MongoDB?
  9. How to view all indexes in a collection?
  10. When can indexes hurt performance?

4. Aggregation Framework

  1. What is the MongoDB aggregation framework?
  2. Explain aggregation pipeline stages.
  3. How does $match work in aggregation?
  4. What is the purpose of $group?
  5. Explain $project stage with example.
  6. Difference between $lookup and $graphLookup.
  7. How do you calculate average using aggregation?
  8. What is $facet in aggregation?
  9. Compare aggregation framework vs MapReduce.
  10. What is $unwind in aggregation?

5. Data Modeling

  1. Explain embedding vs. referencing in MongoDB schema design.
  2. What is schema denormalization?
  3. When should you use referencing over embedding?
  4. What is the bucket pattern?
  5. Explain the subset pattern.
  6. How do you model hierarchical data in MongoDB?
  7. What are schema validation rules?
  8. How does MongoDB handle large documents?
  9. What is GridFS, and when is it used?
  10. What are anti-patterns in MongoDB schema design?

6. Transactions & Concurrency

  1. Does MongoDB support ACID transactions?
  2. How do you start a transaction in MongoDB?
  3. Can MongoDB handle multi-document transactions?
  4. How do you rollback a transaction?
  5. What is write concern in MongoDB?
  6. What is read concern in MongoDB?
  7. How does MongoDB handle concurrency?
  8. What is optimistic concurrency control?
  9. How does session work in transactions?
  10. What are the limitations of MongoDB transactions?

7. Replication & High Availability

  1. What is replication in MongoDB?
  2. What is a replica set?
  3. What happens if the primary node fails?
  4. How does MongoDB elect a new primary?
  5. What is replication lag?
  6. What are arbiters in replica sets?
  7. What is chained replication?
  8. How do hidden members work in replica sets?
  9. How do you configure priorities in replica sets?
  10. What is rollback in replication?

8. Sharding & Scalability

  1. What is sharding in MongoDB?
  2. When should you shard a collection?
  3. What is a shard key?
  4. Can you change a shard key?
  5. What is zone sharding?
  6. What is the role of mongos in sharding?
  7. What are jumbo chunks?
  8. What is pre-splitting in sharding?
  9. How do you check shard distribution?
  10. What are orphaned documents?

9. Security

  1. How does MongoDB implement authentication?
  2. What is role-based access control (RBAC)?
  3. How do you create a new MongoDB user?
  4. What are built-in roles in MongoDB?
  5. Explain SCRAM authentication.
  6. How do you enable TLS/SSL in MongoDB?
  7. What is field-level encryption?
  8. How do you audit database activity in MongoDB?
  9. What are best practices for securing MongoDB?
  10. How do you enable authorization in MongoDB?

10. Monitoring & Performance

  1. How do you monitor MongoDB performance?
  2. What is the profiler in MongoDB?
  3. How do you analyze slow queries?
  4. What is explain() in MongoDB?
  5. How do you monitor replication lag?
  6. What are important metrics to track in production?
  7. How do you optimize indexes in MongoDB?
  8. What is covered query optimization?
  9. How do you monitor sharded clusters?
  10. What are MongoDB Atlas monitoring tools?


Related Topics