InterviewStack.io LogoInterviewStack.io

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.

MediumTechnical
22 practiced

Explain dependency management approaches for Python: requirements.txt with pip, pip-tools, Pipenv, Poetry, and Conda. For a reproducible data-science project, which would you pick and why?

EasyTechnical
21 practiced

Explain the difference between deep copy and shallow copy in Python. Give an example using lists and a dict containing a list so the difference is clear.

HardTechnical
38 practiced

You're given a function that intermittently raises MemoryError when processing large NumPy arrays. List a systematic debugging and mitigation plan: how to collect memory profiles, common causes, and code changes to reduce peak memory usage.

HardSystem Design
26 practiced

Design a small internal CLI that watches a shared folder for incoming operational reports, validates each file, aggregates key metrics, and writes a daily summary for the operations team. What would you include in the design to make it reliable, idempotent, and easy to debug when one file breaks the run?

MediumTechnical
20 practiced

Write a function safe_import(module_name) that imports a module by name and returns a tuple (module_or_none, error_message_or_none). It should not raise exceptions to the caller, should capture ImportError, SyntaxError from broken packages, and handle long import times by using a timeout. Provide an implementation using standard library only.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.