InterviewStack.io LogoInterviewStack.io

Python Fundamentals and Core Syntax Questions

Comprehensive knowledge of core Python language features and syntax, including primitive and composite data types such as integer numbers, floating point numbers, strings, booleans, lists, dictionaries, sets, and tuples. Candidates should understand variable assignment and naming, operators for arithmetic, logical, and comparison operations, and control flow constructs including conditional statements and loops. Expect familiarity with function definition, invocation, parameter passing, return values, and scope rules, as well as common built in functions and idioms such as iteration utilities, list comprehensions, generator expressions, and basic functional utilities like map and filter. Candidates should demonstrate error and exception handling techniques and best practices for writing readable and maintainable code with modularization and clear naming. Practical skills include file input and output, working with common data formats such as comma separated values and JavaScript Object Notation, selecting appropriate data structures with attention to performance and memory characteristics, and applying memory efficient patterns for processing large data sets using iterators and generators. Familiarity with the standard library and common utilities for parsing and transforming data, and the ability to write small code snippets to solve algorithmic and data manipulation tasks, are expected.

MediumTechnical
0 practiced
Given log lines like '2025-01-02 12:34:56, user_id=123, amount=45.67', write a Python function parse_log_line(line) that returns a dict with keys 'timestamp' (a datetime object), 'user_id' (int), and 'amount' (float). Use regular expressions with named groups and datetime.strptime. Handle missing fields by returning None for those keys.
MediumTechnical
0 practiced
Implement chunked_iterable(iterable, chunk_size) in Python that yields lists of up to chunk_size items from an arbitrary iterable without loading the entire iterable into memory. Show an example use-case in BI where processing rows in chunks reduces memory spikes and improves throughput.
HardTechnical
0 practiced
Implement merge_events(iterables) that takes multiple sorted iterables of event dicts (each sorted by the 'timestamp' key) and yields events in global timestamp order using heapq.merge or an equivalent streaming approach. Additionally, ensure duplicate event_ids are suppressed (the first occurrence wins) while streaming so memory stays as low as possible.
HardTechnical
0 practiced
As a BI analyst deciding where to implement transformations, explain when to write Python code versus delegating the transformation to SQL in the database or to a big-data engine. Discuss trade-offs including performance, maintainability, data locality, concurrency, operational overhead, and team skills.
HardSystem Design
0 practiced
Design a small Python package layout for a reusable BI 'reporting' library with modules for io, parsing, transforms, pipelines, and exporters. Provide example function signatures for core interfaces (e.g., read_source, transform_row, write_report), explain module responsibilities, and describe testing and documentation strategies to make the library usable by non-developer analysts.

Unlock Full Question Bank

Get access to hundreds of Python Fundamentals and Core Syntax interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.