wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python and ITIL Quiz

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

What is the output?
def f(x=[]):

x.append(1)

return x

print(f(), f())

a)

[1] [1]

b)

[1] [1,1]

c)

Error

d)

[] []

2.

Which statement about Python memory management is TRUE?

a)

Reference counting handles circular references

b)

Garbage collection runs after every function call

c)

Reference count reaching zero triggers deallocation

d)

Memory is freed only at program termination

3.

Which object can be safely used as a dictionary key?

a)

[1,2]

b)

{1,2}

c)

(1,[2,3])

d)

(1,2,3)

4.

What will be printed?
x = [1,2,3]
y = x
z = x[:]
x.append(4)
print(y, z)

a)

[1,2,3] [1,2,3]

b)

[1,2,3,4] [1,2,3]

c)

[1,2,3,4] [1,2,3,4]

d)

Error

5.

Which feature allows assignment inside an expression?

a)

Ternary operator

b)

Lambda

c)

Walrus operator

d)

Generator expression

6.

What does hashlib.sha256(data).hexdigest() guarantee?

a)

Confidentiality

b)

Integrity

c)

Authentication

d)

Compression

7.

Which Python object is immutable?

a)

list

b)

dict

c)

set

d)

tuple

8.

What is the output?
print(bool([]), bool(0), bool(None))

a)

True True True

b)

False False False

c)

False True False

d)

True False False

9.

Which module is MOST appropriate to validate file integrity after download?

a)

random

b)

datetime

c)

hashlib

d)

os

10.

What happens when break is executed inside a nested loop?

a)

Exits all loops

b)

Skips one iteration

c)

Exits only the current loop

d)

Terminates the program

11.

Which socket type is stream-oriented?

a)

UDP

b)

ICMP

c)

TCP

d)

RAW

12.

Which regex matches any NON-whitespace character?

a)

\s

b)

\w

c)

\S

d)

.

13.

Which clause is evaluated LAST in SQL execution order?

a)

WHERE

b)

GROUP BY

c)

HAVING

d)

ORDER BY

14.

Which query correctly finds departments with more than 3 employees earning > 30,000?

a)

WHERE salary>30000 AND COUNT()>3

b)

GROUP BY dept HAVING salary>30000 AND COUNT()>3

c)

WHERE salary>30000 GROUP BY dept HAVING COUNT(*)>3

d)

GROUP BY dept WHERE salary>30000

15.

Which index is optimal for this query?
SELECT * FROM orders
WHERE user_id = 5 AND order_date > '2024-01-01';

a)

order_date

b)

user_id

c)

(order_date, user_id)

d)

(user_id, order_date)

16.

Which statement about COUNT(col) is TRUE?

a)

Counts all rows

b)

Counts NULL values

c)

Ignores NULL values

d)

Counts only distinct values

17.

What happens if a FOREIGN KEY references a non-indexed column (InnoDB)?

a)

FK is created with warning

b)

Index is auto-created

c)

FK creation fails

d)

Works but slower

18.

Which JOIN never reduces rows from the left table?

a)

INNER

b)

RIGHT

c)

LEFT

d)

CROSS

19.

What is the result of
SELECT COUNT(DISTINCT NULL);

a)

1

b)

NULL

c)

Error

d)

0

20.

What privilege allows viewing running queries?

a)

SELECT

b)

PROCESS

c)

SUPER

d)

SHOW DATABASES

21.

Which ITIL process focuses on root-cause elimination?

a)

Incident

b)

Event

c)

Problem

d)

Change

22.

Which ITIL stage balances reliability vs cost daily?

a)

Strategy

b)

Design

c)

Transition

d)

Operation

23.

Primary purpose of a raised floor in data centers?

a)

Flood protection

b)

Cabling & airflow

c)

Noise control

d)

Security

24.

Which is a non-negotiable DC location prerequisite?

a)

Nearby offices

b)

Skilled manpower

c)

Power & water

d)

Real estate cost

25.

Data center consolidation primarily aims to:

a)

Increase servers

b)

Improve utilization

c)

Increase redundancy

d)

Reduce security

26.

Which creates the biggest DC operational risk?

a)

Modular cabling

b)

Single power source

c)

Redundant HVAC

d)

Load balancing

27.

Disaster Recovery mainly ensures:

a)

High performance

b)

Business continuity

c)

Zero attacks

d)

Faster deployment

28.

CSI in ITIL focuses on:

a)

New services

b)

Continuous improvement

c)

Incident handling

d)

Cost cutting

29.

Which hypervisor runs directly on hardware?

a)

Type-2

b)

Hosted

c)

Type-1

d)

Application

30.

Why is NAT Gateway used in private subnet?

a)

Inbound access

b)

Outbound internet only

c)

DNS resolution

d)

Replace IGW

31.

Why are Docker volumes used with databases?

a)

Faster queries

b)

Data persistence

c)

Encryption

d)

Memory sharing

32.

Which Jenkins cron avoids thundering herd?

a)

* * * * *

b)

*/1 * * * *

c)

H * * * *

d)

0 * * * *

33.

What breaks first if Terraform state is lost?

a)

Resources

b)

Provider

c)

Drift detection

d)

Cloud account

34.

Which Kubernetes service exposes static port on every node?

a)

ClusterIP

b)

LoadBalancer

c)

NodePort

d)

Ingress

35.

Why is Ansible called agentless?

a)

Uses HTTP

b)

Uses SNMP

c)

Uses SSH

d)

Runs only locally

36.

Which AWS storage supports shared Linux access?

a)

EBS

b)

S3

c)

EFS

d)

Glacier

37.

CAMS in DevOps stands for:

a)

Code Automation Monitoring Security

b)

Culture Automation Measurement Sharing

c)

Cloud Agile Monitoring Scaling

d)

Control Audit Metrics Security

38.

Immutable deployment means:

a)

No updates ever

b)

In-place updates

c)

Replace instances

d)

Manual patching

39.

Purpose of salt in password hashing?

a)

Shorten password

b)

Prevent same hash

c)

Decrypt later

d)

Speed hashing

40.

Kaizen in DevOps is enabled primarily by:

a)

IaC

b)

Immutable infra

c)

Continuous feedback

d)

Centralized control