What is the default scope of a provider in NestJS?
Transient
Module-scoped
Singleton
Request-scoped
What is a potential drawback of using singleton providers excessively in a large application?
Slower application startup time.
Difficulty in testing individual components.
Increased memory usage due to persistent instances.
All of the above.
Which design pattern heavily influences the architecture of NestJS?
Factory
Dependency Injection
Observer
What is the primary function of a module in NestJS?
To define the application's entry point.
To interact with databases and external APIs.
To organize code into related units and manage dependencies.
To handle HTTP requests and responses.
What are the building blocks of a NestJS application called?
Services
Modules
Controllers
Components
What is the purpose of the @Body() decorator?
@Body()
Accesses query parameters
Accesses the request headers
Accesses the entire request body
Accesses route parameters
Which interface does a custom exception filter in NestJS need to implement?
HttpException
CanActivate
ExceptionFilter
Injectable
Which decorator is used to define a controller in NestJS?
@Component()
@Module()
@Controller()
@Injectable()
What is the role of the next() function in NestJS middleware?
next()
To terminate the request-response cycle.
To pass control to the next middleware in the stack or the route handler.
To log information about the request.
To send a response back to the client.
Which HTTP method does the @Post() decorator handle?
@Post()
DELETE
PUT
POST
GET