Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Typescript: Nestjs

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is NestJS?

a)

A front-end JavaScript framework

b)

A back-end JavaScript framework

c)

A mobile app development framework

d)
  1. A database management framework

2.

NestJS is built on top of which JavaScript runtime?

a)

Node.js

b)

React

c)

Angular

d)

Vue

3.

Which programming language is primarily used in NestJS?

a)

Java

b)

Python

c)

Typescript

d)

C++

4.

NestJS uses which design pattern for organizing code and modules?

a)

MVC (Model-View-Controller)

b)

MVVM (Model-View-ViewModel)

c)

Dependency Injection

d)

Observer

5.

What is the purpose of the @Module decorator in NestJS?

a)

To define a module

b)

To define a component

c)

To define a service

d)

To define a controller

6.

In NestJS, what is a provider?

a)

A database

b)

A service, or repository

c)

A middleware

d)

An Angular component

7.

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

a)

@Fetch

b)

@Get

c)

@Create

d)

@Update

8.

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

a)

To define a module

b)

To define a service

c)

To define a controller

d)

To define a component

9.

In NestJS, how can you inject a service into a controller?

a)

Using @Injectable decorator

b)

Using @Service decorato

c)

Automatically without any decorator

d)

None of the options

10.

What is the purpose of the main.ts file in a NestJS application?

a)

Entry point of the application

b)

Configuration file for the database

c)

File containing middleware definitions

d)

File defining routes

11.

How can you access route parameters in a NestJS controller method?

a)

Using the @Param() decorator

b)

Automatically without any decorator

c)

Using the @Query() decorator

d)

Using the @RouteParams() decorator

12.

How can you handle asynchronous operations in a NestJS controller method?

a)

Using async/await keywords

b)

By defining a separate service for asynchronous tasks

c)

By using the @Async decorator

d)
  1. NestJS does not support asynchronous operations in controllers

13.

Which decorator is used to bind a parameter to the body of a POST request in NestJS?

a)

@Body

b)

@Param

c)

@Request

d)

@Payload

14.

How can you secure routes in NestJS based on user roles?

a)

Using the @SecureRoles() decorator

b)

By implementing role-based guards

c)

Configuring roles in the main.ts file

d)

NestJS does not support role-based access control

15.

How can you define a global exception filter in NestJS?

a)

Using the @Global() decorator on the exception filter class

b)

Using the @UseFilters() decorator on each controller

c)

By configuring it in the main.ts file

d)

NestJS does not support global exception filters