Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Express and Angular Quiz

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Which command is used to install Express in a Node.js project?

a)

npm install express

b)

npm add express

c)

install express

d)

npm get express

2.

In Express, which method is used to define a route for a GET request?

a)

app.route()

b)

app.get()

c)

app.post()

d)

app.listen()

3.

What is the purpose of the res.send() method in Express?

a)

To retrieve data from the server

b)

To send a response back to the client

c)

To log requests

d)

To initialize a server

4.

In Angular, what is the main purpose of a component?

a)

To manage data

b)

To define the structure of a database

c)

To control a part of the user interface

d)

To handle routing

5.

Which of the following is a built-in directive in Angular?

a)

ngShow

b)

ngSwitch

c)

ngDisplay

d)

ngForEach

6.

How can you bind a component property to an HTML element in Angular?

a)

Using ngModel

b)

Using {{ }} syntax

c)

Using [( )] syntax

d)

Using @Input()

7.

What does req.params access in an Express application?

a)

HTTP headers

b)

Route parameters

c)

Query string parameters

d)

Request body

8.

Which Angular feature allows for bidirectional data flow?

a)

Property Binding

b)

Event Binding

c)

Two-Way Binding

d)

Interpolation

9.

What is the purpose of ngFor in Angular?

a)

To create multiple components

b)

To loop through data in a collection

c)

To conditionally include elements

d)

To bind properties to elements

10.

Which command is used to create a new Angular component using the CLI?

a)

ng component my-component

b)

ng generate component my-component

c)

ng create component my-component

d)

ng make component my-component

11.

How do you serve static files in an Express application?

a)

app.serveStatic('public')

b)

app.use(express.static('public'))

c)

app.static('public')

d)

app.serve('public')

12.

In Angular, what does the @Injectable() decorator do?

a)

It defines a component

b)

It specifies a service

c)

It allows dependency injection for a class

d)

It binds data to the template

13.

What is the correct way to handle a POST request in Express?

a)

app.get('/user', (req, res) => { ... })

b)

app.post('/user', (req, res) => { ... })

c)

app.put('/user', (req, res) => { ... })

d)

app.delete('/user', (req, res) => { ... })

14.

Which Angular directive would you use to conditionally display an element?

a)

ngFor

b)

ngIf

c)

ngSwitch

d)

ngHide

15.

In Angular, which binding syntax is used for event binding?

a)

{{ event }}

b)

[event]

c)

(event)

d)

[(event)]

16.

Which of the following correctly defines a route in an Angular application?

a)

const routes = [ { path: 'home', component: HomeComponent } ];

b)

const routes = [ { route: 'home', component: HomeComponent } ];

c)

const routes = [ { path: 'home', component: 'HomeComponent' } ];

d)

const routes = [ { url: 'home', component: HomeComponent } ];

17.

What is the purpose of res.json() in Express?

a)

To send a JSON response to the client

b)

To convert a response to JSON format

c)

To send a plain text response

d)

To log data in JSON format

18.

In Angular, what is the main benefit of using TypeScript?

a)

It is easier to write than JavaScript

b)

It provides static typing

c)

It is faster than JavaScript

d)

It has built-in support for Angular

19.

Which statement best describes Angular’s data binding?

a)

It allows synchronization between model and view

b)

It only updates the view

c)

It only updates the model

d)

It does not support two-way communication

20.

How do you access the query string parameters in Express?

a)

req.body

b)

req.query

c)

req.params

d)

req.headers

21.

What does the ngStyle directive do in Angular?

a)

Changes the structure of the DOM

b)

Applies classes to an element

c)

Adds or removes inline styles

d)

Binds component properties

22.

In Angular, what does the expression {{ user.name }} do?

a)

It executes a function called user

b)

It displays the value of the name property of the user object

c)

It assigns a value to user.name

d)

It creates a new variable called user

23.

What is the purpose of middleware in Express?

a)

To define routes

b)

To process requests before reaching the route handlers

c)

To send responses

d)

To log errors

24.

Which of the following is NOT a type of data binding in Angular?

a)

Interpolation

b)

Property Binding

c)

Event Binding

d)

Response Binding

25.

What command starts an Angular application?

a)

ng serve

b)

ng start

c)

ng run

d)

ng launch

26.

How can you conditionally apply CSS classes in Angular?

a)

Using ngStyle

b)

Using ngIf

c)

Using ngClass

d)

Using ngSwitch

27.

In an Angular service, how is data typically retrieved from an API?

a)

Using HttpClient

b)

Using fetch()

c)

Using a plain XMLHttpRequest

d)

Using getData()

28.

What does app.listen(port, () => { ... }) do in Express?

a)

Initializes a database

b)

Starts the server and listens for incoming requests on the specified port

c)

Defines a new route

d)

Sends a response to the client

29.

How do you create a two-way data binding for an input field in Angular?

a)

Using ngModel

b)

Using @Input()

c)

Using @Output()

d)

Using {{ }}

30.

In Angular, which lifecycle hook is called after Angular has initialized all data-bound properties of a directive?

a)

ngOnInit

b)

ngOnChanges

c)

ngAfterViewInit

d)

ngOnDestroy