Skip to main content
Journey Uncommon Logo
JourneyUncommon

MongoDB Interview Questions (589 to practise)

MongoDB is a document database. Its interviews are about data modelling and index design far more than about query syntax.

Embedding versus referencing, multikey and compound index behaviour, aggregation pipeline stages, read and write concern trade-offs, sharding keys, and replica-set elections.

Total questions
589
Easy
99
Medium
246
Hard
244

Where it shows up: Backend roles at document-store shops, analytics pipelines, and teams running Atlas in production.

Sample MongoDB questions

Twenty real MongoDB questions from the library, code snippet included. Nothing here is paraphrased for search engines. It is the same text a signed-in user sees.

easy_id and ObjectId

What does this code print?

const ObjectId = require("mongodb").ObjectId;
const a = new ObjectId("507f1f77bcf86cd799439011");
const b = new ObjectId("507f1f77bcf86cd799439011");
console.log(a === b);
console.log(a.equals(b));
Read the full question →
Sign in to answer

Everything above is free to read. Answering needs a free account.

We keep the correct answer, the explanation and the scoring behind sign-in so the platform stays honest, which is why the answer options and the worked explanation for every MongoDB question stay behind a free account. Signing in is free and takes a few seconds.

MongoDB topics covered

53 distinct MongoDB topics are tagged across the library. These are the real topic labels stored on the questions, not a hand-written list.

  • covered queries internals (25)
  • WiredTiger storage engine (23)
  • multikey array indexes (23)
  • aggregation $match $group (23)
  • read concern levels (23)
  • text and $regex search (20)
  • partial and sparse indexes (19)
  • multi-document transactions (19)
  • embedding vs referencing (19)
  • mongos query routing (19)
  • bucket and outlier patterns (18)
  • Aggregation pipeline execution (17)
  • TTL indexes (16)
  • the replica set oplog (16)
  • $lookup joins (15)
  • $unwind arrays (14)
  • Working set and memory (14)
  • replica-set elections (14)
  • $facet multi-pipeline (13)
  • chunk splitting and balancing (12)
  • documents and collections (12)
  • updateOne and $set (12)
  • single-field indexes (11)
  • compound indexes (11)
  • change streams (11)
  • Index intersection (11)
  • journaling and durability (10)
  • snapshot isolation internals (10)
  • write concern w majority (10)
  • read preference and staleness (10)
  • comparison operators $gt $in (9)
  • sharding and shard keys (9)
  • find and query filters (8)
  • geospatial queries (8)
  • insertOne insertMany (8)
  • schema validation rules (8)
  • $push and $pull (7)
  • explain basics (7)
  • sort limit skip (6)
  • query planner plan cache (6)
  • deleteOne deleteMany (5)
  • the WiredTiger storage engine (5)
  • the query planner plan cache (5)
  • _id and ObjectId (4)
  • projection include exclude (4)
  • nested embedded documents (3)
  • BSON data types (3)
  • upsert basics (3)
  • replica set oplog (3)
  • arrays in documents (2)
  • countDocuments (2)
  • text and regex search (2)
  • replica set elections (2)

Search and filter every MongoDB question

Difficulty