Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ICT CBP Q3 Test Einstein 2026

Total questions: 53

Worksheet time: 32mins

Name
Class
Date
1.

Users mistype their email addresses. What's an effective solution?

a)

Allow registration despite email format errors.

b)

JavaScript validation for common mistakes.

c)

Provide the 'Confirm Email' field.

d)

Use HTML5 email input.

2.

You're creating a registration form for a website. Users must provide a username, password, and email. What's the best approach to ensure validation? Use _______________ validation only.

a)

Combined HTML5 and JavaScript

b)

HTML5

c)

JavaScript

d)

Server-side and Client-side

3.

In JavaScript, how do you access the value of an input element with the id 'username'?

a)

document.getElementByClass('username').value

b)

document.getElementById('username').value

c)

document.getElementByName('username').value

d)

document.querySelector('#username').value

4.

The feedback form requires ratings, but some users submit it without rating. How do you enforce it?

a)

Allow without rating.

b)

Keep rating optional.

c)

Set default rating.

d)

Use JavaScript validation.

5.

Users input invalid birthdates below age 13 in the registration form. How to ensure compliance?

a)

Allow registration regardless.

b)

Implement JavaScript age check.

c)

Prompt age confirmation.

d)

Use HTML5 date input.

6.

Which JavaScript method is often used to validate if a checkbox is checked in a form?

a)

document.getElementById()

b)

document.querySelector()

c)

isCheckboxChecked()

d)

isChecked()

7.

You need to ensure that users do not leave the username field empty. Which of the following JavaScript syntaxes would you use to validate if the username input is not null or undefined?

a)

if (username != null)

b)

if (username !== null)

c)

if (username == null)

d)

if (username === null)

8.

Implementing form validation for sensitive data, what's a critical security measure?

a)

Disabling validation.

b)

Random number generator for validation.

c)

Using plain text storage.

d)

Validating client-side and server-side.

9.

You're validating a textarea input field to ensure it contains only alphanumeric characters (a-z, A-Z, 0-9) and spaces. Which JavaScript code snippet provides the most effective validation?

a)

if (textarea === isNaN(textarea)) { /* Validation logic */ }

b)

if (textarea.includes('!@#$%^&*()')) { /* Validation logic */ }

c)

if (textarea.indexOf('!@#$%^&*()') === -1) { /* Validation logic */ }

d)

if (textarea.match(/^[a-zA-Z0-9 ]+$/)) { /* Validation logic */ }

10.

You're validating a password input field to ensure it contains at least one special character (!@#$%^&*). Which JavaScript code snippet provides the most effective validation?

a)

if (password === isNaN(password)) { /* Validation logic */ }

b)

if (password.includes('!@#$%^&*')) { /* Validation logic */ }

c)

if (password.indexOf('!@#$%^&*') !== -1) { /* Validation logic */ }

d)

if (password.match(/[!@#$%^&*]/)) { /* Validation logic */ }

11.

When validating an email input field using JavaScript, which code snippet demonstrates the most effective approach?

a)

if (email === 'email@example.com') { /* Validation logic */ }

b)

if (email.includes('@')) { /* Validation logic */ }

c)

if (email.indexOf('@') !== -1) { /* Validation logic */ }

d)

if (email.match(/\S+@\S+\.\S+/)) { /* Validation logic */ }

12.

You're developing a drawing application using Canvas and want to allow users to change the color of the drawing brush. Which event listener should you use to detect color selection changes from a color picker input element?

a)

onchange

b)

onclick

c)

onmouseover

d)

onsubmit

13.

You're developing a game using JavaScript Canvas and need to detect collision between two game objects. Which is needed to continuously monitor this?

a)

addEventListener

b)

oncollision

c)

oncollisioncheck

d)

onmousemove

14.

Mr. Racab is creating a canvas-based application that needs to respond to touch events on touch-enabled devices. Which event should he handle to capture touch interactions?

a)

onpinch

b)

onswipe

c)

ontouch

d)

ontouchstart

15.

When working with JavaScript Canvas, which method obtains the drawing context?

a)

canvasContext()

b)

drawContext()

c)

getCanvas()

d)

getContext()

16.

You're implementing an undo feature in your canvas drawing application and must store previous drawing states. Which data structure is suitable for storing a history of drawing actions?

a)

Array

b)

Object

c)

Set

d)

Map

17.

You're building a canvas-based application and want to draw text on the canvas. Which method should you use to set the font style and size?

a)

ctx.font

b)

ctx.fontStyle()

c)

ctx.setFont()

d)

ctx.setFontStyle()

