What is the primary security concern associated with storing session data in cookies?
Cross-site scripting (XSS) attacks
Cross-site request forgery (CSRF) attacks
Database injection attacks
Denial-of-service (DoS) attacks
Why are database migrations important in a NestJS application using TypeORM?
To automatically generate frontend UI components
To manage user sessions
To handle HTTP requests and responses
To track and apply changes to the database schema over time
What is the primary purpose of a Guard in NestJS?
To control access to routes or resources based on certain conditions.
To define the structure of a request body.
To handle database interactions.
To render HTML templates on the server.
What is the primary purpose of custom decorators in NestJS?
To define custom middleware functions within a controller.
To enhance code reusability and readability by encapsulating common logic.
To directly modify the underlying Express.js request and response objects.
To enforce strict type checking at compile time.
What is a key advantage of using a message broker like RabbitMQ or Kafka for NestJS microservice communication?
Simplified database management
Improved error handling and retries
Reduced need for code testing
Automatic user interface generation
What is a common tool or library used for End-to-End (E2E) testing in a NestJS project?
Supertest
Istanbul
Enzyme
Sinon
In JWT authentication, what does JWT stand for?
JSON Web Token
Java Web Token
Just Write Tests
JavaScript Web Token
What decorator is used to register a caching interceptor globally in a NestJS application?
@GlobalInterceptor(CacheInterceptor)
@GlobalCache()
@Cache()
@UseInterceptors(CacheInterceptor)
What is the typical role of a @SetMetadata decorator when working with custom Guards in NestJS?
@SetMetadata
It defines the structure of the response sent back to the client.
It is used to inject dependencies into Guards.
It attaches custom metadata to route handlers, which can be accessed within the Guard to make authorization decisions.
It directly handles user authentication logic.
What is the role of the 'transform()' method within a custom Pipe in NestJS?
It defines the metadata associated with the Pipe.
It determines if the Pipe should be applied globally.
It specifies how the Pipe should handle errors.
It contains the logic to transform the input data.