wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming Quiz

Total questions: 70

Worksheet time: 35mins

Name
Class
Date
1.

What is programming?

a)

The process of writing precise instructions for the computer to understand and execute.

b)

The process of designing computer hardware.

c)

The process of creating computer networks.

d)

The process of managing computer databases.

2.

What are programming languages described as in the text?

a)

Tools that allow us to write precise instructions for the computer.

b)

Tools that allow us to design computer hardware.

c)

Tools that allow us to create computer networks.

d)

Tools that allow us to manage computer databases.

3.

According to the text, what happens once you learn one programming language?

a)

You will be able to use other languages.

b)

You will be able to design computer hardware.

c)

You will be able to create computer networks.

d)

You will be able to manage computer databases.

4.

What is JavaScript (JS) primarily used for?

a)

To create databases

b)

To make websites interactive

c)

To design graphics

d)

To manage servers

5.

What does ECMAScript define?

a)

How HTML should be structured

b)

How CSS should be styled

c)

How JavaScript should work

d)

How databases should be managed

6.

Which of the following is a JavaScript engine used by Google Chrome and Opera?

a)

SpiderMonkey

b)

Chakra

c)

V8

d)

Rhino

7.

What are the two ways of running JavaScript mentioned in the text?

a)

In the browser and on a server

b)

In the browser and with a runtime outside the browser

c)

On a server and in a database

d)

With a runtime outside the browser and in a database

8.

Which runtime environments are mentioned for running JavaScript outside the browser?

a)

Node and Bun

b)

Node and Deno

c)

Bun and Deno

d)

Node and Rhino

9.

What is one of the main advantages of using JavaScript as a high-level language?

a)

Ease of Implementation

b)

Speed of Execution

c)

Machine Specific

d)

Code Density

10.

Which of the following is NOT a characteristic of high-level languages?

a)

Flexibility

b)

Portability

c)

Machine Specific

d)

Ease of Implementation

11.

What does JavaScript abstract to keep things simple for the programmer?

a)

Underlying layers

b)

User interface

c)

Database connections

d)

Network protocols

12.

What is the main difference between interpreted and compiled languages?

a)

Interpreted languages are executed line-by-line by an interpreter, while compiled languages are transformed into machine code.

b)

Interpreted languages are faster than compiled languages.

c)

Compiled languages are executed line-by-line by an interpreter, while interpreted languages are transformed into machine code.

d)

Interpreted languages do not require an interpreter.

13.

Which of the following is an example of a compiled language?

a)

Python

b)

JavaScript

c)

C

d)

HTML

14.

In the context of programming languages, what does an interpreter do?

a)

Translates source code into machine code all at once.

b)

Executes source code line-by-line.

c)

Converts machine code back into source code.

d)

Compiles source code into an executable file.

15.

What is a good analogy for understanding the difference between interpreted and compiled languages?

a)

Reading a book in Spanish vs. translating the entire book to English.

b)

Driving a car vs. riding a bicycle.

c)

Cooking a meal vs. ordering takeout.

d)

Writing a letter vs. sending an email.

16.

What is the purpose of variables in JavaScript?

a)

To perform mathematical operations

b)

To store information

c)

To create loops

d)

To define functions

17.

Which keyword is used to declare a variable in JavaScript?

a)

let

b)

const

c)

var

d)

int

18.

In the statement `var name = 'James Bond';`, what does the `=` symbol represent?

a)

Comparison operator

b)

Assignment operator

c)

Equality operator

d)

Logical operator

19.

What is the value assigned to the variable `name` in the statement `var name = 'James Bond';`?

a)

var

b)

name

c)

'James Bond'

d)

;

20.

What does the semicolon (`;`) signify in the statement `var name = 'James Bond';`?

a)

Start of the statement

b)

End of the statement

c)

Assignment operator

d)

Variable identifier

21.

What is a data structure?

a)

A way of organizing and storing data so that it can be accessed and modified efficiently

b)

A specific type of data that the computer can store in memory

c)

A programming language

d)

A type of software

22.

Which of the following is used for textual data in JavaScript?

a)

String

b)

Number

c)

Boolean

d)

BigInt

23.

What is the purpose of the 'Number' data type in JavaScript?

a)

Used for both integer and floating-point numbers

