← Back to videos

Public mock interview with Vasily for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Needs more practice Level: Pre-Junior (fundamentals need structuring)

The candidate did not pass yet: despite willingness to reason aloud and decent intuition on parts of the generator code snippet, significant gaps surfaced in core theory (for vs while, lists vs arrays, the iterator protocol, lazy evaluation) alongside hesitation on basic dictionary operations.

Candidate: Vasily
Target role: Junior Python Backend

Yandex Practicum Python graduate, took extra courses in SQL, databases & Docker · job hunting for ~6 months, no commercial experience

Answers accuracy 15 total
47% score
Theory
0/9 correct · 33%
Live coding
4/6 correct · 67%
Practical task
Partially solved

Dict keys, implicit string concatenation, and generator exhaustion

The candidate mispredicted a syntax error on implicit string literal concatenation in a dict key ('a' '333'). In the second part, he spotted the generator expression, predicted the 'in' membership check, and deduced why a subsequent list() call only returned remaining elements, but contradicted himself by claiming generators store all values in memory upfront and delete them during iteration.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Thinks aloud transparently and stays engaged when facing unfamiliar code
  • + Correctly identified a generator expression and why partial iteration via 'in' consumes elements
  • + Handles challenging follow-ups and constructive feedback calmly
  • + Knows dictionary key requirements (immutability and __hash__)

Areas to improve

  • → Systematize core Python theory end-to-end: for vs while loops, classes/objects, and multiparadigm concepts
  • → Master the iteration protocol (__iter__ vs __next__) and how generators compute values lazily on the fly
  • → Drill dozens of easy exercises on dicts, lists, and sets until basic syntax and lookups become automatic
  • → Reduce long pauses on fundamental questions and use precise technical terminology

Questions in this interview

15 / 15
01 ▶ 03:25
What loops exist in Python, how do for and while differ, and when should you choose each?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Named for and while, noting for traverses a list while while stops on a condition, but concluded there is no conceptual difference between them.

Key takeaway

Use 'for' to iterate over iterables via the iterator protocol, and 'while' for condition-driven loops where the iteration count is not known upfront.

Open moment on YouTube ↗
#01
02 ▶ 07:15
What is iteration and what does iterating over an object mean in plain terms?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Gave a circular explanation ('stepping through an iterable object in a for loop') and limited the example to printing list elements.

Key takeaway

Iteration is sequential element-by-element traversal of a data source, standardized in Python via the __iter__ and __next__ protocol.

Open moment on YouTube ↗
#02
03 ▶ 09:30
Does Python have arrays, and how does a list differ from an array?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Claimed that list and array are exact synonyms in Python with no technical differences.

Key takeaway

A typed array (like array.array) stores homogeneous values compactly in contiguous memory, whereas list is a dynamic array of pointers to arbitrary objects.

Open moment on YouTube ↗
#03
04 ▶ 10:09
What are objects and classes in Python, and how can classes both create objects and be objects themselves?
Theory OOP, classes & dunder methods
?
Candidate's answer

Correctly noted that everything in Python is an object including classes, mentioning base class object and metaclasses, but got tangled explaining how they fit together.

Key takeaway

Every class in Python is itself an object instantiated by the metaclass 'type'; 'type' subclasses 'object', while 'object' is an instance of 'type'.

Open moment on YouTube ↗
#04
05 ▶ 15:28
What is OOP, what other programming paradigms exist, and which paradigm does Python use?
Theory OOP, classes & dunder methods
?
Candidate's answer

Named the four OOP pillars and functional style, then backtracked under questioning to claim Python is purely OOP because functions are objects too.

Key takeaway

Having an object-based runtime model does not restrict Python to OOP: it is a multiparadigm language supporting imperative, OOP, and functional styles.

Open moment on YouTube ↗
#05
06 ▶ 17:55
What built-in iterable types exist in Python besides lists?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Named lists, tuples, dicts, and sets, forgetting strings, range, bytes, and file objects.

Key takeaway

Built-in iterables include sequences (str, list, tuple, range, bytes), collections (dict, set, frozenset), generators, and file streams.

Open moment on YouTube ↗
#06
07 ▶ 18:59
How do you make a custom object iterable, and how does an iterator differ from an iterable?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Recalled __iter__ and __next__, but swapped their roles, claiming an iterator only defines __iter__ while an iterable defines both.

Key takeaway

An iterable implements __iter__() returning an iterator; an iterator implements both __iter__() (returning self) and __next__() (raising StopIteration when exhausted).

