---
title: Python Interview Questions & Answers (2026): Core, Data Structures & Gotchas
description: The Python interview questions that get asked in 2026 — data types, mutability, list vs tuple, decorators, generators, and the classic gotchas — with clear answers and what each tests.
url: https://usegreenroom.app/blog/python-interview-questions
last_updated: 2026-06-19
---

← Back to blog

Technical

# Python interview questions and answers

June 19, 2026 · 9 min read

![Python interview questions and answers — cover from Greenroom, the AI mock interviewer](/assets/blog/python-interview-questions-hero.webp)

Python shows up everywhere now — backend, data, ML, automation, and most India fresher hiring. Its interviews reward knowing the language's *behavior*, not just its syntax, because Python has a handful of famous gotchas interviewers love. Here are the **Python interview questions** that actually get asked, with answers.

## Core Python

- Mutable vs immutable types — list/dict/set vs tuple/str/int.
- List vs tuple vs set vs dictionary — when to use each.
- What is `*args` and `**kwargs`?
- Shallow copy vs deep copy.
- How does Python manage memory and garbage collection (reference counting)?

## The famous gotchas

- **Mutable default arguments** — why `def f(x=[])` is a trap.
- **is vs ==** — identity vs equality, and small-integer caching.
- Why `0.1 + 0.2 != 0.3` (floating point).
- Late binding in closures and loops.

![Python interview topics — data types, mutability, decorators, generators](/assets/blog/pool-structured-screen.webp)

Python rounds love the gotchas — mutability, default arguments, comprehensions.

## Intermediate concepts

- List comprehensions and generator expressions — and when generators save memory.
- Decorators — what they are and a real use case.
- Generators and the `yield` keyword.
- The Global Interpreter Lock (GIL) and what it means for threads vs processes.
- `__init__` vs `__new__`; dunder methods.

**The core truth:** Python interviews test whether you understand the language's *behavior* — mutability, the GIL, the default-argument trap. Anyone can write Python; the hire knows why it behaves the way it does.

## How to prepare

Many Python rounds are live and verbal — you explain what a snippet does and why. Practise *articulating* behavior out loud. Greenroom runs spoken technical interviews that probe your reasoning and give feedback on clarity. Pair it with our data structures and SQL guides.

## Frequently asked questions

### What are the most common Python interview questions?

Common Python questions cover mutable vs immutable types, list/tuple/set/dictionary differences, \*args and \*\*kwargs, shallow vs deep copy, memory management and reference counting, the famous gotchas (mutable default arguments, is vs ==, floating-point precision), and intermediate topics like decorators, generators, comprehensions and the GIL.

### Why are mutable default arguments a problem in Python?

A default argument is evaluated once when the function is defined, not each time it's called. So a mutable default like def f(x=[]) shares the same list across all calls — appending to it in one call persists into the next. The fix is to default to None and create a fresh list inside the function.

### What is the GIL in Python?

The Global Interpreter Lock is a mutex that allows only one thread to execute Python bytecode at a time within a process. It means CPU-bound multithreading doesn't achieve true parallelism in CPython, so you use multiprocessing for CPU-bound work and threads or async mainly for I/O-bound work.

### How should I prepare for a Python interview?

Focus on understanding Python's behavior — mutability, the gotchas, generators, decorators and the GIL — not just syntax, since interviewers ask why a snippet behaves a certain way. Then practise explaining that behavior out loud, ideally with a voice-based mock interview that probes your reasoning, because many Python rounds are live and verbal.

Python rounds test behavior you can explain, not just syntax. Greenroom runs spoken technical interviews that probe your reasoning and give feedback. Free to start.