Python Programming Questions

Python as an interview language: core syntax, data types and built-in collections, comprehensions, iterators and generators, idiomatic style, and the standard library, extending into data-oriented and automation use of the language and its common libraries. Covers writing correct, Pythonic code and reasoning about the language's semantics. The most heavily exercised language surface in this category across engineering and data roles.

HardTechnical
31 practiced

Design a producer-consumer pipeline in Python where producers can outpace consumers. How do you apply backpressure so producers don't overwhelm consumers, using a bounded queue? Walk through both a threading-based version and an asyncio.Queue-based version, and the wake-up semantics involved (notify vs notify_all, or await put/get).

MediumTechnical
20 practiced

You maintain a codebase with heavy numeric work written in NumPy. A colleague proposes moving core loops to Numba for speed. What tests and benchmarks would you write to validate correctness and performance? Describe potential gotchas with Numba and how to test them.

MediumTechnical
22 practiced

You have a flaky unit test that intermittently times out. Outline a debugging and remediation plan in a Python project with pytest and CI, including how to reproduce locally, collect traces, and enforce test stability.

EasyTechnical
23 practiced

Which built-in Python types are mutable and which are immutable? Give at least two examples of each, and explain a concrete bug that mixing them up causes in practice.

MediumTechnical
18 practiced

Write a function that removes duplicates from a list while preserving the first-seen order. It only needs to handle hashable elements. Then explain the time and space complexity of your solution and how you'd adapt it if the input were far too large to hold a full result list in memory.

Unlock Full Question Bank

Get access to all Python Programming interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.