← Back to videos

Mock interview with Pavel for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Passed interview Level: Solid Junior

The candidate passed solidly: showed strong foundational understanding above an average Junior candidate, self-corrected effectively when challenged on edge cases, and debugged the practical dictionary lookup & None/False logic problem to a clean working solution.

Candidate: Pavel
Target role: Junior Python Developer

36 y/o · meteorology academic background (~10 years of research & teaching C++/Python), online Python tutor, completed Backend Python and Frontend tracks at Yandex Practicum

Answers accuracy 13 total
85% score
Theory
7/10 correct · 85%
Live coding
2/3 correct · 83%
Practical task
Solved

Debugging dictionary key states: dict.get(), falsy values, and 'is None'

After initially approving the snippet on True/False inputs, testing missing keys and None revealed two bugs: dict.get(key, False) conflated missing keys with False, and 'elif not val' swallowed None, leaving the else branch unreachable. The candidate fixed both issues using an O(1) 'if key in data:' check and explicit 'is None' identity comparison across all four cases.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Solid grasp of loops, the iterator protocol (__iter__ / __next__, StopIteration), and decorators
  • + Ability to catch contradictions in his own reasoning and self-correct mid-discussion
  • + Methodical debugging of edge cases in code (missing dict keys, None vs False truthiness, 'is None')
  • + Clear communication backed by strong analytical and teaching experience

Areas to improve

  • → Keep answers focused on the exact question asked without volunteering tangential topics like metaclasses
  • → Move beyond memorized definitions toward crisp practical comparisons (e.g., iterators vs generators)
  • → Review default dunder methods inherited from object and built-in introspection helpers (dir(), inspect)

Questions in this interview

13 / 13
01 ▶ 08:09
What loop constructs exist in Python and how does 'for' differ from 'while'?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Named for and while, explaining while handles open-ended condition loops whereas for repeatedly calls next() on an iterator until StopIteration.

Key takeaway

Python's for-loop drives the iterator protocol automatically until StopIteration, while a while-loop repeats as long as a boolean condition holds.

Open moment on YouTube ↗
#01
02 ▶ 10:17
What is an iteration and what is an iterator in Python?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Defined an iteration as a single execution pass of a loop body and an iterator as a stateful object implementing __iter__ and __next__ to yield items one by one.

Key takeaway

An iterable implements __iter__() to produce an iterator, while an iterator tracks traversal state and produces elements via __next__().

Open moment on YouTube ↗
#02
03 ▶ 11:38
What are classes and objects in Python, and why use them if programs can be written with functions?
Theory OOP, classes & dunder methods
?
Candidate's answer

Described a class as a blueprint defining attributes and methods and an object as its instance, framing classes vs functions as tools chosen based on problem complexity.

Key takeaway

Classes model stateful domain entities cleanly, whereas plain functions suffice for stateless transformations.

Open moment on YouTube ↗
#03
04 ▶ 13:20
Can you iterate over any object in Python, and how do you make instances of a custom class iterable?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Explained scalars (int, float, bool, None) are not iterable unlike collections, and making a custom class iterable requires implementing __iter__.

Key takeaway

An object is iterable in Python if its class implements __iter__() returning an iterator (or legacy 0-based __getitem__()).

Open moment on YouTube ↗
#04
05 ▶ 16:54
What are magic (dunder) methods, how do they differ from regular methods, and how can you inspect a class's default methods?
Theory OOP, classes & dunder methods
?
Candidate's answer

Named __new__, __init__, __hash__, __iter__, __next__ and explained overriding them customizes built-in behavior, but detoured into metaclasses and missed dir() / object inheritance.

Key takeaway

Dunder methods hook into built-in syntax and protocols; defaults come from inheriting 'object' and can be inspected via dir(obj).

Open moment on YouTube ↗
#05
06 ▶ 21:07
What is a generator and how does it differ from a regular class-based iterator?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Correctly identified a generator as a lazy iterator built with 'yield' or '(...)' expressions to save memory, briefly contradicting himself under questioning before recovering.

