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.

EasyTechnical
22 practiced

Given a Pandas DataFrame df with columns ['user_id', 'event_time', 'value'], write idiomatic code to compute for each user the rolling 7-day sum of 'value' based on event_time (which is a datetime). Ensure the solution scales for millions of rows.

EasyTechnical
33 practiced

Describe how Python's reference counting and garbage collector work together to reclaim memory. Provide an example of an object pattern that requires the garbage collector (i.e., not reclaimed by reference counting alone).

HardTechnical
22 practiced

A process automation tool needs to validate hundreds of files in parallel, but the final summary must be emitted in the same order the files were submitted. A fatal parse error should stop remaining work as quickly as possible. How would you structure the goroutines, communication, and shutdown logic in Go?

HardSystem Design
26 practiced

You need to package a Python library used in data science which includes compiled C extensions and optional GPU support. Outline a cross-platform build and distribution strategy that simplifies installation for users on Linux, macOS, and Windows. Include CI steps and how you'd support pip installs.

HardSystem Design
35 practiced

Design a small library API in Python for vectorized string transformations on large Pandas Series that avoids creating multiple temporaries for chained operations (e.g., s.str.lower().str.replace(...).str.strip()). Sketch API and explain implementation strategies to minimize allocations.

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.