wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Techsaavy Codeathon 2k25 Round 1

Total questions: 25

Worksheet time: 10mins

Name
Class
Date
1.

Predict the output

x = 10

x //= 3

print(x)

a)

3

b)

3.33

c)

4

d)

0

2.

Which of the following is NOT a valid C++ identifier?

a)

_var

b)

var_123

c)

123var

d)

init

3.

Which data structure uses FIFO principle?

a)

Stack

b)

Queue

c)

Tree

d)

Graph

4.

Predict the output

a = [1, 2, 3]

b = a

b.append(4)

print(a)

a)

[1,2,3]

b)

[1,2,3,4]

c)

[4,1,2,3]

d)

[4]

5.

Predict the output

int a = 5, b = 2;

cout << a / b * b;


a)

2

b)

4

c)

5

d)

6

6.

Predict the output

int x = 5;

cout << x++ + ++x;

a)

11

b)

12

c)

Undefined behavior

d)

13

7.

Predict the output

int arr[] = {1,2,3,4};

cout << sizeof(arr)/sizeof(arr[0]);


a)

16

b)

4

c)

8

d)

2

8.

Predict the output

print(2**3**2)

a)

512

b)

64

c)

256

d)

Error

9.

Predict the ouput

System.out.println(10 + 20 + "30" + 40);

a)

303040

b)

7030

c)

10203040

d)

3070

10.

Predict the output

String str1 = "Hello";

String str2 = "Hello";

System.out.println(str1 == str2);

a)

true

b)

false

c)

Error

d)

JVM dependent

11.

Predict the output

int arr[] = {1,2,3,4};

int *p = arr;

cout << *(p+3);

a)

2

b)

3

c)

4

d)

Undefined

12.

Predict the output

print(bool("False"))

a)

False

b)

True

c)

0

d)

1

13.

Which of the following problems can be solved using Dynamic Programming?

a)

Fibonacci Sequence

b)

Longest Common Sequence

c)

Knapsack problem

d)

All of the above

14.

Which of the following is a valid way to declare a constant in C++?

a)

Both B and C

b)

const int x=10;

c)

int const x = 10;

d)

None of the above

15.

Predict the output

cout << (10 & 7);

a)

7

b)

2

c)

3

d)

10

16.

 Which sorting algorithm has best average-case time complexity?

a)

Bubble sort

b)

Quick sort

c)

Selection sort

d)

Insertion sort

17.

Predict the output

String s = "abc";

s.concat("def");

System.out.println(s);

a)

abc

b)

abcdef

c)

defabc

d)

Compilation error

18.

What is C++ vector insertion amortized time complexity?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n log n)

19.

Which is NOT true about C++ unordered_map?

a)

Keys stored in sorted order

b)

Average search is O(1)

c)

Uses hashing internally

d)

Unique keys only

20.

 Which sorting algorithm is NOT stable?

a)

Merge sort

b)

Insertion sort

c)

Quick sort

d)

Bubble sort

21.

Guess the output:

def func(x, l=[]):

l.append(x)

return l

print(func(1))

print(func(2))

a)

[1]

[2]

b)

[1]

[1,2]

c)

[1]

[2,1]

d)

(1)

(1,2)

22.

Which algorithm gives the shortest path with negative edges?

a)

Dijkstra

b)

Bellman-Ford

c)

Floyd-Warshall

d)

BFS

23.

What is the auxiliary space of merge sort?

a)

O(1)

b)

O(n)

c)

O(n log n)

d)

O(log n)

24.

For a graph with V vertices and E edges, the time complexity of Dijkstra’s algorithm using a min-heap is?

a)

O(V²)

b)

O(E log V)

c)

O(E + V log V)

d)

O(V log E)

25.

Which traversal method of a binary tree can be used to obtain nodes in

NON-DECREASING ORDER if the tree is a BST?

a)

Preorder

b)

Postorder

c)

Inorder

d)

Level-order