← Back to videos

Mock interview with Dmitry for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Passed with caveats Level: Borderline Junior (needs follow-up coding task)

A borderline-positive result: despite shaky theoretical phrasing and specific gaps (such as if __name__ == '__main__'), the candidate stayed engaged, asked clarifying questions, reflected on hints, and reasoned his way to solid code improvements. In a real hiring loop, the interviewer would advance him with an additional hands-on coding assignment.

Candidate: Dmitry
Target role: Junior Python Developer

Programming since 2021 (Yandex Practicum) · brief startup experience, currently building an internal HR management product at a French company

Answers accuracy 14 total
64% score
Theory
3/9 correct · 67%
Live coding
2/5 correct · 60%
Practical task
Partially solved

Code review, refactoring, and error handling in a division script

The candidate spotted and fixed PEP 8 style defects (snake_case naming, 4-space indentation, semicolons, redundant local variables), distinguished / from //, and proposed both EAFP (try/except) and LBYL (if y == 0) handling for ZeroDivisionError. However, he needed guidance to separate pure return logic from print side effects and could not explain if __name__ == '__main__'.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Ability to reason aloud, revise initial hypotheses, and converge on working code fixes
  • + Good eye for PEP 8 style and readability issues during code review (snake_case, indentation, dead variables)
  • + Honest acknowledgment of knowledge gaps instead of bluffing
  • + Constructive mindset and composure when challenged with tricky follow-ups

Areas to improve

  • → Master Python module execution semantics and the purpose of if __name__ == '__main__'
  • → Internalize pure functions, side-effect isolation, and separating computation from I/O
  • → Solidify Python data model fundamentals: hashability of immutable types, classes, and functions as objects
  • → Sharpen technical terminology (distinguishing variable names, references, and objects in memory)

Questions in this interview

14 / 14
01 ▶ 03:49
What built-in data types exist in Python and how are they grouped by mutability?
Theory Data types, numbers & memory
?
Candidate's answer

Correctly grouped built-in types into immutable (int, str, float, bool, NoneType, tuple, frozenset) and mutable (list, dict, set).

Key takeaway

Scalar types, strings, tuples, and frozenset are immutable in Python, whereas lists, dicts, and sets can be mutated in place.

Open moment on YouTube ↗
#01
02 ▶ 05:02
What does immutability mean in practice: can you change the value of a variable holding an int?
Theory Data types, numbers & memory
?
Candidate's answer

Explained that reassigning produces a different id(), though phrased it imprecisely as creating a 'new variable with a new identifier'.

Key takeaway

Variables in Python are names bound to objects; immutability prevents mutating the object in memory, while rebinding simply points the name to a new object.

Open moment on YouTube ↗
#02
03 ▶ 07:14
Why does Python need immutable data types at all instead of making everything mutable?
Theory Data types, numbers & memory
?
Candidate's answer

Mentioned preventing accidental modification and memory allocation differences, missing hashability and safe sharing across code.

Key takeaway

Immutability prevents unexpected aliasing side effects, enables memory optimizations, and provides stable hashes required for dict keys and set members.

Open moment on YouTube ↗
#03
04 ▶ 12:00
How do you choose between mutable and immutable data structures when both can solve a problem?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Pointed to data volume and differences in lookup/processing speed, without citing concrete memory or Big-O trade-offs.

Key takeaway

For fixed sequences, tuple uses less memory and allocates faster than list; for O(1) membership checks, set/frozenset or dict is preferred.

Open moment on YouTube ↗
#04
05 ▶ 14:01
What is an object in Python?
Theory OOP, classes & dunder methods
?
Candidate's answer

Noted that everything in Python is an object occupying memory with its own id(), while still conflating the variable name with the object.

Key takeaway

Every CPython object is a memory structure holding a type pointer, reference count, and value, referenced by one or more names.

Open moment on YouTube ↗
#05
06 ▶ 15:00
How can you create a custom constrained data type (e.g., an integer from 0 to 10), and where do objects come from?
Theory OOP, classes & dunder methods
?
Candidate's answer

Proposed defining a custom class and explained that every object is instantiated from either a built-in or user-defined class.

Key takeaway

Classes define custom types in Python, letting you enforce invariants (in __init__ or __new__) and attach domain-specific behavior.

Open moment on YouTube ↗
#06
07 ▶ 16:41
What else are classes used for, and does calling str(value) on an integer mutate the original object?
Theory OOP, classes & dunder methods
?
Candidate's answer

Accurately explained that str(value) creates a new str instance without mutating the int, and mentioned dunder methods, but struggled to give a concrete class example.

Key takeaway

