Online Exam Quiz

questionQuestion  1 to 30

What is the primary purpose of guards in NestJS?

  • Data validation
  • Error handling
  • Authentication and authorization
  • Request routing
Mark for review

Which command is used to create a new NestJS application?

  • ng new
  • nest new
  • npm create nest
  • create-nest-app
Mark for review

What is the purpose of guards in NestJS?

  • To validate request data
  • To handle HTTP responses
  • To implement authentication and authorization logic
  • To define application routes
Mark for review

What is the primary purpose of pipes in NestJS?

  • Data transformation
  • Handling HTTP requests
  • Validating input data
  • Defining application routes
Mark for review

Which of the following is NOT a valid HTTP method in NestJS?

  • GET
  • DELETE
  • PATCH
  • UPDATE
Mark for review

What is the purpose of the @Controller() decorator in NestJS?

  • To define a service
  • To define a module
  • To define a middleware
  • To define a controller
Mark for review

Which of the following is true about interceptors in NestJS?

  • Interceptors can only modify request data
  • Interceptors execute before guards in the request pipeline
  • Interceptors cannot be used for logging
  • Interceptors are only used for error handling
Mark for review

How can you handle file uploads in NestJS?

  • By using the @FileUpload() decorator
  • By configuring middleware to parse multipart/form-data
  • By using the fs module from Node.js
  • By defining a custom interceptor
Mark for review

What is the purpose of DTOs (Data Transfer Objects) in NestJS?

  • To define database schemas
  • To encapsulate data validation logic
  • To define service interfaces
  • To manage authentication
Mark for review

What does NestJS use as its primary programming language?

  • Java
  • TypeScript
  • Python
  • Ruby
Mark for review

How can you configure logging in NestJS?

  • By using the @Logger() decorator
  • By setting up a logging provider in the module
  • By configuring logging in the nest-cli.json file
  • By using the console.log() function
Mark for review

How can you handle database operations in NestJS?

  • By using the @Database() decorator
  • By defining a custom middleware
  • By using third-party libraries like TypeORM or Sequelize
  • By directly interacting with the database in controllers
Mark for review

How can you configure authentication in NestJS?

  • By using the @Authentication() decorator
  • By defining middleware to handle authentication logic
  • By setting up a third-party authentication provider
  • By using the built-in AuthGuard class
Mark for review

What is the purpose of serialization in NestJS?

  • To optimize database queries
  • To convert JSON data to class instances and vice versa
  • To encrypt sensitive information
  • To define API routes
Mark for review

What is Dependency Injection (DI) in NestJS?

  • A way to inject dependencies into components
  • A method for executing asynchronous tasks
  • A data encryption technique
  • A form of HTML injection vulnerability
Mark for review

How can you handle Cross-Origin Resource Sharing (CORS) in NestJS?

  • By using the @CrossOrigin() decorator
  • By using the @CrossOrigin() decorator
  • By setting CORS headers in middleware
  • By using the @EnableCors() decorator
Mark for review

What does Dependency Injection (DI) enable in NestJS?

  • Better performance
  • Code reuse
  • Tight coupling
  • Simpler debugging
Mark for review

What does serialization enable in NestJS?

  • Efficient database queries
  • Type checking
  • Conversion of JSON data to class instances and vice versa
  • Secure authentication
Mark for review

How can you enable CORS (Cross-Origin Resource Sharing) in NestJS?

  • By using the @EnableCors() decorator
  • By configuring CORS in the nest-cli.json file
  • By using the @CrossOrigin() decorator
  • By setting CORS headers in middleware
Mark for review

What is the primary language used in NestJS development?

  • Java
  • Python
  • TypeScript
  • PHP
Mark for review

Which of the following is NOT a core concept in NestJS?

  • Middleware
  • Components
  • Modules
  • Schemas
Mark for review

What programming language does NestJS primarily use?

  • Python
  • JavaScript
  • TypeScript
  • Java
Mark for review

What is NestJS?

  • A database management system
  • A TypeScript-based Node.js framework
  • A front-end JavaScript library
  • An operating system kernel
Mark for review

What is the primary role of guards in NestJS?

  • Data validation
  • Error handling
  • Authentication and authorization
  • Request routing
Mark for review

What does the @Module() decorator signify in NestJS?

  • It defines a service
  • It defines a controller
  • It defines a module
  • It defines a component
Mark for review

How can you handle CORS (Cross-Origin Resource Sharing) in NestJS?

  • By using the @CrossOrigin() decorator
  • By configuring CORS in the nest-cli.json file
  • By setting CORS headers in middleware
  • By using the @EnableCors() decorator
Mark for review

What does interception enable in NestJS?

  • Request validation
  • Response transformation
  • Error handling
  • Dependency injection
Mark for review

What is NestJS primarily built on top of?

  • Express.js
  • Django
  • Flask
  • Laravel
Mark for review

How can you handle errors globally in NestJS?

  • By using the @ErrorHandler() decorator
  • By defining an exception filter
  • By setting up a catch-all route
  • By using the try...catch statement in controllers
Mark for review

What is the purpose of a controller in NestJS?

  • To define application routes
  • To manage database connections
  • To handle middleware
  • To encapsulate business logic
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review