What is the primary security concern associated with storing session data in cookies?
Denial-of-service (DoS) attacks
Database injection attacks
Cross-site request forgery (CSRF) attacks
Cross-site scripting (XSS) attacks
Why is it generally advisable to have a balance of different testing types (unit, integration, E2E) in a NestJS project?
To reduce the need for manual testing efforts completely
To eliminate the possibility of introducing bugs during development entirely
To minimize the execution time of the entire test suite
To ensure comprehensive test coverage across different levels of the application
Which interface should a class implement to function as a Guard in NestJS?
IGuardProvider
IAuthorizationHandler
IInjectable
ICanActivate
Which testing type provides the most comprehensive coverage by simulating real user interactions with a running NestJS application?
End-to-End (E2E) Testing
Unit Testing
Regression Testing
Integration Testing
What object in the intercept() method of a transformation interceptor allows you to modify the response stream?
intercept()
context.getNext()
context.switchToHttp().getResponse()
context.getRequest()
context.switchToWs().getClient()
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.
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.
Disable exception handling altogether for optimal performance.
Use a combination of global and custom exception filters for a layered approach.
When creating a custom Pipe, which interface should your Pipe class implement?
PipeTransform
IPipe
CustomPipe
DataTransformer
What is a common use case for a class decorator in NestJS?
Modifying the response sent back to the client.
Adding common properties or methods to all instances of a class.
Defining custom route paths for controller methods.
Validating the structure of request payloads.
What is the role of the @SetMetadata decorator in NestJS?
@SetMetadata
It applies middleware to a specific route handler.
It defines a custom decorator factory.
It validates the data type of a method parameter.
It attaches metadata to a class or method.