Memory-Management

17 articles
Interview Preparation Intermediate

6.15 Hands-on Exercises

Practice programs and mini projects for reinforcing Python variable and memory management concepts — UnboundLocalError, shallow vs deep …

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.14 Interview Questions

Frequently asked and scenario-based Python interview questions covering references, shallow vs deep copy, UnboundLocalError, the LEGB rule, …

Jan 20, 2026 Read more
Interview Preparation Beginner

6.13 Best Practices

Practical habits for writing memory-safe, readable Python — meaningful names, avoiding global state, using constants, and memory-efficient …

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.12 Common Mistakes

The most common variable and memory-related bugs in Python — UnboundLocalError, shared mutable objects, variable shadowing, and assuming …

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.11 Variables in DevOps

How configuration variables, environment variables, secrets, AWS credentials, and Terraform variables are managed in real DevOps Python …

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.10 Variables in Functions

How Python passes arguments into functions, why mutable and immutable arguments behave differently when modified inside a function, and the …

Jan 20, 2026 Read more
Interview Preparation Beginner

6.9 Lifetime of Variables

When a Python variable's lifetime begins and ends, how the del statement differs from letting a scope exit naturally, and how lifetime …

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.8 Variable Scope

Local, global, and enclosing scope in Python, the global and nonlocal keywords, and the LEGB rule Python uses to resolve any name.

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.7 Memory Optimization

CPython's automatic object-reuse optimizations — string interning and small integer caching — why they exist, and why they're implementation …

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.6 Garbage Collection

How CPython's reference-counting memory manager works, why a supplementary cyclic garbage collector exists for reference cycles, and how to …

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.5 Copying Objects

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 …

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.4 Assignment Operations

Why all assignment in Python is reference assignment, why there's no true separate value-assignment mechanism, and how that plays out …

Jan 20, 2026 Read more
Interview Preparation Intermediate

6.3 Memory Management: Stack vs Heap

How CPython splits memory between the call stack (frame references) and the heap (actual object data), and why that split explains reference …

Jan 20, 2026 Read more
Interview Preparation Beginner

6.2 Objects and Variable References

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 …

Jan 20, 2026 Read more
Interview Preparation Beginner

6.1 Introduction to Variables

What a variable really is underneath the syntax, why that matters for memory behavior, and a map of the deeper reference, memory, and scope …

Jan 20, 2026 Read more