InterviewStack.io LogoInterviewStack.io

Python Fundamentals and Problem Solving Questions

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.

HardTechnical
0 practiced
Explain the mechanics of Python's memory management: reference counting and the generational garbage collector. For a long-running ETL job creating many short-lived cyclic structures, how would you detect leaks and mitigate them? Include examples using the `gc` module and common fixes.
HardTechnical
0 practiced
Implement a chunked CSV reader that robustly parses files with quoted fields that can include embedded newlines and very long lines. Describe how to handle chunk boundaries where quoted fields are split across chunks, and provide a code outline using Python's `csv` module and incremental buffering to avoid loading entire files.
MediumTechnical
0 practiced
Implement a Python generator `merge_sorted(a, b)` that merges two sorted iterators of integers into a single sorted iterator without converting iterators to lists. Explain how this approach is useful for merging sorted partitions during a reduce step in a distributed pipeline.
HardTechnical
0 practiced
Implement a thread-safe singleton pattern in Python intended for use by multiple threads within a long-running ETL worker, and discuss additional considerations when the process uses `fork()` (e.g., multiprocessing) or is hot-reloaded. Provide code and alternatives for across-process singletons.
MediumTechnical
0 practiced
Explain the difference between shallow and deep copy in Python. Give examples using nested lists and custom objects, show how to create deep copies using the `copy` module, and explain scenarios where `copy.copy()` is insufficient in ETL transformations.

Unlock Full Question Bank

Get access to hundreds of Python Fundamentals and Problem Solving interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.