What is the purpose of the 'getStatus()' method in a custom exception filter?
To set the response headers for the error response.
To determine the type of exception that was thrown.
To retrieve the HTTP status code associated with the exception.
To log the exception details to the console.
After installing the NestJS CLI, what command is used to initiate a new NestJS project?
npm init nestjs-app
nestjs create-app my-app
create-react-app my-nestjs-project
nest new project-name
What is the core purpose of NestJS?
Developing efficient and scalable server-side applications
Automating code deployment and server configuration
Building interactive front-end web applications
Managing and interacting with databases directly
What is the command to install the NestJS CLI globally?
npm install -g @nestjs/cli
yarn global add nestjs
install -g nestjs
npm install nestjs
What is a potential drawback of using singleton providers excessively in a large application?
Increased memory usage due to persistent instances.
Difficulty in testing individual components.
All of the above.
Slower application startup time.
How can you transform the data returned from a controller method using an Interceptor?
By calling a service method within the Interceptor.
By using RxJS operators on the Observable returned by next.handle().
next.handle()
By modifying the ctx.body property.
ctx.body
By directly modifying the controller method's return value.
How do you inject a provider from a different module in NestJS?
By using the @Inject() decorator and specifying the provider's class name.
@Inject()
By importing the module containing the provider into the module where you need it.
By accessing the global NestJS container.
By creating a new instance of the provider using its constructor.
Which of these features is NOT a primary advantage of using NestJS?
Provides a command-line interface (CLI) for easy project setup
Directly renders dynamic user interfaces in the browser
Encourages code organization through modules and providers
Leverages TypeScript for improved code structure and maintainability
What design pattern does NestJS heavily rely on for structuring code?
Singleton
Factory Method
Dependency Injection
Observer
How would you define a route parameter named 'id' in a NestJS route path?
/users/:id
/users?id=value
/users/<id>
/users/{id}