Why are database migrations important in a NestJS application using TypeORM?
To automatically generate frontend UI components
To track and apply changes to the database schema over time
To manage user sessions
To handle HTTP requests and responses
Which NestJS module is essential for working with event emitters and listeners?
@nestjs/event-emitter
@nestjs/core
@nestjs/platform-express
@nestjs/common
When might you choose to use a custom decorator instead of middleware in NestJS?
When you need access to the request or response objects within the logic.
When the logic you want to apply is highly specific to a single method or parameter.
When you want to modify the routing behavior of your application.
When you need to perform asynchronous operations before or after a request.
Which of the following transport mechanisms is well-suited for building highly scalable and real-time NestJS microservices?
File system
Email
Redis
HTTP
What is the recommended approach for handling exceptions in a production-ready NestJS application?
Implement only global exception filters for a centralized approach.
Rely solely on the default NestJS error handling mechanism.
Use a combination of global and custom exception filters for a layered approach.
Disable exception handling altogether for optimal performance.
What is a common approach to ensure data consistency when using CQRS and event-driven architecture in NestJS?
Using two-phase commit transactions for command and event handling
Disabling caching mechanisms to guarantee real-time data consistency
Implementing eventual consistency by updating read models asynchronously
Relying on the database's built-in transaction management system
What is the primary benefit of using custom HTTP exception filters in NestJS?
They allow you to define specific error responses for different HTTP exception types.
They simplify error handling by automatically logging all exceptions.
They prevent any and all errors from being thrown in your application.
They replace the need for traditional try...catch blocks in your controllers.
Which of these is NOT a common method for storing session data in a NestJS application?
Database storage
Local variable storage
In-memory storage
File system storage
Which testing approach in NestJS focuses on verifying the smallest isolated units of code, like individual functions or methods?
Integration Testing
System Testing
Unit Testing
End-to-End Testing
Integration testing in NestJS primarily aims to verify what aspect of the application?
The correctness of individual functions or methods
The interaction between different modules and components
The application's behavior in a real browser environment
The security vulnerabilities within the codebase