wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

debbuging

Total questions: 36

Worksheet time: 12mins

Name
Class
Date
1.

Which attribute is MOST important for accessibility?

a)

A)alt

b)

B)id

c)

C)title

d)

D)style

2.

Which attribute is MOST important for accessibility?

a)

A)alt

b)

B)id

c)

C)title

d)

D)style

3.

Output?

x = [1,2,3]

print(x.pop() + x.pop())

a)

A)3

b)

B)5

c)

C)4

d)

D)Error

4.

Which bug disappears when debug mode is enabled?

a)

A) Race bug

b)

B) Heisenbug

c)

C) Logic bug

d)

D) Syntax bug

5.

Error type?

print(int("1.5"))

a)

A) SyntaxError

b)

B) RuntimeWarning

c)

C) TypeError

d)

D) ValueError

6.

Which HTML tag improves SEO the most?

a)

A) <article>

b)

B) <div>

c)

C) <b>

d)

D) <iframe>

7.

What happens?

int *p;

printf("%d", *p);

a)

A) Prints random value

b)

B) Undefined compile

c)

C) 0

d)

D) Segmentation fault

8.

Which debugging method shows variable history?

a)

A) Renaming variables

b)

B) Print debugging

c)

C) Watch expressions

d)

D) Indenting code

9.

Output?

print([] is [])

a)

A) True

b)

B) Error

c)

C) Depends

d)

D) False

10.

Which error compiler detects?

a)

A) Runtime

b)

B) Input

c)

C) Syntax

d)

D) Logical

11.

Output?

x = 5

y = x > 3 and x < 10 or 0

print(y)

a)

A) 5

b)

B) True

c)

C) 0

d)

D) False

12.

Which HTML tag is NOT self-closing?

a)

A) <img>

b)

B) <br>

c)

C) <meta>

d)

D) <div>

13.

What happens?

int i = 0;

printf("%d %d", i++, ++i);

a)

A) 1 2

b)

B) 0 1

c)

C) 1 1

d)

D) Undefined behavior

14.

Memory leak occurs when:

a)

A) Wrong print

b)

B) Missing header

c)

C) Code is too long

d)

D) Memory allocated but not freed

15.

Output?

a = [0, 1, 2]

b = a[:]

b[0] = 10

print(a[0])

a)

A) Error

b)

B) 10

c)

C) 0

d)

D) None

16.

What does <meta charset="UTF-8"> do?

a)

A) Sets text encoding

b)

B) Adds heading

c)

C) Loads scripts

d)

D) Adds styling

17.

Which bug appears only on large inputs?

a)

A) Semantic

b)

B) Indentation bug

c)

C) Performance bug

d)

D) Syntax

18.

Error type?

d = {"a":1}

print(d["b"])

a)

A) NameError

b)

B) ValueError

c)

C) KeyError

d)

D) SyntaxError

19.

Which error stops program immediately?

a)

A) Logic

b)

B) Print

c)

C) Warning

d)

D) Runtime crash

20.

Output?

x = (1,2,3)

try:

x[0] = 10

except Exception as e:

print(type(e).__name__)

a)

A) ValueError

b)

B) TypeError

c)

C) No error

d)

D) IndexError

21.

Which HTML tag is semantic?

a)

A) <span>

b)

B) <font>

c)

C) <section>

d)

D) <div>

22.

When a program freezes suddenly, most likely cause?

a)

A) Compiler issue

b)

B) Import missing

c)

C) Print error

d)

D) Deadlock / infinite loop

23.

Output?

x = 1

def fun():

return x

x = 2

print(fun())

a)

A) Error

b)

B) None

c)

C) 2

d)

D) 1

24.

Which causes unpredictable behavior?

a)

A) Memory corruption

b)

B) Comments

c)

C) Missing return

d)

D) Dead code

25.

Error type?

for i in "123":

i += 1

a)

A) RuntimeError

b)

B) SyntaxError

c)

C) Logical error

d)

D) TypeError

26.

Which debugging step helps track code flow?

a)

A) Running

b)

B) Assembling

c)

C) Tracing

d)

D) Compilation

27.

Output?

printf("%d", sizeof("ABC"));

a)

A) 1

b)

B) 3

c)

C) Depends

d)

D) 4

28.

Which debugging method is BEST to isolate a bug?

a)

A) Remove loops

b)

B) Create minimal reproducible example

c)

C) Add comments

d)

D) Rewrite full code

29.

Output?

x = [1]

def f(y):

y = y + [2]

f(x)

print(x)

a)

A) [1, 2]

b)

B) Error

c)

C) [1]

d)

D) [1, [2]]

30.

Which error is FileNotFoundError?

a)

A) Syntax error

b)

B) Logic error

c)

C) Runtime error

d)

D) None

31.

Output?

x = 10

def f():

x = x + 1

return x

print(f())

a)

A) 11

b)

B) 10

c)

C) None

d)

D) Error (UnboundLocalError)

32.

Which bug appears due to loop boundary mistakes?

a)

A) Off-by-one error

b)

B) Import error

c)

C) Syntax error

d)

D) Input error

33.

What happens?

char s[] = "Hi";

char *p = s;

p[5] = 'X';

a)

A) Compilation error

b)

B) X added

c)

C) Undefined behavior

d)

D) Prints Hi

34.

Debugger cannot:

a)

A) Step into functions

b)

B) Inspect variables

c)

C) Pause execution

d)

D) Fix logic automatically

35.

Race condition occurs in:

a)

A) HTML pages

b)

B) Multi-thread programs

c)

C) Single-thread programs

d)

D) Compilers

36.

Which error is hardest to detect?

a)

A) Syntax

b)

B) Import

c)

C) Type

d)

D) Logical