wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

QUIZZERIA

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

Which module is used to work with regular expressions in Python?

a)

regex

b)

re

c)

regx

d)

reg

2.

Which of the following statements is true about Python sets?

a)

Sets allow duplicate values

b)

Sets are mutable and ordered

c)

Sets are immutable

d)

Sets do not allow duplicate values   

3.

What will sorted([3, 1, 4, 1, 5], reverse=True) return?

a)

[1, 1, 3, 4, 5]

b)

[5, 4, 3, 1, 1] 

c)

[5, 1, 4, 1, 3]

d)

[3, 1, 4, 1, 5]

4.

What is the purpose of enumerate() in Python?

a)

It adds an index to an iterable  

b)

It creates a list from a range

c)

It sorts a list

d)

It removes duplicates from a list

5.

Which of the following collections in Java allows duplicate keys?

a)

HashMap

b)

TreeMap

c)

Hashtable

d)

None of the above  

6.

Which of the following is NOT a wrapper class in Java?

a)

Integer

b)

Float

c)

Character

d)

String  

7.

Which of the following is the correct way to implement an interface in Java?

a)

class A implements B {}

b)

class A extends B {}

c)

class A implements B, C {}

d)

Both (a) and (c)  

8.

What will happen if an exception is thrown inside a finally block in Java?

a)

The program will terminate  

b)

The exception will be ignored

c)

The exception will be caught automatically

d)

None of the above

9.

What is the size of int on a typical 32-bit system?

a)

2 bytes

b)

4 bytes   

c)

8 bytes

d)

1 byte

10.

What does the typedef keyword do in C?

a)

Defines a new data type  

b)

Allocates memory dynamically

c)

Initializes a pointer

d)

Declares a function

11.

Which function is used to read a single character from the user in C?

a)

scanf()

b)

getchar()   

c)

gets()

d)

fread()

12.

What is the purpose of the break statement in C?

a)

To exit a loop or switch case   

b)

To terminate the program

c)

To pause the execution

d)

To define a function

13.

Which header file is required for file handling functions in C?

a)

<stdio.h>    

b)

<stdlib.h>

c)

<string.h>

d)

<file.h>

14.

What is the difference between is and == in Python?

a)

is compares values, == compares memory locations

b)

is compares memory locations, == compares values    

c)

is compares data types, == compares values

d)

Both are the same

15.

What is the amortized time complexity of inserting an element into a dynamic array (resizable array) when doubling its size?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n log n)

16.

Which of the following memory allocation techniques suffers from internal fragmentation?

a)

Paging

b)

Segmentation

c)

Buddy System

d)

Best Fit Allocation

17.

Which of the following is NOT a valid ACID property in databases?

a)

Atomicity

b)

Consistency

c)

Isolation

d)

Scalability

18.

Which of the following logic gates is functionally complete (i.e., can be used to implement any Boolean  function)?

a)

AND & OR

b)

NOR

c)

XOR

d)

XNOR

19.

Which of the following is true for the "Quick Sort" algorithm?

a)

It has a worst-case time complexity of O(n²)

b)

It is always faster than merge sort

c)

It can sort data that is stored in a linked list

d)

It is a stable sort

20.

What is the main advantage of a hash table over an array?

a)

Faster access time for elements

b)

Easier to implement

c)

Lower space complexity

d)

Better for storing large data sets

21.

What does the "COMMIT" operation in a relational database do?

a)

It aborts the transaction and rolls back changes.

b)

It locks the tables used in a transaction.

c)

It commits the transaction, making changes permanent.

d)

It saves the transaction in a temporary state.

22.

Which of the following sorting algorithms has the best worst-case time complexity?

a)

QuickSort

b)

MergeSort

c)

HeapSort

d)

BubbleSort

23.

Which SQL command is used to remove all records from a table without deleting the table structure?

a)

DELETE

b)

DROP

c)

TRUNCATE

d)

ALTER

24.

What will sorted([3, 1, 4, 1, 5], reverse=True) return?

a)

[1, 1, 3, 4, 5]

b)

[5, 4, 3, 1, 1]   

c)

[5, 1, 4, 1, 3]

d)

[3, 1, 4, 1, 5]

25.

Which keyword is used to prevent method overriding in Java?

a)

final

b)

static

c)

private

d)

abstract