Programming Languages10 lessons32 quiz questions
Python
20-hour Pareto plan targeting Python for backend development and data processing roles. Session 1 anchors the mental model; subsequent sessions build from core language features to concurrency, testing, and ecosystem.
What You Will Learn
- ✓Python Mental Model: Objects, Names, and Scope
- ✓Core Data Structures and Comprehensions
- ✓Functions: First-Class Objects, Closures, and Decorators
- ✓OOP: Classes, Inheritance, and the Data Model
- ✓Generators, Iterators, and Functional Tools
- ✓Error Handling, Testing with pytest, and Debugging
- ✓Concurrency: Threading, Multiprocessing, and asyncio
- ✓Type Hints, Protocols, and Static Analysis
- ✓Python Packaging, Virtual Environments, and Project Structure
- ✓Capstone: Design and Build a Production-Ready REST API
Overview
20-hour Pareto plan targeting Python for backend development and data processing roles. Session 1 anchors the mental model; subsequent sessions build from core language features to concurrency, testing, and ecosystem.
Python Mental Model: Objects, Names, and Scope
Python's execution model differs fundamentally from many other languages. Understanding it prevents an entire class of subtle bugs.
Everything is an Object
In Python, everything — integers, functions, classes, modules — is an object with an identity (), a type (), and a value.
Names, Not Variables
Python has names that bind to objects, not variables that contain values. Assignment creates a binding, not a copy.
LEGB Scope Rule
Python resolves names in this order: Local → Enclosing → Global → Built-in
Python's Data Model: Mutable vs Immutable
Interview Q&A
Q: What is the difference between and in Python?
A: compares values (calls ). compares identity — whether two names refer to the exact same object in memory (). For small integers (-5 to 256) and interned strings, Python caches objects, so may return even for literals. Always use for value comparison; use only for checks ().
Q: Why should you never use a mutable default argument?
A: Default argument values are evaluated once when the function is defined, not each time it's called. A mutable default (like or ) is created once and shared across all calls that don't provide that argument. Mutations in one call persist to the next. Fix: use as default and create the mutable inside the function body.
Q: What does Python's function return?
A: The memory address of the object (CPython implementation). It's guaranteed to be unique among currently existing objects. After an object is deleted and garbage collected, a new object may get the same id. Use to verify if two names refer to the same object.
Common Mistakes
Java Implementation
Sample Quiz Questions
1. What is the output? ```python def f(x=[]): x.append(1) return x print(f()) print(f()) ```
Apply·Difficulty: 3/5
2. What is the GIL and why does it matter for Python concurrency?
Apply·Difficulty: 3/5
3. What does `functools.wraps` do and why is it important in decorators?
Understand·Difficulty: 2/5
+ 29 more questions available in the full app.
Related Topics
Master Python for Your Next Interview
Get access to full lessons, adaptive quizzes, cheat sheets, code playground, and progress tracking — completely free.