← All interview questions

Skill Zuno · skillzunos.com · Fullstack

Nest interview questions

Prepare for Nest interviews on Skill Zuno. This practice book covers Nest interview questions across New, Easy, Medium, Hard, and Diff levels so you can work through real interview-style problems on skillzunos.com.

Open Nest on Skill Zuno

Also see the Nest tutorial.

NestJS is a progressive Node.js framework for building server-side applications in TypeScript. Its architecture of modules, controllers and providers, with dependency injection and decorators, is inspired by Angular. NestJS interviews cover modules, DI, the request lifecycle with middleware, guards, interceptors and pipes, and integration with databases.

Sample Nest interview questions

In what order do the parts of the request lifecycle run?

Middleware first, then guards, then interceptors before the handler, then pipes, then the route handler, then interceptors after the handler. Exception filters catch anything thrown along the way.

What is the difference between a guard and middleware?

Middleware runs before routing and does not know which handler will run. A guard runs after routing with an ExecutionContext, so it can read the handler's metadata, such as required roles, to decide whether to allow the request.

What are pipes used for?

Pipes transform and validate input before it reaches the handler. ParseIntPipe turns a string parameter into a number, and ValidationPipe checks a request body against a DTO's class-validator rules.

What are provider scopes?

Providers are singletons by default. REQUEST scope creates a new instance for each request and TRANSIENT creates one per consumer; both cost performance and should be used only when needed.

How do modules share providers?

A module lists a provider in exports, and other modules add that module to their imports. A module marked @Global() makes its exported providers available everywhere without importing it.

What you can practice

  • Nest interview questions for beginners and experienced developers
  • Level-based practice: New, Easy, Medium, Hard, and Diff
  • Fullstack topics alongside Nest on skillzunos.com

More Fullstack interview questions

All interview questions