Which of the following transport mechanisms is well-suited for building highly scalable and real-time NestJS microservices?
HTTP
Redis
Email
File system
What is the advantage of using a dedicated session store (like Redis) over in-memory storage for sessions in a production NestJS application?
Improved code readability
Enhanced security for sensitive data
Scalability and session persistence across multiple server instances
Simplified development setup
In a NestJS microservice architecture, how do services typically communicate with each other asynchronously?
Shared memory
Database triggers
Direct method calls
Message queues
What object in the intercept() method of a transformation interceptor allows you to modify the response stream?
intercept()
context.switchToHttp().getResponse()
context.getNext()
context.switchToWs().getClient()
context.getRequest()
What is the purpose of the 'transport' option when creating a NestJS microservice?
Specifying the communication protocol (e.g., TCP, Redis)
Defining the database connection
Configuring the user interface
Setting the logging level
What is the purpose of a Model in Mongoose?
To create and manage database migrations
To define a database connection string
To handle user authentication and authorization
To interact with a specific collection in the database based on a defined schema
Which built-in Pipe is suitable for automatically validating incoming requests against a TypeScript class?
ParseBoolPipe
ValidationPipe
DefaultValuePipe
ParseIntPipe
What is the difference between HttpException and a custom exception class in NestJS?
HttpException
There is no practical difference; both can be used interchangeably for error handling.
HttpException must be caught by custom exception filters, while custom exceptions are handled automatically.
HttpException is deprecated and should always be replaced with custom exception classes.
HttpException is used for generic HTTP errors, while custom exceptions represent specific business logic errors.
What is the purpose of the @nestjs/testing package in NestJS?
@nestjs/testing
Facilitates the deployment of NestJS applications to various cloud platforms
Enables integration with external continuous integration and delivery (CI/CD) pipelines
Offers tools for performance profiling and optimization of NestJS code
Provides utilities and helpers specifically designed for testing NestJS applications
Which testing type provides the most comprehensive coverage by simulating real user interactions with a running NestJS application?
Integration Testing
Unit Testing
Regression Testing
End-to-End (E2E) Testing