6.15 Hands-on Exercises
Practice programs and mini projects for reinforcing Python variable and memory management concepts — UnboundLocalError, shallow vs deep …
Practice programs and mini projects for reinforcing Python variable and memory management concepts — UnboundLocalError, shallow vs deep …
Frequently asked and scenario-based Python interview questions covering references, shallow vs deep copy, UnboundLocalError, the LEGB rule, …
Practical habits for writing memory-safe, readable Python — meaningful names, avoiding global state, using constants, and memory-efficient …
The most common variable and memory-related bugs in Python — UnboundLocalError, shared mutable objects, variable shadowing, and assuming …
How configuration variables, environment variables, secrets, AWS credentials, and Terraform variables are managed in real DevOps Python …
How Python passes arguments into functions, why mutable and immutable arguments behave differently when modified inside a function, and the …
When a Python variable's lifetime begins and ends, how the del statement differs from letting a scope exit naturally, and how lifetime …
Local, global, and enclosing scope in Python, the global and nonlocal keywords, and the LEGB rule Python uses to resolve any name.
CPython's automatic object-reuse optimizations — string interning and small integer caching — why they exist, and why they're implementation …
How CPython's reference-counting memory manager works, why a supplementary cyclic garbage collector exists for reference cycles, and how to …
The difference between assignment, a shallow copy, and a deep copy in Python, when each is appropriate, and how the copy module's copy() and …
Why all assignment in Python is reference assignment, why there's no true separate value-assignment mechanism, and how that plays out …
How CPython splits memory between the call stack (frame references) and the heap (actual object data), and why that split explains reference …
Why a Python variable is a label pointing at an object rather than a box holding a value, what that means for reference assignment, and why …
What a variable really is underneath the syntax, why that matters for memory behavior, and a map of the deeper reference, memory, and scope …
Diagnose and fix a Python service being OOM-killed in Kubernetes by profiling memory growth and switching to streaming JSON parsing.
Diagnose and fix unbounded memory growth in a Python microservice using tracemalloc, replacing an unbounded module-level set with Redis TTL …