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
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.

MediumTechnical
23 practiced

A data pipeline intermittently produces different results on different runs (non-deterministic). List possible Python-language and library causes (e.g., dict ordering, floating-point reductions, parallelism) and propose concrete fixes to achieve determinism for production runs.

MediumTechnical
26 practiced

In Go, implement a function that reads a text file containing one record per line, converts each valid line into a struct, and returns the parsed records along with any recoverable parse issues. Show how you would handle errors from opening the file, scanning lines, and parsing fields so the caller can decide whether to fail the job.

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.

MediumTechnical
37 practiced

Design a small experiment to measure the overhead of Python's exception handling in a tight loop. Provide code snippets to compare raising/catching exceptions vs error-code return approaches and describe how to interpret the results.

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.