wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

TECH WHIZ

Total questions: 15

Worksheet time: 9mins

Name
Class
Date
1.

1. Which of the following is NOT a feature of OOP?



a)

a) Encapsulation

b)

b) Polymorphism

c)

c) Recursion

d)

d) Inheritance

2.

2. Which OOP principle allows different classes to have methods with the same name but different implementations?

a)

a) Abstraction

b)

b) Encapsulation

c)

c) Inheritance

d)

d) Polymorphism

3.

3. What is the time complexity of searching an element in a balanced binary search tree (BST)?

a)

a) O(n)

b)

b) O(log n)

c)

c) O(n log n)

d)

d) O(1)

4.
  1. 4. What is the primary advantage of using a linked list over an array?

a)
  1. a) Faster access to elements

b)
  1. b) Dynamic size allocation

c)
  1. c) Lower memory usage

d)
  1. d) Constant-time search operation

5.

5. Which CSS property makes an element take up the entire width of its container?

a)

a) display: block;

b)

b) display: inline;

c)

c) display: flex;

d)

d) display: grid;

6.
  1. 6. How much memory does the following structure take?

struct test {

char a;

int b;

char c;

};

a)

a) 6 bytes

b)

b) 8 bytes

c)

c) 12 bytes

d)

d) 10 bytes

7.

7. Which of the following statements about pointers is correct?

a)

a) void* pointer cannot be typecasted

b)

b) A pointer can store the address of any variable, regardless of type

c)

c) Dereferencing a NULL pointer is valid

d)

d) Pointer arithmetic is not allowed in C

8.

8. What will happen if you try to free a NULL pointer?

a)

a) It causes a segmentation fault

b)

b) It causes memory leak

c)

c) It results in undefined behavior

d)

d) It does nothing

9.

9. What is the worst-case time complexity of QuickSort?

a)

a) O(n)

b)

b) O(n log n)

c)

c) O(n²)

d)

d) O(log n)

10.

10. What is the default display value for a <div> element in HTML?

a)

a) inline

b)

b) block

c)

c) inline-block

d)

d) grid

11.

11. What is the output of the following code?

#include <stdio.h>

int main() {

int a = 5;

int *p = &a;

*p += 2;

printf("%d\n", a);

return 0;

}

a)

a) 5

b)

b) 7

c)

c) 2

d)

d) Undefined behavior

12.

12. Which sorting algorithm is the best for sorting nearly sorted data?

a)

a) Quick Sort

b)

b) Merge Sort

c)

c) Insertion Sort

d)

d) Heap Sort

13.

13. Which CSS property is used to make text bold?

a)

a) font-weight

b)

b) text-style

c)

c) boldness

d)

d) text-decoration

14.

14. What is the output of the following code?

x = [1, 2, 3]

y = x

y.append(4)

print(x)

a)

a) [1, 2, 3]

b)

b) [1, 2, 3, 4]

c)

c) Error

d)

d) None

15.

15. What will be the output of the following code?

x = 5

y = x

y += 2

print(x, y)

a)

a) 5 5

b)

b) 7 7

c)

c) 5 7

d)

d) 7 5