NEW
Font size
WorksheetsPython and ITIL Quiz
Total questions: 40
Worksheet time: 20mins
What is the output?
def f(x=[]):
x.append(1)
return x
print(f(), f())
[1] [1]
[1] [1,1]
Error
[] []
Which statement about Python memory management is TRUE?
Reference counting handles circular references
Garbage collection runs after every function call
Reference count reaching zero triggers deallocation
Memory is freed only at program termination
Which object can be safely used as a dictionary key?
[1,2]
{1,2}
(1,[2,3])
(1,2,3)
What will be printed?
x = [1,2,3]
y = x
z = x[:]
x.append(4)
print(y, z)
[1,2,3] [1,2,3]
[1,2,3,4] [1,2,3]
[1,2,3,4] [1,2,3,4]
Error
Which feature allows assignment inside an expression?
Ternary operator
Lambda
Walrus operator
Generator expression
What does hashlib.sha256(data).hexdigest() guarantee?
Confidentiality
Integrity
Authentication
Compression
Which Python object is immutable?
list
dict
set
tuple
What is the output?
print(bool([]), bool(0), bool(None))
True True True
False False False
False True False
True False False
Which module is MOST appropriate to validate file integrity after download?
random
datetime
hashlib
os
What happens when break is executed inside a nested loop?
Exits all loops
Skips one iteration
Exits only the current loop
Terminates the program
Which socket type is stream-oriented?
UDP
ICMP
TCP
RAW
Which regex matches any NON-whitespace character?
\s
\w
\S
.
Which clause is evaluated LAST in SQL execution order?
WHERE
GROUP BY
HAVING
ORDER BY
Which query correctly finds departments with more than 3 employees earning > 30,000?
WHERE salary>30000 AND COUNT()>3
GROUP BY dept HAVING salary>30000 AND COUNT()>3
WHERE salary>30000 GROUP BY dept HAVING COUNT(*)>3
GROUP BY dept WHERE salary>30000
Which index is optimal for this query?
SELECT * FROM orders
WHERE user_id = 5 AND order_date > '2024-01-01';
order_date
user_id
(order_date, user_id)
(user_id, order_date)
Which statement about COUNT(col) is TRUE?
Counts all rows
Counts NULL values
Ignores NULL values
Counts only distinct values
What happens if a FOREIGN KEY references a non-indexed column (InnoDB)?
FK is created with warning
Index is auto-created
FK creation fails
Works but slower
Which JOIN never reduces rows from the left table?
INNER
RIGHT
LEFT
CROSS
What is the result of
SELECT COUNT(DISTINCT NULL);
1
NULL
Error
0
What privilege allows viewing running queries?
SELECT
PROCESS
SUPER
SHOW DATABASES
Which ITIL process focuses on root-cause elimination?
Incident
Event
Problem
Change
Which ITIL stage balances reliability vs cost daily?
Strategy
Design
Transition
Operation
Primary purpose of a raised floor in data centers?
Flood protection
Cabling & airflow
Noise control
Security
Which is a non-negotiable DC location prerequisite?
Nearby offices
Skilled manpower
Power & water
Real estate cost
Data center consolidation primarily aims to:
Increase servers
Improve utilization
Increase redundancy
Reduce security
Which creates the biggest DC operational risk?
Modular cabling
Single power source
Redundant HVAC
Load balancing
Disaster Recovery mainly ensures:
High performance
Business continuity
Zero attacks
Faster deployment
CSI in ITIL focuses on:
New services
Continuous improvement
Incident handling
Cost cutting
Which hypervisor runs directly on hardware?
Type-2
Hosted
Type-1
Application
Why is NAT Gateway used in private subnet?
Inbound access
Outbound internet only
DNS resolution
Replace IGW
Why are Docker volumes used with databases?
Faster queries
Data persistence
Encryption
Memory sharing
Which Jenkins cron avoids thundering herd?
* * * * *
*/1 * * * *
H * * * *
0 * * * *
What breaks first if Terraform state is lost?
Resources
Provider
Drift detection
Cloud account
Which Kubernetes service exposes static port on every node?
ClusterIP
LoadBalancer
NodePort
Ingress
Why is Ansible called agentless?
Uses HTTP
Uses SNMP
Uses SSH
Runs only locally
Which AWS storage supports shared Linux access?
EBS
S3
EFS
Glacier
CAMS in DevOps stands for:
Code Automation Monitoring Security
Culture Automation Measurement Sharing
Cloud Agile Monitoring Scaling
Control Audit Metrics Security
Immutable deployment means:
No updates ever
In-place updates
Replace instances
Manual patching
Purpose of salt in password hashing?
Shorten password
Prevent same hash
Decrypt later
Speed hashing
Kaizen in DevOps is enabled primarily by:
IaC
Immutable infra
Continuous feedback
Centralized control
