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.

HardTechnical
76 practiced
Describe how you would handle a situation where a recent refactor changed dashboard numbers and stakeholders notice discrepancies. Outline the steps you'd take to investigate root cause, communicate impact and remediation plans to stakeholders, prepare rollback strategy, validate fixes before redeploy, and implement measures to prevent recurrence (tests, monitoring).
EasyTechnical
58 practiced
Explain Python variable assignment and naming conventions recommended for shared BI transformation code. Provide concrete examples of good names for common BI variables (e.g., row, user_count, avg_session_time), discuss use of underscores, constants, and when to favor descriptive names vs short names in analysis scripts.
MediumTechnical
80 practiced
Write a Python function read_jsonlines(path, encoding='utf-8') that yields parsed JSON objects from a file where each line is a JSON document. The function should handle invalid UTF-8 bytes by replacing them and skip malformed JSON lines while logging their line numbers to stderr. Use only the standard library.
HardTechnical
65 practiced
As a BI analyst authoring Python ETL scripts that run nightly, provide a robust retry decorator implementation that logs attempts, applies exponential backoff, and re-raises the last exception after N attempts. Include parameters for number of retries, initial delay, multiplier, and which exception types to catch. Sketch example usage.
HardTechnical
60 practiced
Implement infer_schema(csv_path, sample_size=1000) in Python that reads the first sample_size rows of a CSV and infers each column's type among integer, float, date, datetime, boolean, or string. Return a dict mapping column name to inferred type and explain heuristics you used to decide ambiguous cases and handle missing values.

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.