wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

QUIZ

Total questions: 25

Worksheet time: 6hrs 15mins

Name
Class
Date
1.

1. You want to create a form in HTML. Which of the following tags is used to group together form controls such as inputs and labels?

a)

<div>

b)

<form>

c)

<fieldset>

d)

<section>

2.

Which of the following conditions must hold true for a binary tree to be a valid Binary Search Tree (BST)?

1) The left subtree of a node contains values greater than the node
2) The right subtree of a node contains values less than the node
3) The left and right subtrees must be valid BSTs

a)

Only 1

b)

Only 3

c)

Both 2 and 3

d)

Both 1 and 3

3.

Which sorting algorithm is best suited for sorting nearly sorted data (or data that is mostly sorted)?

a)

Insertion Sort

b)

QuickSort

c)

MergeSort

d)

HeapSort

4.

What will be the output :

a)

[0,3]

b)

[0,1]

c)

[2,0]

d)

[1,6]

5.

What is the correct syntax for including an external CSS file in an HTML document?

a)

<css href="style.css">

b)

<style src="style.css">

c)

<stylesheet link="style.css">

d)

<link rel="stylesheet" href="style.css">

6.

When you append an element to a dynamic array and the array is already full, what is the time complexity of resizing the array?

a)

O(1)

b)

O(log n)

c)

O(n)

d)

O(n log n)

7.

Which of the following algorithms is best suited for searching in a sorted array?

a)

Binary Search

b)

Jump Search

c)

Linear Search

d)

Fibonacci Search

8.

Value of x = ?, y = ?

a)

7,9

b)

9,7

c)

Error

d)

7,7

9.

Which CSS rule will select all elements with the class "header"?

a)

*header {}

b)

#header {}

c)

.header {}

d)

header {}

10.

What is the time complexity of Dijkstra’s algorithm when implemented using an adjacency matrix and a simple array for the priority queue?

a)

O(n^2)

b)

O(n^3)

c)

O(n log n)

d)

O(m log n)

11.

Which algorithm is most efficient when solving the problem of finding the longest common subsequence (LCS) of two sequences?

a)

Brute Force

b)

Greedy Algorithm

c)

Dynamic Programming (LCS Algorithm)

d)

Divide and Conquer

12.

What will be the Output :

a)

Java1010

b)

Java1111

c)

Java1012

d)

Java1011

13.

Which of the following properties is used to create rounded corners in CSS?

a)

border-corner

b)

border-radius

c)

corner-radius

d)

border-style

14.

You are given a sorted array containing duplicate elements. What modification would you make to binary search to find the first occurrence of an element?

a)

Keep searching the right half after finding the element

b)

Modify the binary search condition to only search for unique values

c)

Keep searching the left half after finding the element

d)

No modification needed, as the first occurrence will always be found

15.

In which of the following problems is a "Divide and Conquer" strategy not suitable?

a)

MergeSort

b)

Longest Common Subsequence (LCS)

c)

Matrix Chain Multiplication

d)

Binary Search

16.

What will be the Output ?

a)

-1

b)

123

c)

321

d)

true

17.

What will be the Output ?

a)

2

b)

8

c)

-2

d)

Error

18.

What will be the Output ?

a)

x: 24

y: 10

z: 14

b)

x: 28

y: 11

z: 15

c)

x: 20

y: 14

z: 14

d)

x: 24

y: 11

z: 14

19.

What will be the Output ?

a)

AVS Engineering College

b)

Error

c)

AVS Engineering College0

d)

0

20.

In the below code snippet, in what order will the margins be added?

p {  margin: 25px 50px 75px 100px; }

a)

Top, Right, Bottom, Left

b)

Top, Left, Bottom, Right

c)

Top, Bottom, Right, Left

d)

Right, Left, Top, Bottom

21.

What will be the Output ?

a)

-121

b)

false

c)

121

d)

true

22.

Which of the following is the correct traversal order for a Depth-First Search (DFS) in a graph?

a)

Pre-order

b)

In-order

c)

Post-order

d)

Any of the above depending on implementation

23.

What will be the Output ?

a)

false

b)

-1

c)

true

d)

0

24.

Which of the following problems is best solved using the "Backtracking" algorithm?

a)

Finding the shortest path in a graph

b)

Solving a Sudoku puzzle

c)

Sorting an array

d)

Finding the minimum spanning tree

25.

What will be the output ?

a)

[1, 1, 3, 2, 4, 4, 4]

b)

[1, 1, 3, 2, 4, 4]

c)

[1, 2, 3, 4, 4]

d)

[1, 1, 2, 3, 4, 4]