Comprehensive knowledge of the Python programming language, idiomatic usage, and the ability to implement correct, readable, and testable solutions to coding problems. Core language elements include syntax and semantics, primitive and composite data types such as integers, floats, strings, lists, dictionaries, sets, and tuples, sequence and mapping operations, control flow constructs, functions and closures, and object oriented programming basics including classes, instances, inheritance, and special methods. Additional practical topics include error and exception handling, file input and output operations, comprehensions and generator expressions, generator functions and iteration protocols, context managers, lambda functions, unpacking, and common standard library utilities. Candidates should understand algorithmic time and space complexity for common operations, typical performance characteristics of lists and dictionaries, and common pitfalls such as mutable default arguments and shared mutable state. Interview focused expectations include writing clean correct code without editor assistance, sensible variable naming, implementing basic algorithms and data structure manipulations under time constraints, reasoning about tradeoffs and complexity, and demonstrating testability and code quality.
HardSystem Design
0 practiced
You're asked to design a concurrent data-processing pipeline in Python that reads compressed JSONL files, applies CPU-intensive feature extraction, and writes per-user aggregations to disk. Describe the architecture, components, error handling, and how you'd balance IO and CPU (e.g., threads/async for IO, processes for CPU). Provide a concise code sketch demonstrating the key concurrency primitives you would use.
HardTechnical
0 practiced
You inherit a model training loop class that directly opens files, seeds random globally, and instantiates heavy dependencies inside methods making it hard to unit test. Refactor this design to improve testability: show a before-and-after code sketch where you inject data loaders, rng, and persistence handlers. Explain how dependency injection and small interfaces improve unit testing and CI reliability for model code.
EasyTechnical
0 practiced
Explain shallow copy vs deep copy in Python and demonstrate with a short code example using lists that contain nested mutable objects. Show the behavior when modifying the nested object after performing a shallow copy and after performing a deep copy (using the copy module). Discuss performance and when each approach is appropriate in data pipelines.
HardTechnical
0 practiced
You have Python code that computes a per-element transformation over a large list using pure Python loops, but it's too slow. Given an example loop that multiplies arrays elementwise and adds a bias, describe and implement optimized approaches: vectorized NumPy, memoryviews/array module, multiprocessing chunking, and briefly how to migrate critical loops to Cython. Include microbenchmark strategy to compare approaches.
EasyTechnical
0 practiced
Write a Python function that reads a CSV file and computes the average of the numeric column named 'value' but only for rows where 'status' == 'ok'. The CSV has a header. Show a small sample CSV in the prompt and your idiomatic solution using the standard library. Mention how you'd handle missing or malformed values and files too large to fit in memory.
Unlock Full Question Bank
Get access to hundreds of Python Fundamentals and Problem Solving interview questions and detailed answers.