Classes bundle state and behavior (methods and dunder protocols), while type constructors like str() instantiate new objects rather than mutating existing ones.

Open moment on YouTube ↗
#07
08 ▶ 20:19
Can you write Python programs without custom classes at all, and when should you choose classes over functions?
Theory OOP, classes & dunder methods
?
Candidate's answer

Said programs can be written purely with functions, while classes become worthwhile when structuring code around stateful entities and their operations.

Key takeaway

Stateless data transformations are cleaner as plain functions; classes shine when multiple operations share and manage persistent state.

Open moment on YouTube ↗
#08
09 ▶ 22:30
Is a function itself an object in Python, and what class is it an instance of?
Theory Functions, scopes & closures
?
Candidate's answer

Confirmed that a function is an object that returns an object and likely an instance of some class, without knowing the class name.

Key takeaway

Functions are first-class objects in Python (instances of class 'function' / types.FunctionType) that can be stored, passed, and returned like any value.

Open moment on YouTube ↗
#09
10 ▶ 25:18
Does the two-number division script work as intended, and how do the / and // operators differ?
Live coding Data types, numbers & memory
?
Candidate's answer

Initially misread 10 / 5 as 5 and hesitated over //, then reasoned that / performs true float division whereas // truncates the fractional part.

Key takeaway

In Python 3, / always performs true division returning a float, while // performs floor division rounding toward negative infinity.

Open moment on YouTube ↗
#10
11 ▶ 31:31
What PEP 8 naming, formatting, and style issues exist in the given script?
Live coding Algorithms, code reading & engineering practices
?
Candidate's answer

Renamed GetC to snake_case get_c, removed the semicolon, fixed indentation to 4 spaces, added two blank lines around top-level definitions, and ensured a trailing newline.

Key takeaway

PEP 8 mandates snake_case for functions/variables, 4-space indentation, two blank lines around top-level functions, a newline at EOF, and one statement per line.

Open moment on YouTube ↗
#11
12 ▶ 34:10
Why does print(get_c(a, b)) output None, and how should the division function be refactored to remove side effects?
Live coding Functions, scopes & closures
?
Candidate's answer

Correctly explained missing return yields None and mentioned side effects, then refactored to a pure return x / y after the interviewer explained pure functions.

Key takeaway

Computation functions should return values rather than printing directly; keeping functions pure makes them reusable, composable, and easy to test.

Open moment on YouTube ↗
#12
13 ▶ 43:40
What is the purpose of the if __name__ == '__main__': guard at the bottom of a module?
Live coding Modules, packages, imports & stdlib
?
Candidate's answer

Honestly admitted reading about it multiple times without grasping why it is needed beyond calling functions sequentially.

Key takeaway

When a file runs directly, __name__ is '__main__'; when imported, __name__ equals the module's name, preventing entry-point code from running on import.

Open moment on YouTube ↗
#13
14 ▶ 49:36
What happens when 0 is passed as the divisor, and what two approaches can handle division by zero?
Live coding Exceptions & debugging
?
Candidate's answer

Identified ZeroDivisionError, proposed catching it with try/except, and upon follow-up also suggested pre-checking if y == 0.

Key takeaway

Python supports both EAFP (catching ZeroDivisionError in try/except) and LBYL (checking if divisor == 0 beforehand).

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

In this video you will see a live mock interview with beginning developer Dmitry who is interviewing for a Junior Python developer position.

During the interview Dmitry doesn't always give the right answers right away — he gets confused in some places, forgets details. But at the same time he doesn't get lost, thinks, asks clarifying questions and tries to understand to the end. This is exactly the case where not perfect knowledge, but attitude and potential play a key role.

The interview came out "on the edge" — there are doubts, but there is also something to hold onto. In such cases, I, as an interviewer, usually give an additional task to see how the candidate handles it without pressure and with the opportunity to think.

If you're at the stage of preparing for your first (or not first) interview, this video will help you understand:
✅ what typical mistakes juniors make
✅ how important it is not to give up and stay in the process
✅ what can influence the interviewer's decision besides correct answers

⸻

👍 Support Dmitry in the comments if this approach resonated with you.
📩 And if you want to participate in a similar interview — write to me!

#python #juniordeveloper #interview #development #itinterview #pathtoIT

Timestamps:

00:00 Introduction
00:30 A few words about the interviewer and candidate
03:50 Questions
24:47 Working with code
58:58 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. However, maintaining quality requires significant time and resources. If you like my content and want to support the channel, I'll be grateful for any financial support.

https://www.tbank.ru/cf/4PYyn4udS41

#MockInterview #Interview #Python #Backend #Programming