Full Stack with Node.js Interview Questions & Answers
All 200 unique questions in one place — 63 easy, 97 medium, 40 hard — grouped by topic.
Practise by topic
Practise the way your interview works
What is the difference between CommonJS and ES Modules in Node.js?
Show answer
What are streams in Node.js and what types exist?
Show answer
What is the Buffer class in Node.js?
Show answer
What is the EventEmitter and how do you use it?
Show answer
Write a simple custom EventEmitter usage for an order service.
Show answer
Create a basic HTTP server in Node.js without any framework.
Show answer
What is package.json and what is the difference between dependencies and devDependencies?
Show answer
What is package-lock.json and why should it be committed?
Show answer
Explain semantic versioning and the meaning of ^ and ~ in package.json.
Show answer
A teammate uses fs.readFileSync inside an Express route. What is the problem and what would you suggest?
Show answer
Tell me about a time you learned a new backend technology quickly to deliver a feature.
Show answer
Explain the Node.js event loop and its main phases.
Show answer
Is Node.js single-threaded? Explain the role of libuv.
Show answer
What is the difference between process.nextTick and setImmediate?
Show answer
How do you read a large file efficiently in Node.js?
Show answer
Your Node.js API becomes unresponsive when one endpoint generates a large PDF report. What is happening and how do you fix it?
Show answer
How would you handle uncaughtException and unhandledRejection in production?
Show answer
How do you implement graceful shutdown in a Node.js server?
Show answer
What is the purpose of the util.promisify function?
Show answer
Describe a situation where you found and fixed a production performance problem.
Show answer
What is backpressure in streams and how does pipeline handle it?
Show answer
How do worker_threads differ from the cluster module?
Show answer
Memory usage of a Node.js service grows steadily until the pod restarts. How would you find the leak?
Show answer
You need to choose between Node.js and Java for a new high-traffic service. How would you decide?
Show answer
What is a callback and what is callback hell?
Show answer
What is a Promise and what are its states?
Show answer
How do you run async tasks in parallel versus in sequence?
Show answer
Why is using async callbacks inside forEach a common bug?
Show answer
Convert this callback-based function to async/await: fs.readFile(path, 'utf8', (err, data) => {...}).
Show answer
What is a closure and how is it used in Node.js code?
Show answer
What is the difference between var, let and const?
Show answer
How do you explain asynchronous programming to a non-technical stakeholder or junior teammate?
Show answer
Explain the difference between Promise.all, Promise.allSettled, Promise.race and Promise.any.
Show answer
How does async/await work under the hood?
Show answer
What is the output order of this code: console.log('A'); setTimeout(() => console.log('B'), 0); Promise.resolve().then(() => console.log('C')); console.log('D');
Show answer
What are microtasks and macrotasks?
Show answer
How do you add a timeout to a promise?
Show answer
What happens if you forget to await a promise inside a try/catch?
Show answer
How does the this keyword behave in arrow functions compared to regular functions?
Show answer
Write a retry function with exponential backoff for a flaky API call.
Show answer
A dashboard endpoint makes five independent database queries one after another and takes 1.5 seconds. How would you speed it up?
Show answer
How can you cancel an in-flight HTTP request in Node.js?
Show answer
What is the difference between throwing an error and rejecting a promise inside an async function?
Show answer
A scheduled job processes orders with setInterval every minute, but sometimes runs overlap and duplicate emails are sent. How do you fix it?
Show answer
Explain debounce and throttle and where they matter on the backend.
Show answer
Tell me about a time you had to debug a tricky asynchronous bug.
Show answer
How do you limit concurrency when calling an external API for 10,000 records?
Show answer
What are async iterators and when would you use for await...of?
Show answer
Two simultaneous requests both read a wallet balance, deduct money and save it, causing a wrong balance. How do you fix this race condition?
Show answer
Your service calls three microservices and fails completely if one is down. How would you make it more resilient?
Show answer
What is Express.js and why is it widely used?
Show answer
What is middleware in Express?
Show answer
What is the difference between app.use and app.get?
Show answer
How do you use express.Router to organise routes?
Show answer
What is the difference between req.params, req.query and req.body?
Show answer
How do you enable CORS in an Express app and why is it needed?
Show answer
What does helmet do in an Express application?
Show answer
What is the difference between res.send, res.json and res.end?
Show answer
What causes the error 'Cannot set headers after they are sent to the client'?
Show answer
A client reports that a large JSON POST request fails with 413 Payload Too Large. What do you do?
Show answer
Describe a time you disagreed with a senior developer on a technical approach.
Show answer
How does error-handling middleware work in Express?
Show answer
Write a centralised error handler with a custom AppError class.
Show answer
How do you handle async errors in Express 4 routes?
Show answer
Write a simple request logging middleware that records response time.
Show answer
How do you handle file uploads in Express?
Show answer
How would you structure a large Express project?
Show answer
How do you validate request bodies in Express?
Show answer
After adding a new middleware, all routes return 404 or hang. How do you debug it?
Show answer
When would you choose NestJS or Fastify over Express?
Show answer
How do you serve a React build and an API from the same Express server?
Show answer
How do you design Express middleware that checks user roles for a route?
Show answer
Tell me about a time you improved code quality in a backend codebase you inherited.
Show answer
What changed in Express 5 compared to Express 4?
Show answer
Your Express API needs to support multiple client apps with different rate limits. How would you design it?
Show answer
What is a REST API and what are its key constraints?
Show answer
Explain the main HTTP methods and which are idempotent.
Show answer
Which HTTP status codes should a REST API commonly return?
Show answer
What is the difference between PUT and PATCH?
Show answer
How do you design good REST endpoint URLs?
Show answer
How do you document a REST API?
Show answer
Compare offset pagination and cursor pagination.
Show answer
Implement cursor-based pagination for a products endpoint.
Show answer
What are the common strategies for API versioning?
Show answer
How do you design a consistent error response format for an API?
Show answer
What is the difference between REST and GraphQL?
Show answer
How do you implement filtering and sorting safely from query parameters?
Show answer
Design endpoints for a simple e-commerce cart and checkout.
Show answer
A mobile app team complains your API returns too much data and is slow on 4G. What would you change?
Show answer
You must change a response field name used by many clients. How do you do it without breaking them?
Show answer
How does HTTP caching with ETag and Cache-Control work for APIs?
Show answer
How do you handle a breaking API change request from a product manager close to a release?
Show answer
Tell me about an API you designed that you are proud of.
Show answer
What is idempotency and how do you implement idempotency keys for a payment API?
Show answer
What is HATEOAS and is it used in real projects?
Show answer
How would you design an API for a long-running task such as exporting a 1 GB report?
Show answer
How do you implement and secure webhooks that your API sends to customers?
Show answer
Write code to verify an HMAC signature on an incoming webhook in Express.
Show answer
A partner integration retries POST requests on timeouts and creates duplicate orders in your API. How would you redesign the endpoint?
Show answer
What is the difference between authentication and authorisation?
Show answer
What is a JWT and what are its three parts?
Show answer
How should passwords be stored in a database?
Show answer
What is SQL injection and how do you prevent it in Node.js?
Show answer
How do you manage secrets such as database passwords and API keys in a Node.js app?
Show answer
How do you keep yourself updated about security best practices as a backend developer?
Show answer
Compare session-based authentication with JWT-based authentication.
Show answer
How do access tokens and refresh tokens work together?
Show answer
Write JWT authentication middleware for Express.
Show answer
Write signup and login handlers using bcrypt.
Show answer
Where should a web app store tokens: localStorage or cookies?
Show answer
What is the difference between OAuth 2.0 and OpenID Connect?
Show answer
What is NoSQL injection in MongoDB and how do you prevent it?
Show answer
What are XSS and CSRF and how do you protect a Node.js app from them?
Show answer
How do you implement rate limiting on a login endpoint?
Show answer
How do you implement role-based access control (RBAC) in an API?
Show answer
What is the OWASP Top 10 and which items matter most for Node.js APIs?
Show answer
A security audit finds that users can see other users' orders by changing the order ID in the URL. How do you fix it?
Show answer
How would you add OTP-based login for an Indian mobile app?
Show answer
npm audit reports a critical vulnerability in a dependency of a dependency. What do you do?
Show answer
Tell me about a time you found a security issue in code and how you handled it.
Show answer
Explain OAuth 2.0 and the Authorization Code flow with PKCE.
Show answer
Your JWT secret has leaked. What steps do you take?
Show answer
How would you design authentication for a system of ten microservices?
Show answer
How do you prevent server-side request forgery when your API fetches a user-supplied URL?
Show answer
What is the difference between SQL and NoSQL databases?
Show answer
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
What is the difference between unit, integration and end-to-end tests for a Node.js API?
Show answer
Write a Jest unit test for a function that calculates order total with GST.
Show answer
How do you debug a Node.js application?
Show answer
Why is structured logging important and which libraries are used?
Show answer
What is code coverage and is 100 percent coverage a good goal?
Show answer
A new developer pushes code that breaks the login API in staging. How would you prevent this in future?
Show answer
How do you handle a situation where you cannot find the root cause of a bug before a deadline?
Show answer
How do you test Express routes with Supertest?
Show answer
How do you mock a database or external service in Jest?
Show answer
What is the built-in node:test runner and when would you use it over Jest?
Show answer
How do you run integration tests against a real database in CI?
Show answer
A test passes locally but fails randomly in CI. How do you approach this flaky test?
Show answer
How would you test code that depends on the current time, like an expiring coupon?
Show answer
Tell me about a production incident you handled and what you did after it.
Show answer
Describe how you would mentor a junior developer who writes no tests.
Show answer
How do you add a correlation ID to every log line for a request?
Show answer
Production shows intermittent 502 errors from the load balancer but your app logs show nothing. How do you investigate?
Show answer
How do you find which function is using the most CPU in a Node.js service?
Show answer
What is contract testing and why is it useful for microservices?
Show answer
How do you load test a Node.js API before a big sale event?
Show answer
A regex in your validation code makes the server hang on certain inputs. What is the issue?
Show answer
After a Node.js version upgrade, a few integration tests fail with date and crypto differences. How do you handle the upgrade safely?
Show answer
What is PM2 and when do you need it?
Show answer
Why put Nginx in front of a Node.js application?
Show answer
What are common ways to deploy a Node.js API in 2026?
Show answer
Write a simple Docker Compose file to run a Node API with MongoDB and Redis locally.
Show answer
How do you manage configuration for dev, staging and production environments?
Show answer
Why do you want to work as a Node.js backend developer?
Show answer
Write a Dockerfile for a production Node.js API.
Show answer
How do you scale a Node.js application horizontally?
Show answer
Write a basic GitHub Actions workflow that tests and builds a Node.js app.
Show answer
What are health check endpoints and what is the difference between liveness and readiness?
Show answer
How do you use a message queue to process background jobs in Node.js?
Show answer
How do you implement real-time features like live order tracking in Node.js?
Show answer
What metrics would you monitor for a Node.js API in production?
Show answer
Should you use serverless functions like AWS Lambda for a Node.js API?
Show answer
How do you enable compression and why should you be careful with it?
Show answer
How do you use the Node.js cluster module to use all CPU cores?
Show answer
What is an API gateway and what does it do in a Node.js microservice setup?
Show answer
Tell me about a time you had to balance speed of delivery with technical quality.
Show answer
How do you prioritise when multiple teams ask you for backend changes at the same time?
Show answer
How do you prepare a Node.js app for production readiness review?
Show answer
When would you use Kafka instead of a Redis-based queue like BullMQ?
Show answer
Your API's p99 latency is high during peak hours even though CPU is only 40 percent. What could be wrong?
Show answer
How do you achieve zero-downtime deployments for a Node.js service?
Show answer
Your service is expected to get ten times normal traffic during a festive sale. How do you prepare?
Show answer
How would you migrate a monolithic Node.js app to microservices?
Show answer
How do you design an API that needs to handle 50,000 requests per second for reading product details?
Show answer
How do you prevent a cache stampede when a popular key expires?
Show answer
Describe a time you led a technical decision that affected the whole team.
Show answer
How do you optimise JSON serialisation for very large API responses?
Show answer
Frequently asked questions
What jobs can I get after learning Node.js?
You can apply for Node.js Developer, Backend Developer, MERN Full Stack Developer, API Developer and Integration Engineer roles. Startups, product companies, fintech, e-commerce and IT service firms hire Node.js developers for APIs, real-time features and microservices. With two to five years of experience you can move into Senior Backend Engineer or Tech Lead roles, especially if you also learn system design, cloud deployment and databases well.
Who is eligible to learn Full Stack with Node.js?
Students of BTech, BCA, MCA, BSc IT and similar courses, freshers from any graduation stream with interest in coding, and working professionals moving from testing, support or frontend roles can join. Basic computer skills and logical thinking are enough to start. Knowing HTML, CSS and basic JavaScript helps, but the course begins with JavaScript fundamentals before moving to Node.js and Express.
How long does it take to become job-ready in Node.js?
With regular practice of two to three hours a day, most learners become job-ready in about three to four months. The first month covers JavaScript and async concepts, the next two cover Express, databases, authentication and testing, and the last weeks focus on deployment and a full project. Building two or three real projects and practising interview questions matters more than finishing videos quickly.
Is Node.js still in demand in 2026?
Yes. Node.js remains one of the most used backend runtimes, powering APIs, BFF layers, real-time apps and serverless functions. Indian startups and product companies like it because teams can use JavaScript and TypeScript across frontend and backend. Demand is strongest for developers who combine Node.js with TypeScript, databases, cloud deployment, testing and good API design, rather than only basic CRUD skills.
Do I need to learn TypeScript and React along with Node.js?
For backend-only roles, strong JavaScript and Node.js are enough to start, but TypeScript is now expected in many job descriptions, so learn it after the basics. For full stack roles, React is the most common frontend pairing, forming the MERN stack. A good path is JavaScript, Node and Express first, then TypeScript, then React, building one full stack project that uses all of them.
Will I get a certificate and does it help in getting a job?
You receive a course completion certificate after finishing the training and projects, which you can add to your resume and LinkedIn profile. A certificate shows commitment, but recruiters mainly judge Node.js candidates on projects, GitHub code, problem solving and interview performance. Combine the certificate with deployed projects, a clean GitHub profile and solid answers to core backend questions for the best results.