English
Review questions
Questions for self-check and exam preparation, grouped by course topic.
Topic 1. Python, PyCharm, and Git
- What is the Python language? Explain how the CPython interpreter works: bytecode, the virtual machine, and dynamic typing.
- How do you create and run a Python project in JetBrains PyCharm? How do you configure the project interpreter?
- What are virtual environments? How do you create and activate them (venv)?
- How do you install packages with pip and uv? What are PyPI and the requirements.txt file?
- What is the Git version control system? Explain the concepts of a repository, a commit, and a branch, and the basic Git commands.
- How do you work with a Git repository in PyCharm? Which files of a Python project should be added to .gitignore?
Topic 2. Types, operations, control flow
- What built-in data types does Python have? Explain the concept of variables as references to objects.
- Compare mutable and immutable data types. Give examples.
- What operations does Python support? Explain integer division, exponentiation, and the assignment expression operator :=.
- How do you perform console input with input and output with print? How do you convert data types?
- Explain the if-elif-else conditional statement, the for and while loops, and the range function.
- What is structural pattern matching (match-case)? Give examples.
Topic 3. Functions
- Explain function definitions in Python, return values, and docstrings.
- Explain the kinds of function parameters: positional, keyword, default parameters, *args, and **kwargs.
- Why should you not use mutable objects as default parameter values?
- Explain variable scopes according to the LEGB rule and the global and nonlocal keywords.
- What is recursion? What recursion depth limits does Python have?
- What are type annotations? Explain annotations of parameters and return values, and the None type. How are annotations evaluated in Python 3.14, and why do they not check values at run time?
Topic 4. Exceptions and debugging
- Explain Python's built-in exception hierarchy: BaseException, Exception, and their subclasses.
- Explain how the try, except, else, and finally blocks work. When can several exception types be written without parentheses in Python 3.14, and why are parentheses required when binding with as?
- How do you raise an exception (raise) and create a custom exception class? What is exception chaining?
- What are exception groups (ExceptionGroup) and the except* construct?
- What are context managers and the with statement?
- What debugging tools does PyCharm provide? What are the logging and pdb modules used for?
Topic 5. Built-in collections
- Explain the basic list operations: indexing, slicing, adding and removing elements, and sorting.
- Compare lists and tuples. What is tuple unpacking?
- Explain sets (set, frozenset) and the operations on them.
- Explain dictionaries: creation, element access, and the get, items, and update methods.
- What are list, set, and dictionary comprehensions?
- Explain the collections in the collections module: namedtuple, deque, Counter, and defaultdict.
- Compare the complexity of the basic operations on lists, sets, and dictionaries.
Topic 6. Strings and regular expressions
- Explain the basic string methods: searching, replacing, splitting, and joining.
- What are f-strings? Explain formatting numbers and dates in f-strings.
- What are the template strings (t-strings) of Python 3.14, and how do they differ from f-strings? What is the responsibility of the handler of text substitutions?
- Explain string encodings, the str and bytes types, and conversion between them.
- Explain the main functions of the re module: match, fullmatch, search, findall, finditer, sub, and split. Why is fullmatch used to validate the entire input?
- What are groups and named groups in regular expressions? How do you compile a regular expression?
Topic 7. Generators and decorators
- What are iterables and iterators? Explain the iteration protocol (iter, next).
- What are generators and the yield statement? Compare generators with lists.
- What are generator expressions? When is it appropriate to use them?
- Explain the useful functions of the itertools module.
- What are lambda functions? Explain the map, filter, and sorted functions with the key parameter.
- What is a closure? Explain higher-order functions and the functools module.
- What are decorators? How do you create a decorator with parameters and preserve a function's metadata (functools.wraps)?
Topic 8. Classes and objects
- Explain class definitions, object creation, and the __init__ initializer.
- Compare instance attributes and class attributes.
- Compare instance methods, class methods (@classmethod), and static methods (@staticmethod).
- What are properties (@property)? How do you create a property setter?
- How is encapsulation implemented in Python: naming conventions with one and two underscores?
- What is the __slots__ attribute used for?
Topic 9. Inheritance and protocols
- What is inheritance? Explain method overriding and the super function.
- What are multiple inheritance and the method resolution order (MRO)?
- What are polymorphism and duck typing in Python?
- What are abstract classes? Explain the abc module and the @abstractmethod decorator.
- What are protocols (typing.Protocol) and structural typing?
- Compare abstract classes and protocols. When should each of them be used?
- What are mixin classes? Compare inheritance and composition.
Topic 10. Special methods, dataclass
- What are special methods? Explain the __str__ and __repr__ methods.
- How do you overload arithmetic and comparison operations for a custom class?
- Which special methods implement the container protocols (__len__, __getitem__, __contains__, __iter__)?
- What are the __eq__ and __hash__ methods? How are they related?
- What are data classes (@dataclass)? Explain the frozen, order, and field parameters.
- What are enumerations (Enum, IntEnum, StrEnum) and the auto function?
Topic 11. Modules, files, pytest
- What are modules and packages in Python? Explain importing, the __init__.py file, and the __name__ check.
- How do you read and write text and binary files? What is the with statement used for?
- What capabilities does the pathlib module provide for working with paths, files, and directories?
- How do you serialize and deserialize data in JSON format with the json module?
- How do you read and write CSV files with the csv module?
- How do you write unit tests with pytest: test functions, assert, fixtures, and parameterization?
Topic 12. Databases, SQL, SQLAlchemy
- What are a table, a primary key, and a foreign key in a relational database?
- How do you create a table and perform INSERT, SELECT, UPDATE, and DELETE operations?
- How do you execute a parameterized query with sqlite3, and why should user input not be inserted into SQL with an f-string?
- What is a transaction? Explain commit and rollback.
- How does an ORM map a Python class to a table? Explain DeclarativeBase, Mapped, and
mapped_columnin SQLAlchemy. - What are Engine and Session needed for? How do you save an object and read it with select?
Topic 13. NumPy, pandas, Matplotlib
- How does a NumPy array differ from a Python list? What do shape and dtype mean?
- What is vectorized computation? How do you perform element-wise operations on arrays?
- How do you find the minimum, maximum, mean, and standard deviation of data?
- What are Series and DataFrame? How do you load a CSV file and select rows by a condition?
- How do you detect missing values and group data with pandas?
- When are a line chart, a scatter plot, and a bar chart appropriate?
- How do you create a Figure and Axes in Matplotlib, label the axes, add a legend, and save a chart?
Topic 14. GUI applications with PySide6
- What are the PySide6 library and the Qt framework? Describe the structure of the simplest application (QApplication, the main window, the event loop).
- What are the main PySide6 widgets you know? Explain their common properties.
- Explain the PySide6 layout managers: QVBoxLayout, QHBoxLayout, QGridLayout, and QFormLayout.
- What are signals and slots? How do you connect a widget's signal to a handler?
- How do you create a QMainWindow main window with a menu, a toolbar, and a status bar?
- How do you design an interface in Qt Designer and load .ui files into an application?
Topic 15. Model/View and databases
- Describe the Model/View architecture in Qt: models, views, and delegates.
- How do you display tabular data in a QTableView with a custom QAbstractTableModel? How does it differ from QAbstractListModel?
- How do you use standard dialogs (QMessageBox, QFileDialog) and create custom dialogs (QDialog)?
- How do you work with a database in a PySide6 application through the QtSql module or an SQLAlchemy layer?
- How do you apply QSortFilterProxyModel for sorting and filtering? Why must a proxy index be mapped before modifying the source model?
- How do you validate user input in PySide6 forms?
Topic 16. Packaging and typing
- How do you describe a Python project in the pyproject.toml file? Explain dependencies and entry points.
- How do you build a wheel and verify its installation in a clean environment? How does local delivery differ from publishing to a registry?
- How do you create an executable file for a PySide6 application with PyInstaller?
- What are generic types in Python? Explain the syntax of type parameters for classes and functions, and type aliases (type).
- What is static code analysis? How do you check types with mypy?
- What are the Ruff linter and formatter and the PEP 8 code style standard used for?