Post List
-
Stacks, Queues, and Linked Lists in Python
When preparing for python coding interviews, three of the most common data structures you'll need to know are stacks, queues and linked lists interviewers love them because they test your understanding of memory, order of operations and problem-solving.
In this post, we will:
- Explain each data structure in simple terms.
- Show how to implement them from scratch in python.
- Solve a few classic mini-problems you might see in interviews. …
-
Memory Allocation in Python: Assignment vs Copy vs Deepcopy
When working with collections in Python, such as lists, dictionaries, sets, and custom objects, it's crucial to understand memory allocation. By the end of this article, you'll know the difference between assignment, shallow copying, and deep copying. You'll also be able to identify their implications on memory usage, object mutability, and time complexity.
-
Big-O notation and Time complexity in Python
Time complexity is a way to measure how the runtime of your program grows as the input size increases.
It helps you predict performance without actually running the code with huge inputs.
Input size (n) - the number of elements your function processes (length of a list, number of nodes, etc). * Runtime growth - how much slower your algorithm gets whennbecomes very large. Think of it … -
List and Array in Python
The List is one of the built-in data type in Python. The four collection data types are: list, tuple, set and dictionary.
-
Mutable and Immutable types in Python
🔷 Introduction
If you're preparing for Python coding interviews, you've probably heard the terms mutable and immutable. They may sound abstract, but they play a huge role in how Python works under the hood, and understanding them can save you from subtle bugs.
in this post, we'll explore:
- What mutability means in Python
- Which built-in types are mutable vs immutable
- Common interview pitfalls
- Why this concept …
-
Lists vs Tuples vs Sets vs Dictionnaries in Python
🔷 Introduction
If you're preparing for a Python coding interview, one of the first questions you'll face is:
"Wich data structure would you use for this problem, and why?"
Python offers four fundamental built-in data structures:
- List - ordered, mutable sequence.
- Tuple - ordered, immutable sequence.
- Set - unordered, unique elements.
- Dictionary - key-value mapping.
At first glance, they might feel interchangeable. But …