18.

A web application needs to capture mouse clicks within the canvas area. Which event listener should you use to achieve this?

a)

canvas.addEventListener('click', function(event) { // Handle click event });

b)

canvas.addEventListener('mousedown', function(event) { // Handle click event });

c)

canvas.onclick = function(event) { // Handle click event };

d)

document.addEventListener('click', function(event) { // Handle click event });

19.

Which of the following statements about JavaScript events is true?

a)

Events are actions that occur within the browser or document.

b)

Events can only be triggered by user interactions.

c)

Events can only be handled using inline event handlers.

d)

Events are not relevant in JavaScript programming.

20.

What is the purpose of an event listener in JavaScript?

a)

To handle events asynchronously

b)

To trigger events manually

c)

To execute code when a specific event occurs

d)

To stop event propagation

21.

Which of the following is NOT a valid way to declare a function in JavaScript?

a)

function myFunction() {}

b)

const myFunction = function() {}

c)

myFunction: function() {}

d)

() => {}

22.

In a web application's shopping cart feature, items are stored as elements in an array. Which method would you use to remove the last item added to the cart?

a)

slice()

b)

pop()

c)

shift()

d)

ctrl()

23.

You're tasked with creating an animated banner for a website. Which JavaScript method would you use to ensure smooth animation transitions?

a)

console.log()

b)

setTimeout()

c)

document.createElement()

d)

addEventListener()

24.

While developing an online game, you need to animate the movement of characters. Which technique would you employ to achieve this?

a)

CSS animations

b)

SVG animations

c)

Canvas animations

d)

Text animations

25.

You're designing a user authentication system for a website. What operator in JavaScript would you use to verify both the username and password before granting access?

a)

&&

b)

||

c)

!

d)

=

26.

Which JavaScript method is commonly used to change the position of an HTML element over time to create animation effects?

a)

setTimeout()

b)

addEventListener()

c)

document.createElement()

d)

animate()

27.

Which CSS property is commonly used to specify the duration of an animation in JavaScript?

a)

color

b)

font-size

c)

opacity

d)

animation-duration

28.

In JavaScript animation, what is the purpose of the easing function?

a)

To define the starting position of an animation

b)

To handle user input events

c)

To specify the speed curve of an animation

d)

To determine the ending state of an animation

29.

Which JavaScript event is commonly used to trigger animations based on user interactions such as mouse clicks or keyboard inputs?

a)

mouseover

b)

keydown

c)

scroll

d)

click

30.

You're developing an animation-heavy website and need to optimize performance. Which approach would be most effective for improving animation smoothness and reducing resource consumption?

a)

Use CSS transitions for animation effects

b)

Utilize the requestAnimationFrame() method for animation loops

c)

Implement setInterval() for precise timing control

d)

Apply jQuery animations for cross-browser compatibility

31.

You're debugging an animation code that's causing performance issues. Which tool or method would you use to identify and resolve the performance bottleneck?

a)

Insert console.log() statements to trace code execution

b)

Utilize browser developer tools to profile JavaScript performance

c)

Apply try-catch blocks to handle potential errors

d)

Implement alert() dialogs to debug code logic

32.

Suppose you encounter a situation where an animation on your webpage is causing layout thrashing and impacting performance. How would you diagnose and address this issue?

a)

Increase the frame rate of the animation

b)

Reduce the number of animated elements

c)

Apply hardware acceleration to the animated elements

d)

Apply a debounce function to the animation function

33.

You're developing an animation that involves changing an element's position over time. Which CSS property would you manipulate to achieve this effect efficiently?

a)

opacity

b)

transform

c)

width

d)

margin

34.

How would you handle game state persistence in a JavaScript game to allow players to continue their progress across sessions?

a)

Store game state in browser cookies.

b)

Utilize web storage APIs such as localStorage or sessionStorage.

c)

Write game state to a server-side database.

d)

Implement a custom JavaScript function to save game state.

35.

How would you implement sound effects in a JavaScript game?

a)

Use the HTML

b)

Embed sound files directly in the JavaScript code

c)

Utilize the console.log() method to play sounds

d)

Include sound files as background music in the CSS

36.

How would you implement a scoring system in a JavaScript game?

a)

Use global variables to track the score.

b)

Update the DOM directly with the current score.

c)

Store the score in a local storage.

d)

Utilize an object to manage the game state including the score.

37.

You're developing a JavaScript game, and the player complains that jumping feels very slow. How would you address this issue?

a)

Add more obstacles to distract the player from the jumping mechanic.

b)

Increase the gravitational force acting on the player character.