Open moment on YouTube ↗
#07
08 ▶ 20:32
How does a generator differ from an iterator and a list in terms of yielding values and memory?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Correctly noted yield and memory savings for generators, but mistakenly claimed regular iterators load and output all elements at once.

Key takeaway

Every generator is an iterator: both produce items lazily one at a time via next(), while generators avoid writing boilerplate __iter__/__next__ classes.

Open moment on YouTube ↗
#08
09 ▶ 23:00
In what practical scenario should a developer choose a generator?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Invented an example of uploading 200 MB photo folders to a 1 GB cloud drive, confusing process RAM usage with cloud storage quota.

Key takeaway

Generators shine in streaming pipelines—reading multi-gigabyte log files, paginated DB rows, or infinite streams—keeping RAM usage O(1) per item.

Open moment on YouTube ↗
#09
10 ▶ 27:30
Will creating a dictionary work if a key is written as two adjacent string literals ('a' '333') without '+'?
Live coding Strings, encodings & formatting
?
Candidate's answer

Spotted duplicate key overwriting, but predicted that adjacent string literals 'a' '333' without '+' would raise an error.

Key takeaway

Python implicitly concatenates adjacent string literals at compile time ('a' '333' becomes 'a333'), useful for long strings but a classic gotcha when a comma is missed.

Open moment on YouTube ↗
#10
11 ▶ 29:11
What objects can be used as dictionary keys in Python?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Stated that any immutable hashable object implementing __hash__—including strings—can serve as a dictionary key.

Key takeaway

Dict keys must be hashable (stable __hash__ and __eq__); tuples qualify only if every contained element is also hashable.

Open moment on YouTube ↗
#11
12 ▶ 33:34
What does print(result) output when result is defined with parentheses as (item for item in range(800))?
Live coding Decorators, iterators, generators & context managers
?
Candidate's answer

Initially considered number output, then noticed the parentheses of a generator expression and accurately predicted <generator object ...>.

Key takeaway

Parentheses around a comprehension create a lazy generator object rather than computing a tuple or printing elements immediately.

Open moment on YouTube ↗
#12
13 ▶ 37:30
What does checking membership via 'in' on a generator (777 in result) return?
Live coding Decorators, iterators, generators & context managers
?
Candidate's answer

Briefly hesitated on dict key lookup, then accurately explained that 'in' iterates over the generator until finding 777 and returns True.

Key takeaway

For general iterators and generators, the 'in' operator consumes items sequentially via next() and short-circuits as soon as a match is found.

Open moment on YouTube ↗
#13
14 ▶ 40:57
How do you materialize all generator items, and why did list(result) miss earlier values after '777 in result'?
Live coding Decorators, iterators, generators & context managers
?
Candidate's answer

Suggested list(result) and, upon seeing only trailing numbers, immediately realized '777 in result' had already consumed items up through 777.

Key takeaway

Generators are single-pass iterators: 'x in gen' advances internal state up to the match, so subsequent iteration resumes from the next unyielded item.

Open moment on YouTube ↗
#14
15 ▶ 45:16
Are all values stored inside a generator prior to iteration, and why can't consumed items be read again?
Live coding Decorators, iterators, generators & context managers
?
Candidate's answer

Contradicted himself by claiming all 800 values were stored inside the generator upfront and deleted one by one, supposedly making it shrink and run faster than a list.

Key takeaway

A generator never stores the sequence in memory—it only retains its suspended execution frame and computes each next value on demand.

Open moment on YouTube ↗
#15
Original video description & timecodes

We discuss basic topics and typical traps in interviews: for and while loops, what iteration and iterable objects are, the difference between an iterator and a generator, nuances of dictionaries and keys, working with generator expressions. In the second part — code analysis and detailed feedback: where juniors often make mistakes, how to answer without "filler", why you need to improve theory and "get your hands dirty" on tasks.

Useful for those preparing for Python interviews: you'll understand the logic of questions, evaluation criteria and get practical advice on improving answers and code.

Support the video with a like and subscribe. Write in the comments which topics to analyze next and what tricky questions you encountered in interviews.

Timestamps

00:00 Greeting and interview plan
00:32 Introduction of participants
03:25 Theoretical questions
27:26 Working with code
48:15 Feedback exchange

Hashtags:
#Python #JuniorPython #Interview #Iterators #Generators #PythonBasics #InterviewPreparation