MongoDB Architecture — MongoDB Technical Interview Questions & Answers

Databases, collections, documents and the WiredTiger storage engine.

MongoDB Architecture

  • Simple meaning: MongoDB is a process (mongod) that stores databases. Each database has collections. Each collection has documents.
  • Storage engine: WiredTiger (default) — how data sits on disk. You rarely change this as a beginner.
  • Replica set: several mongod processes with the same data (high availability). Sharding: several shards for huge data.
  • You talk through: mongosh / Compass / a driver → mongod (or mongos in a sharded cluster).
  • Try this: db.stats() after inserting students — you see counts and size.
  • Common mistake: drawing “tables inside tables”. It is database → collection → document.
  • Interview tip: Client → mongod. Data: DB / collection / document. Replica set for copies. Shard for scale-out.
  mongosh / Compass / driver
           │
           ▼
        mongod
           │
           ▼
   DB → collection → doc

Technical Interview Tip: Name the three layers and what mongod is.

Code Examples for MongoDB Architecture

MongoDB Architecture — working example

// MongoDB Architecture
db.users.find({ active: true }).sort({ name: 1 }).limit(5)

MongoDB Architecture: find active users, sort by name, limit 5.

How to Explain MongoDB Architecture to an Interviewer

What is mongod?

The MongoDB server process that stores data