c)

Implement a smoother animation transition for the jumping action.

d)

Decrease the friction coefficient between the player character and the ground.

38.

You're tasked with declaring a variable in JavaScript to store the player's current score in a game. Which variable declaration approach would you choose considering the score should not be modified once initialized?

a)

let score = 0;

b)

const score = 0;

c)

var score = 0;

d)

int score = 0;

39.

Mr. Skyler is creating a JavaScript object to represent a player character in his game. Which syntax should he use to define this object with properties for 'name' and 'score'?

a)

{name, score}

b)

{name: 'John', score: 100}

c)

['name', 'score']

d)

(name, score)

40.

In your game code, you need to add a new element to an array and get the updated length of the array. Which JavaScript method should you use for this task?

a)

push()

b)

pop()

c)

shift()

d)

unshift()

41.

You're implementing a scoring system in your JavaScript game, where players earn points by completing objectives and defeating enemies. How would you design the scoring mechanism to reward player skill and encourage replayability?

a)

Assign a fixed number of points to each objective regardless of difficulty.

b)

Use dynamic scoring based on player performance and the level of challenge.

c)

Provide bonus points for completing objectives within a time limit.

d)

Remove scoring altogether to focus solely on gameplay experience.

42.

Your JavaScript game relies heavily on keyboard input for player controls. How would you ensure that the game remains playable even on devices without physical keyboards, such as smartphones and tablets?

a)

Provide alternative on-screen touch controls for essential gameplay actions.

b)

Require players to connect external keyboards to access all game features.

c)

Implement voice recognition technology for controlling the game.

d)

Limit gameplay to devices with physical keyboards only.

43.

Your JavaScript game features social features such as player profiles and leaderboards. How would you ensure data privacy and security for player accounts and sensitive information stored on your game servers?

a)

Store player data in plaintext format to simplify access and retrieval

b)

Encrypt sensitive player information using industry-standard encryption algorithms

c)

Require players to share personal information publicly for social features

d)

Implement a public API for third-party developers to access player data directly

44.

You're designing a JavaScript game that supports multiple languages to cater to an international audience. How would you approach implementing language localization to ensure all players can enjoy the game in their preferred language?

a)

Provide a single language option based on the user's device settings

b)

Automatically detect the user's language based on their IP address

c)

Allow players to manually select their preferred language from a settings menu

d)

Require players to install additional language packs for each supported language

45.

Your team is developing a new JavaScript component for a web application. Before integrating it into the main codebase, you want to ensure each function and method works correctly in isolation. What testing approach should you employ to solve this?

a)

Unit testing

b)

Integration testing

c)

End-to-end testing

d)

Acceptance testing

46.

Your JavaScript game is nearly complete, but you notice that some components are not interacting properly. How would you ensure that all components function correctly and interact seamlessly within the game?

a)

Implement unit testing to verify the functionality of individual components.

b)

Seek feedback from users to identify any issues with component interaction.

c)

Modify the game's design to eliminate the need for component interaction.

d)

Skip testing and proceed with game deployment to meet deadlines.

47.

You're testing a JavaScript function by providing inputs and observing the outputs, without considering the internal implementation details. What type of testing technique are you using?

a)

Debugging

b)

Manual testing

c)

Black box testing

d)

Unit testing

48.

You're testing a complex JavaScript application by examining the code structure, control flow, and data flow within the program. What type of testing technique is this?

a)

White box testing

b)

User testing

c)

Manual testing

d)

Debugging

49.

Users struggle to update their profiles in your JavaScript application. How would you address this issue?

a)

Analyze the codebase for profile management issues.

b)

Conduct user testing sessions to observe interactions and gather feedback.

c)

Skip testing and assume users will adapt.

d)

Debug the application's code.

50.

Users have reported that your JavaScript application crashes unexpectedly when they perform certain actions. How would you address this issue through manual testing?

a)

Ignore user reports and assume the crashes are isolated incidents.

b)

Conduct user testing sessions to replicate the reported crashes.

c)

Skip testing and deploy the application to let the issue resolve itself.

d)

Analyze the codebase for potential bugs causing the crashes.

51.

LAST NAME, FIRSTNAME

4 lines
52.

"Evaluate your knowledge and ability in using JavaScript on a scale from 1 to 5. A score of 5 shows strong competence, while a score of 1 indicates the need for further study."

4 lines
53.

"Evaluate your Project Game creation on a scale from 1 to 5. A score of 5 means your project is highly creative, complete, and shows strong skills. A score of 1 means your project needs major improvement and further work."

4 lines