Python Basics - Part 1

These questions come from the Python session. They are here so you can check whether the core ideas are actually clear — not whether you can recite a definition.

There are no answers on this page on purpose. Try each question first, and if you are unsure, go back over the session, review the concept, and give it another try.

Why are we doing this?

If you can explain the basics, you can explain what the code is really doing

Python shows up constantly in interviews, but the questions are rarely about syntax.

They are about what happens in memory when a variable is reassigned, how typing actually works, why we talk about Big-O instead of wall-clock time, and what a Python list really is.

Think of these questions as practice for explaining those ideas naturally — especially in an interview.

Don’t worry about giving a textbook-perfect answer. Try to explain each concept as if you were explaining it to another person. If you get stuck, review the session and try again.

Five questions

Variables, typing, Big-O, and lists

  1. What happens in memory when you write x = 10 and then x = 20 in Python?
  2. Is Python strongly typed, dynamically typed, or both? Explain with an example.
  3. What is Big-O notation, and why can’t we simply measure execution time in seconds to compare two algorithms?
  4. Is a Python list an array, linked list, or dynamic array? Explain how it works conceptually.
  5. What are the time complexities of accessing, appending, inserting, removing, and iterating through a Python list? More importantly, explain why.

Time complexity practice

Ten short examples from the session

NOTE: Your task is to go through each piece of code and determine its time complexity.

How to Use This Page

Five questions. One goal: make sure the concepts are clear.

You don’t need to memorize definitions.

Instead, try to explain each answer naturally, using your own words and examples.

The goal is not to give the perfect answer. The goal is to understand the concept well enough that you can explain it in your own words.