What is Express.js?
Why Interviewers Ask This
This is a classic screening question for Node.js roles. Hiring managers ask it early in interviews to gauge your baseline understanding and determine if you can communicate technical concepts clearly.
Answer
Express.js is the most popular, minimal, and flexible Node.js web application framework. It provides a thin layer of web application features on top of Node's built-in http module without obscuring Node.js features. Key features: (1) Routing — define route handlers for different HTTP methods and URL patterns: app.get("/users/:id", handler); (2) Middleware — chain functions that have access to request and response objects; (3) Template engines — integrates with EJS, Pug, Handlebars; (4) Static file serving — express.static(); (5) Error handling — centralized error-handling middleware with 4 parameters (err, req, res, next). Express is unopinionated — it imposes minimal structure, which makes it flexible but also means you choose your own patterns for things like authentication, database access, and validation. Alternatives include Fastify, Koa, Hapi, and NestJS.
Pro Tip
If you're unsure about a detail, say so honestly and explain your reasoning. Interviewers respect candidates who can think through uncertainty rather than bluffing.