MongoDB interview questions

Embedding vs referencing, indexes, aggregation pipelines, transactions and schema design mistakes.

Readiness: 0 of 7 nailed

How to use this page: 1. Read a question2. Type your answer3. Check with AI4. Open the model answer5. Timed drill when you’re 70% ready

Schema design

JuniorConcept

When do you embed documents and when do you reference them?

JuniorConcept

MongoDB is “schemaless”. Should you still have a schema?

Querying

Mid-levelWrite it by hand

Get total revenue per month for paid orders using an aggregation pipeline.

Performance

JuniorConcept

How do indexes work in MongoDB, and what is the ESR rule?

Consistency

Mid-levelConcept

Does MongoDB support transactions?

Basics

FoundationConcept

What is an ObjectId?

Scaling

SeniorConcept

What is sharding and how do you choose a shard key?

Also prepare