Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Module 08: Introduction and Recall

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which layer primarily handles data, logic, and security in a web application?

a)

Browser rendering pipeline

b)

Back-end engine and services

c)

Client-side styling tools

d)

Front-end interface for users

2.

What is the main role of Express.js when used with Node.js?

a)

Building server-side routes

b)

Serving static images

c)

Animating buttons on pages

d)

Designing page layouts

3.

Which statement best describes middleware in an Express server shown in the project?

a)

Files that automatically configure the operating system

b)

Modules that replace the Node.js runtime engine

c)

Scripts that only execute after the server shuts down

d)

Functions that run before main route handlers

4.

In the server setup, what is the primary purpose of app.use(express.static('public'))?

a)

Return JSON for the /api/logs route

b)

Serve files from the public directory

c)

Log each request path and time

d)

Start the server on a given port

5.

A visitor opens index.html and then requests /api/logs. Which route returns the stored log array in JSON?

a)

app.get('/api/logs', (req, res) => res.json(visitorLog))

b)

app.use((req, res) => res.send(visitorLog))

c)

app.listen(PORT, () => res.json(visitorLog))

d)

app.post('/api/logs', (req, res) => res.json([]))

6.

In an Express-based Visitor Logger, why is relying only on in-memory storage unsuitable for real-world apps?

a)

It blocks building APIs for user login

b)

Data is lost on server restart or refresh

c)

It prevents middleware from validating inputs

d)

It slows down requests under light traffic

7.

Which command installs the required Node.js packages for an Express server using SQLite and body parsing?

a)

npm install express sqlite3 body-parser

b)

npm add express sqlite3 body-parser quickly

c)

node install express sqlite3 body-parser

d)

npm start express sqlite3 body-parser

8.

In the server code, what is the purpose of db.run('INSERT INTO visitors ... VALUES (?, ?, ?, ?, ?)', [lastname, firstname, address, email, phone])?

a)

Deletes a visitor record matching the array values

b)

Creates the visitors table with five text columns

c)

Updates all visitor rows with new values

d)

Adds a new visitor record using parameter placeholders

9.

Which input type enforces an email format for the visitor’s email field?

a)

type="url" for email

b)

type="number" for email

c)

type="email" for email

d)

type="text" for email

10.

Which DOM method attaches a click handler to the 'Display Records' button?

a)

querySelectorAll for clicks

b)

onclick attribute on table

c)

setTimeout on button

d)

addEventListener on element