b)

Used to represent True or False

c)

Represents nothing

d)

Indicates that a variable has been declared but not assigned to a value

24.

Which data type in JavaScript is used to represent True or False?

a)

Boolean

b)

String

c)

Number

d)

Null

25.

What does the 'Null' data type represent in JavaScript?

a)

Represents nothing, or it's saying that memory location of the value we are trying to access does not exist

b)

Indicates that a variable has been declared but not assigned to a value

c)

Used to store very big numbers

d)

Used for textual data

26.

What does the 'Undefined' data type indicate in JavaScript?

a)

Indicates that a variable has been declared but not assigned to a value

b)

Used to store very big numbers

c)

Used for both integer and floating-point numbers

d)

Used to represent True or False

27.

Which data type in JavaScript is used to store very big numbers?

a)

BigInt

b)

String

c)

Boolean

d)

Null

28.

Which command is used to show data on the screen or to the terminal in JavaScript?

a)

console.show

b)

console.display

c)

console.log

d)

console.print

29.

What will the following code print to the terminal? console.log("Hello, world!");

a)

Hello, world!

b)

Hello, terminal!

c)

Hello, console!

d)

Hello, screen!

30.

In the code snippet 'let msg = "You guys are the best";', what is 'msg'?

a)

A function

b)

A variable

c)

A constant

d)

A method

31.

What will the following code print to the terminal? console.log(msg) if msg is defined as 'let msg = "You guys are the best";'

a)

You guys are the best

b)

Hello, world!

c)

msg

d)

Undefined

32.

What are operators in JavaScript?

a)

Symbols or keywords that perform operations on operands

b)

Functions that return a value

c)

Variables that store data

d)

Methods that manipulate strings

33.

What is an expression in JavaScript?

a)

A valid unit of code that resolves to a value

b)

A function that performs a task

c)

A variable that stores data

d)

A method that manipulates strings

34.

Which of the following is the operator for addition in JavaScript?

a)

+

b)

-

c)

*

d)

/

35.

Which operator is used for exponentiation in JavaScript?

a)

**

b)

++

c)

--

d)

%

36.

What does the modulus operator (%) do in JavaScript?

a)

Returns the remainder of a division

b)

Adds two numbers

c)

Subtracts one number from another

d)

Multiplies two numbers

37.

What are reserved keywords in JavaScript?

a)

Words that can be used as variable names

b)

Words that have special meaning in the language's syntax

c)

Words that are used for comments

d)

Words that are used for styling

38.

Why is it not good to use reserved keywords as variable names in JavaScript?

a)

They make the code run faster

b)

They are part of the language grammar and cannot be used as identifiers

c)

They are easier to remember

d)

They are used for styling

39.

Which of the following is an example of a reserved keyword in JavaScript?

a)

console

b)

document

c)

let

d)

style

40.

What does "Global" mean in the context of JavaScript scopes?

a)

It can be accessed by anything in your code base

b)

It can be accessed within a specific function

c)

It can be accessed as long as you import data from a file

d)

It is essentially local to the block

41.

What does "Local" mean in the context of JavaScript scopes?

a)

It can be accessed by anything in your code base

b)

It can be accessed within a specific function

c)

It can be accessed as long as you import data from a file

d)

It is essentially local to the block

42.

What does "Module Scoped" mean in the context of JavaScript scopes?

a)

It can be accessed by anything in your code base

b)

It can be accessed within a specific function

c)

It can be accessed as long as you import data from a file

d)

It is essentially local to the block

43.

What does "Block Scope" mean in the context of JavaScript scopes?

a)

It can be accessed by anything in your code base

b)

It can be accessed within a specific function

c)

It can be accessed as long as you import data from a file

d)

It is essentially local to the block

44.

Which of the following is an example of a built-in namespace in a programming language?

a)

User-defined functions

b)

Local variables

c)

Math, Arrays, JSON

d)

Temporary files

45.

What is the correct order of namespaces from the most specific to the most general?

a)

Built-in Namespace, Global Namespace, Local Namespace

b)

Local Namespace, Global Namespace, Built-in Namespace

c)

Global Namespace, Local Namespace, Built-in Namespace

d)

Local Namespace, Built-in Namespace, Global Namespace

