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.

HardSystem Design
0 practiced
Design a robust serialization/deserialization scheme in Python for message passing that supports complex nested objects (dataclasses, datetime, Decimal), is version tolerant, and can be extended to new types. Provide code sketches for custom JSON encoders/decoders, discuss type tagging, and outline security considerations when deserializing untrusted input.
EasyTechnical
0 practiced
What are generators and the iterator protocol in Python? Give a concise example of a generator that yields increasingly recent timestamps as strings (conceptually), explain how `yield` differs from `return`, and describe why generators are useful in ETL pipelines for memory efficiency.
HardTechnical
0 practiced
Implement a type-annotated Python function that merges K sorted iterables using a heap for efficiency and analyze time/memory complexity. Then provide an asynchronous variant that consumes async iterables (e.g., network sources) and merges them using `asyncio` while preserving sort order.
HardTechnical
0 practiced
Propose a comprehensive unit and integration testing strategy for Python ETL code. Include approaches for pure functions, I/O-bound stages, end-to-end pipeline tests, use of fixtures, mocking external services, and CI integration. Give concrete examples of test cases and how to structure them for maintainability.
EasyTechnical
0 practiced
Implement a Python function `unique_preserve_order(items: Iterable[T]) -> List[T]` that returns unique elements preserving their first-seen order. The implementation should be efficient and work for hashable elements. Describe complexity and how to extend it to unhashable elements (e.g., dicts).

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.