Databases: MongoDB, SQL and Redis Interview Questions for Full Stack with Node.js
24 Databases: MongoDB, SQL and Redis questions with answers for full stack with node.js roles — 7 easy, 13 medium, 4 hard.
About Databases: MongoDB, SQL and Redis
Work with MongoDB and Mongoose, PostgreSQL with pg and ORMs like Prisma, and Redis for caching. Learn schema design, embedding versus referencing, indexes, aggregation, transactions, connection pooling, migrations and fixing N+1 queries. Interviewers expect you to choose the right database for a use case and explain how you would speed up slow queries.
What is Mongoose and why use it with MongoDB?
Show answer
Define a Mongoose schema for a user with validation and an index.
Show answer
What is an index and how does it improve query performance?
Show answer
Explain ACID properties of a database transaction.
Show answer
Write a parameterised query with node-postgres to fetch a user's recent orders.
Show answer
What is Redis and how is it used with Node.js backends?
Show answer
What is a compound index and why does field order matter?
Show answer
What is the N+1 query problem and how do you fix it?
Show answer
What is the MongoDB aggregation pipeline? Give an example.
Show answer
When should you embed documents versus reference them in MongoDB?
Show answer
What is connection pooling and why is it important in Node.js?
Show answer
Compare Prisma, Sequelize and TypeORM for SQL databases in Node.js.
Show answer
Implement the cache-aside pattern with Redis for a product lookup.
Show answer
What is database normalisation and when would you denormalise?
Show answer
How do you manage database schema migrations in a Node.js project?
Show answer
Users report seeing stale prices after an update because of caching. How do you solve it?
Show answer
A Mongoose query returns large documents and the API is slow. What optimisations can you apply?
Show answer
What is soft delete and what are its trade-offs?
Show answer
Tell me about a time a database change caused an issue and what you learned.
Show answer
How do you use a MongoDB transaction in Mongoose?
Show answer
An API listing orders became slow after the table reached 50 million rows. How do you investigate?
Show answer
Your app gets 'too many connections' errors from PostgreSQL after scaling to 20 pods. What would you do?
Show answer
You need to choose a database for a food delivery app's orders, live rider locations and menus. What would you pick?
Show answer
Frequently asked questions
How important is Databases: MongoDB, SQL and Redis in Full Stack with Node.js interviews?
Work with MongoDB and Mongoose, PostgreSQL with pg and ORMs like Prisma, and Redis for caching. Learn schema design, embedding versus referencing, indexes, aggregation, transactions, connection pooling, migrations and fixing N+1 queries. Interviewers expect you to choose the right database for a use case and explain how you would speed up slow queries.
How should I use the Databases: MongoDB, SQL and Redis sheet?
Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.