46.

What are modules in JavaScript?

a)

Units of independent, reusable code that can be organized and imported into other parts of a program.

b)

Bundles of one or more modules and other assets.

c)

A type of JavaScript variable.

d)

A JavaScript function.

47.

What are packages in JavaScript?

a)

Units of independent, reusable code.

b)

Bundles of one or more modules and potentially other assets.

c)

A type of JavaScript variable.

d)

A JavaScript function.

48.

What module system does JavaScript use by default?

a)

ES Module system

b)

Node.js module system

c)

CommonJS module system

d)

AMD module system

49.

How can you change the module system to ES Module system in JavaScript?

a)

By changing the type in the script tag to "module"

b)

By changing the type in the script tag to "commonjs"

c)

By changing the type in the script tag to "node"

d)

By changing the type in the script tag to "amd"

50.

Which of the following is the correct syntax for importing a module in CommonJS?

a)

import { elem } from './module.js';

b)

const elem = require('module');

c)

module.exports = { elem };

d)

export const elem = { };

51.

Which of the following is the correct syntax for exporting a module in ES Modules?

a)

module.exports = { elem };

b)

const elem = require('module');

c)

export const elem = { };

d)

import { elem } from './module.js';

52.

In ES Modules, which keyword is used to import a module?

a)

require

b)

import

c)

module.exports

d)

export

53.

In CommonJS, which keyword is used to export a module?

a)

import

b)

export

c)

module.exports

d)

const

54.

Which of the following is a characteristic of primitive values?

a)

Immutable

b)

Mutable

c)

Stored by Reference

d)

Stored by Pointer

55.

How are primitive values stored?

a)

Stored by Value

b)

Stored by Reference

c)

Stored by Pointer

d)

Stored by Address

56.

What type of values are objects that are stored and manipulated by reference?

a)

Reference Values

b)

Primitive Values

c)

Constant Values

d)

Temporary Values

57.

Which of the following is NOT a characteristic of reference values?

a)

Immutable

b)

Mutable

c)

Stored by Reference

d)

Stored by Pointer

58.

What does it mean when a value is described as "mutable"?

a)

It can be changed after creation.

b)

It cannot be changed once created.

c)

It is stored directly in the variable's location.

d)

It is stored in the stack.

59.

What is the purpose of casting or type conversion in programming?

a)

To convert a variable from one data type to another

b)

To change the value of a variable

c)

To create a new variable

d)

To delete a variable

60.

Given the code snippet: let str = "123"; let num = Number(str); console.log(num);, what will be the output of console.log(num)?

a)

"123"

b)

123

c)

NaN

d)

undefined

61.

Which function is used to convert a string to a number in JavaScript?

a)

parseInt()

b)

toString()

c)

Number()

d)

String()

62.

What do control structures in JavaScript allow you to manage?

a)

The flow of execution of your code

b)

The styling of your web page

c)

The storage of data in your database

d)

The speed of your internet connection

63.

Which of the following is NOT included in control structures in JavaScript?

a)

Conditional statements

b)

Loops

c)

Jump statements

d)

Variable declarations

64.

In JavaScript, what can we use to determine what piece of code runs given a certain condition is true?

a)

For loops

b)

If statements

c)

While loops

d)

Switch statements

65.

What is the primary concept of control flow in programming as mentioned in the document?

a)

Functions and Variables

b)

If conditions and Loops

c)

Arrays and Objects

d)

Classes and Methods

66.

In the provided JavaScript code snippet, what will be logged to the console if x is 10?

a)

x is less than 5

b)

x is equal to 5

c)

x is greater than 5

d)

x is undefined

67.

What is the purpose of a switch statement in programming?

a)

To execute a block of code based on a specific condition

b)

To iterate over a collection of items

c)

To declare variables

d)

To handle exceptions

68.

In the provided switch statement, what will be the output if the value of 'day' is 3?

a)

Monday

b)

Tuesday

c)

Wednesday

d)

Invalid day

69.

What keyword is used to exit a case in a switch statement?

a)

exit

b)

stop

c)

break

d)

end

70.

What will be the output of the switch statement if the value of 'day' is not 1, 2, or 3?

a)

Monday

b)

Tuesday

c)

Wednesday

d)

Invalid day