wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

GDG Code Team Selection Test – Code & Logic Edition

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

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

a)

A. 64

b)

B. 512

c)

C. 256

d)

D. 8

2.

2. Which data structure uses FIFO (First In First Out)?

a)

A. Stack

b)

B.Tree

c)

C. Queue

d)

D. Graph

3.

3. What is the time complexity of binary search in a sorted array?

a)

A. O(n)

b)

B. O(n log n)

c)

C. O(log n)

d)

D. O(n²)

4.

4. Which of the following is NOT a valid Java data type?

a)

A. float

b)

B. int

c)

C. char

d)

D. real

5.

5. Which data structure is used in a recursive function call?

a)

A. Queue

b)

B. Stack

c)

C. Array

d)

D. Linked List

6.

6. What is the output of this Java code?

String s = "hello";

System.out.println(s.charAt(1));

a)

A. h

b)

B. e

c)

C. l

d)

D. o

7.

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

a)

A. True

b)

B. False

c)

C. Error

d)

D. None

8.

8. What will be the output of this Java snippet?

a)

A. 30

b)

B. 31

c)

C. 32

d)

D. 29

9.

9.What will be the output of the following Python code?

a)

A. 25

b)

B. 10

c)

C. 13

d)

D. 2 + 3 * 2 + 3

10.

10.What is the time complexity of the following code?

a)

A. O(n)

b)

B. O(log n)

c)

C. O(n²)

d)

D. O(n log n)