Interviewers probe embed vs reference, index design, aggregation literacy, consistency, and when not to use MongoDB.
Top themes
- Document modeling and anti-patterns (unbounded arrays)
- Index types, compound prefix rule, explain output
- Aggregation: $match, $group, $lookup, $unwind
- Replica set failover, transactions scope, shard key basics
- SQL vs Mongo vs Postgres JSONB trade-offs
Sample story
Prepare a 60-second example: catalog with variable attributes → embedded specs, indexed category + text search, aggregation for top sellers.
Practice: Review prior lessons in mongosh, then attempt interview-style queries without peeking.
Important interview questions and answers
- Q: When not Mongo?
A: Heavy cross-entity reporting and strict FK graphs often fit SQL better. - Q: COLLSCAN fix?
A: Add selective index matching query filter and sort.
Self-check
- Explain embed vs reference in one sentence.
- Name three aggregation stages.
Tip: Prepare one real embed vs reference story from a catalog or orders domain.
Interview prep
- When not Mongo?
- Heavy relational reporting and strict FK graphs often fit SQL.
- COLLSCAN fix?
- Add index matching filter and sort fields.