Key takeaway

Every generator is an iterator that suspends execution state at 'yield', providing lazy O(1)-memory evaluation without boilerplate iterator classes.

Open moment on YouTube ↗
#06
07 ▶ 28:34
How do you decide whether a task can use a generator instead of materializing a list in memory?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Explained that generators yield values once and discard them, making them ideal for single-pass aggregations like sum() when random access or repeated passes aren't needed.

Key takeaway

Generators are single-pass and lack indexing or len(); choose them for streaming pipelines and materialize a list/tuple when multiple passes or indexing are required.

Open moment on YouTube ↗
#07
08 ▶ 31:11
What is a decorator in Python and how does the @decorator syntax work?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Clearly explained that a decorator takes a function, wraps it with extra behavior without modifying its body, and is applied via the '@' syntactic sugar.

Key takeaway

@decorator above def func() is syntactic sugar for func = decorator(func), wrapping or transforming callables cleanly.

Open moment on YouTube ↗
#08
09 ▶ 32:38
Can decorators be applied to classes as well as functions?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Corrected himself and cited @dataclass as a standard class decorator, though he was unsure about the exact mechanics of class modification.

Key takeaway

Class decorators receive the class object itself and return a modified class (like @dataclass generating __init__/__eq__ from type annotations) or a wrapper.

Open moment on YouTube ↗
#09
10 ▶ 34:52
Why use decorators conceptually instead of editing the function directly or creating a second function?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Explained DRY and maintainability: cross-cutting behavior can wrap many functions at once and be updated in a single decorator definition.

Key takeaway

Decorators separate cross-cutting concerns (logging, caching, auth, retries, timing) from core business logic without code duplication.

Open moment on YouTube ↗
#10
11 ▶ 37:13
Why does checking dictionary states via 'val = data.get(key, False)' and 'if val / elif not val / else' have hidden logic bugs?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Initially approved the code after testing True and False, then uncovered both bugs on missing keys and None: get(key, False) masks missing keys, and 'not None' is True, making 'else' dead code.

Key takeaway

Both False and None are falsy in Python (not None evaluates to True), so three-state boolean logic and missing-key detection cannot rely on truthiness or a False default.

Open moment on YouTube ↗
#11
12 ▶ 48:29
Why should None checks use 'is None' rather than '== None'?
Live coding Data types, numbers & memory
?
Candidate's answer

Explained that None is a singleton in memory and 'is' checks object identity directly, whereas '==' invokes value equality.

Key takeaway

None is a singleton; 'x is None' performs a fast pointer comparison and avoids custom __eq__ overrides that could misbehave with '=='.

Open moment on YouTube ↗
#12
13 ▶ 50:24
How should the dictionary lookup be rewritten to distinguish missing keys from True, False, and None?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Added an O(1) 'if key in data:' check upfront and branched explicitly on True, 'val is None', and False, verifying all four cases.

Key takeaway

'key in dict' runs in average O(1) time via hash lookup, cleanly separating missing keys from stored None/False values (alternatively, pass a unique sentinel object to dict.get).

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

Pavel is taking a mock interview for a Junior Python developer position — check it out! 🎥

In this video — a mock interview with Pavel, a Yandex Practicum student who is seriously interested in backend development. He chose Python for its simplicity and readability, loves optimizing database queries and understands deeply how applications work.

Pavel confidently answers questions, shows how he thinks, solves problems — and when he makes a mistake, it becomes a great opportunity for analysis. The mock interview turned out to be alive, honest and useful.

Watch, comment, support Pavel with a like — and if you want to try yourself in a similar interview, write to me!

Timestamps:

00:00 Introduction
00:30 A few words about the interviewer and candidate
08:10 Questions
37:07 Working with code
58:46 Feedback exchange

On this channel I conduct mock interviews for the role of Python developer for anyone interested. This is a great opportunity to prepare for a real interview, improve your skills, get useful tips and honest feedback. I do all of this absolutely for free.

#MockInterview #Interview #Python #Backend #Programming