Member-only story

Data Engineering Interview Questions: Python, SOLID, and Code Quality II

Zaid Alissa Almaliki
9 min readJan 25, 2025

--

Python often triggers debate among developers who come from backgrounds in C++, Java, or other languages with heavier syntaxes. One main reason is that Python offers a range of features that streamline tasks such as handling infinite sequences, generating data on the fly, and wrapping functions with extra logic, all without killing you in complexities. It feels like a language designed to make life simpler. This feeling of simplicity is due to Python’s built-in capabilities for iterators, generators, and decorators. Another key factor is how Python manages memory behind the scenes, allowing developers to focus on building applications rather than micro-managing object lifecycles.

Iterators

An iterator is an object representing a stream of data and stands out as one of Python’s foundational concepts. An iterator is an object that returns elements one at a time, typically through repeated calls to its __next__() method. You can think of it like a pipeline delivering data elements in a steady flow, rather than handling everything at once. If you decide to create an iterator manually, you usually define two special methods: __iter__() and __next__(). The first method __iter__()signals to Python that the object is indeed an iterator or can produce one. The second __next__()yields the next item…

--

--

Zaid Alissa Almaliki
Zaid Alissa Almaliki

Written by Zaid Alissa Almaliki

Data Engineer, LinkedIn and Twitter Top Voice. Contributing to leading platforms like Towards Data Science.

No responses yet