wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Web Dev Quizz 1

Total questions: 15

Worksheet time: 7mins

Name
Class
Date
1.

What is the difference between == and .equals() when comparing two objects in Java?

a)

== compares object references;
.equals() compares object values

b)

== compares object values;
.equals() compares object references

c)

== and .equals() are used interchangeably in Java

d)

== and .equals() both compare object references

2.

Which Java collection is best suited for maintaining a unique set of elements with no duplicates?

a)

ArrayList

b)

LinkedList

c)

HashSet

d)

TreeMap

3.

What HTTP status code is returned when a resource is successfully created on the server?

a)

200

b)

201

c)

204

d)

400

4.

Explain the concept of microservices architecture and how it differs from a monolithic architecture.

a)

Microservices divide an application into smaller, independent services; Monolithic is a single, large application

b)

Microservices are used only in mobile app development; Monolithic is for web applications

c)

Microservices are a type of database; Monolithic is a type of server

d)

Microservices are used in mainframe computing; Monolithic is used in cloud computing

5.

What is a checked exception in Java, and when should you use them in your code?

a)

Checked exceptions are always thrown at runtime; use them for critical errors

b)

Checked exceptions must be caught or declared; use them for recoverable errors

c)

Checked exceptions are never thrown; they are used for documentation purposes

d)

Checked exceptions are handled by the JVM automatically; use them for all exceptions

6.

Briefly describe the difference between authentication and authorization in web security.

a)

Authentication verifies a user's identity; authorization defines what actions they can perform

b)

Authentication controls access to web pages; authorization validates user input

c)

Authentication encrypts data; authorization decrypts data

d)

Authentication and authorization are the same concepts in web security

7.

What is multithreading, and how can it improve the performance of a Java application?

a)

Multithreading is the same as multiprocessing; it doesn't improve performance

b)

Multithreading allows an application to execute multiple threads concurrently, improving responsiveness and resource utilization

c)

Multithreading can only be used in distributed systems

d)

Multithreading reduces the performance of a Java application

8.

JSP ( Java Server Pages ) runs on a _(1)_ and respond to requests from _(2)_

a)

(1) client, (2) servers

b)

(1) device, (2) users

c)

(1) browser, (2) databases

d)

(1) server, (2) clients

9.

Name two popular front-end JavaScript frameworks/libraries used for building single-page applications (SPAs).

a)

Angular and React

b)

Java & C#

c)

JQuery & Bootstrap

d)

Python & Ruby

10.

What is the purpose of API documentation, and name a commonly used format for documenting RESTful APIs.

a)

API documentation provides information about the API's author;

Swagger is a commonly used format

b)

API documentation is used for testing APIs;
XML is a commonly used format

c)

API documentation helps developers understand how to use an API;
Swagger and OpenAPI are commonly used formats

d)

API documentation is not necessary for RESTful APIs

11.

What is an SQL JOIN, and why is it useful in database queries?

a)

SQL JOIN is used to create a new database table; it's not used in queries

b)

SQL JOIN combines rows from two or more tables based on a related column; it's useful for retrieving data from multiple tables

c)

SQL JOIN is used for creating primary keys in databases

d)

SQL JOIN is used to update records in a table

12.

Which keyword is used to declare a variable that can be accessed without creating an instance of the class?

a)

Final

b)

Static

c)

Private

d)

Void

13.

What is the default port for HTTP communication?

a)

80

b)

443

c)

8080

d)

8000

14.

Which CSS property is used to change the text color of an HTML element?

a)

background-color

b)

font-color

c)

text-color

d)

color

15.

In object-oriented programming, what is the concept of inheritance?

a)

It refers to creating a new instance of a class

b)

It involves using interfaces to define class behavior

c)

It allows a new class to inherit properties and behaviors from an existing class

d)

It is used to implement polymorphism in Java