wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

Which of the following is a mutable data type in Python?

a)

tuple

b)

list

c)

String

d)

Frozenset

2.

What is the output of print(2**3) in Python?

a)

8

b)

6

c)

9

d)

5

3.

Which keyword is used to define a function in Python?

a)

fun

b)

def

c)

define

d)

function

4.

What is the default return type of a function that does not return any value in Python?

a)

None

b)

Null

c)

0

d)

false

5.

Which of the following is used to handle exceptions in Python?

a)

error-handling

b)

do-catch

c)

try-except

d)

handle-except

6.

Which of the following is not a valid C keyword?

a)

auto

b)

register

c)

define

d)

loop

7.

Which header file is required for printf and scanf in C?

a)

stdio.h

b)

conio.h

c)

string.h

d)

stdlib.h

8.

What is the size of int in most C compilers (32-bit system)?

a)

2 bytes

b)

4 bytes

c)

16 bytes

d)

8 bytes

9.

Which operator is used for 'address of' in C?

a)

&

b)

*

c)

%

d)

#

10.

What will sizeof(char) return in C?

a)

1

b)

0

c)

2

d)

depend on compiler

11.

What is the time complexity of accessing an element in an array by index?

a)

O(n)

b)

O(1)

c)

O(log n )

d)

O( n log n )

12.

Which of the following is correct about arrays in C?

a)

Index starts from 1

b)

Size must be declared at run-time

c)

array elements are stored in stord in contiguous memory

d)

array name represents last element address

13.

Which data structure is best suited for implementing a fixed-size collection of homogeneous elements?

a)

Array

b)

Stack

c)

Queue

d)

Linked List

14.

What will happen if you access an out-of-bound index in C array?

a)

Program will terminate immediately

b)

Compile time error

c)

Index wraps around

d)

Undefined behavior

15.

Which of the following operations is not possible directly on arrays?

a)

Traversal

b)

Insertion at the end

c)

Dynamic resizing

d)

Deletion

16.

Which of the following is not an application of stack?

a)

Expression evaluation

b)

Function call management

c)

undo feature in editors

d)

CPU scheduling

17.

Which operation inserts an element in a stack?

a)

push

b)

pop

c)

insert

d)

append

18.

What is the time complexity of push and pop operations in stack?

a)

O(n)

b)

O(1)

c)

O(log n )

d)

O(n log n )

19.

Stack works on which principle?

a)

FIFO

b)

LIFO

c)

FILO

d)

Both LIFO and FILO

20.

Infix to postfix conversion uses which data structure?

a)

Queue

b)

Stack

c)

Array

d)

Linked List

21.

Which of the following is not a type of queue?

a)

Circular Queue

b)

Priority Queue

c)

Heap Queue

d)

Deque

22.

Queue follows which principle?

a)

FIFO

b)

LIFO

c)

FILO

d)

NONE

23.

Which operation removes an element from a queue?

a)

pop

b)

dequeue

c)

Delete

d)

Remove

24.

What is the main drawback of linear queue implementation using arrays?

a)

Slow insertion

b)

Slow deletion

c)

Waste of memory

d)

Complexity of operations

25.

Double-ended queue allows insertion and deletion at:

a)

Both ends

b)

Middle only

c)

Front only

d)

Rear only

26.

What is the advantage of implementing stack using linked list?

a)

Faster access time

b)

Dynamic memory usage

c)

Fixed memory usage

d)

None

27.

Which is true about queue implementation using linked list?

a)

Insertion at rear, deletion at front

b)

Insertion at front, deletion at rear

c)

Both insertion & deletion at Rear

d)

Both insertion & deletion at Front

28.

In linked list implementation of stack, which pointer is required?

a)

Top

b)

Head

c)

Rear

d)

Both Head and Top

29.

In linked list implementation of queue, which pointers are required?

a)

Both front and rear

b)

Only head

c)

Only Front

d)

Only rear

30.

Which of the following is true about sparse matrix?

a)

Most of the elements are non-zero

b)

Most of the elements are zero

c)

It is a type of stack

d)

It cannot be represented efficiently

31.

Which of the following is not a valid HTML tag?

a)

<p>

b)

<br>

c)

<span>

d)

<break>

32.

Which HTML attribute is used to define inline CSS?

a)

style

b)

class

c)

css

d)

design

33.

Which tag is used to create a hyperlink in HTML?

a)

<link>

b)

<a>

c)

<href>

d)

<url>

34.

Which of the following is not a valid CSS property?

a)

color

b)

font-size

c)

text-align

d)

text-weight

35.

In JavaScript, which keyword is used to declare a variable?

a)

var

b)

let

c)

const

d)

All

36.

Which method is used in JavaScript to print content on the console?

a)

print()

b)

console.log()

c)

log.print()

d)

write()

37.

Which of the following is used for server-side programming?

a)

JavaScript (Node.js)

b)

XML

c)

HTML

d)

CSS

38.

Which HTTP method is idempotent?

a)

GET

b)

POST

c)

DELETE

d)

PATCH

39.

Which protocol is used to transfer web pages from server to client?

a)

TCP

b)

FTP

c)

SMTP

d)

HTTP

40.

Which of the following is a backend framework?

a)

Django

b)

Bootstrap

c)

React

d)

Angular