← Back to videos

Mock interview with Dastan for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Needs more practice Level: Pre-Junior (gaps in language fundamentals)

The candidate did not pass yet: despite decent familiarity with higher-level topics (OOP pillars, multiple-inheritance MRO, namespaces and scopes), major gaps in basic Python operators held him back. Not knowing unary + and - directly prevented him from explaining a simple snippet involving two variables and chained + / - signs.

Candidate: Dastan
Target role: Junior Python Developer

20 y/o · studying Python in depth on his own for 6+ months, first technical interview

Answers accuracy 14 total
43% score
Theory
4/10 correct · 60%
Live coding
0/4 correct · 0%
Practical task
Not solved

Chained unary and binary + / - operators with _ and __ variables

Given _ = 1, __ = +_, and chained signs like _ + + + - - + __, the candidate initially guessed 2 for the wrong reason (assuming only the last sign matters). When sign changes produced 0, he cycled through flawed theories (sequentially adding 1 or mutating a shared int object) and even with direct hints about operand counts could not identify unary + and -.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Good composure under interview pressure, continuing to reason through unfamiliar cases without giving up
  • + Solid grasp of polymorphism, multiple-inheritance method lookup order, and namespaces/scopes
  • + Honest self-assessment and constructive attitude toward feedback

Areas to improve

  • → Revisit core Python fundamentals: operator categories, arity (unary, binary, ternary), and dunder implementations (__pos__, __neg__, __add__, __sub__)
  • → Sharpen technical terminology (distinguish operators from reserved control-flow keywords like for, while, try)
  • → Justify sudden shifts in hypotheses aloud and build confidence through hands-on REPL experimentation
  • → Answer the exact question asked without volunteering extra terms that invite deeper probing into weak spots

Questions in this interview

14 / 14
01 ▶ 03:20
What is an operator in Python, and what examples of operators can you give?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Conflated operators with control-flow statements, naming reserved keywords like for, while, try, and else as operators instead of actual expression operators.

Key takeaway

Distinguish control-flow statements (for, while, try, def) from expression operators (+, -, *, ==, is, in, and, not) that compute values from operands.

Open moment on YouTube ↗
#01
02 ▶ 04:45
Is Python interpreted or compiled, and do compiled implementations of Python exist?
Theory Python internals, bytecode & runtime
?
Candidate's answer

Correctly separated the language from script execution and mentioned CPython, Jython, and partial compilation, but did not know any JIT or ahead-of-time compiled Python implementations.

Key takeaway

CPython compiles source code to bytecode before interpreting it, while PyPy uses a tracing JIT compiler and tools like Nuitka/Cython compile Python to native code.

Open moment on YouTube ↗
#02
03 ▶ 11:35
What are unary, binary, and ternary operators in Python?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Admitted he hadn't heard of unary or binary operators (associating 'binary' with binary numbers) and could not recall the syntax of Python's ternary expression.

Key takeaway

Unary operators take one operand (-x, +x, ~x, not x), binary take two (a + b, a < b, x in y), and Python's ternary expression is a if condition else b.

Open moment on YouTube ↗
#03
04 ▶ 14:06
By analogy with math, what arithmetic operators exist in Python, and are operators limited to arithmetic?
Theory Data types, numbers & memory
?
Candidate's answer

Through the math analogy named +, -, *, division, and modulo and noted they apply to non-numeric types too, though he didn't list logical, comparison, identity, or bitwise operators.

Key takeaway

Beyond arithmetic (+, -, *, /, //, %, **), Python provides comparison, logical (and, or, not), bitwise (&, |, ^, ~, <<, >>), identity (is), and membership (in) operators.

Open moment on YouTube ↗
#04
05 ▶ 16:34
What happens under the hood of + for integers vs strings, and is that logic defined on each object or on the class?
Theory OOP, classes & dunder methods
?
Candidate's answer

Explained that + is syntactic sugar invoking an addition method, initially saying the logic lives on each object before correcting after follow-up questions to the class definition (int, str).

Key takeaway

a + b dispatches to type(a).__add__(a, b) (falling back to type(b).__radd__(b, a) on NotImplemented); dunder methods are defined on the class, not duplicated per instance.

Open moment on YouTube ↗
#05
06 ▶ 20:41
What OOP principle allows the same method or operator to behave differently across different types?
Theory OOP, classes & dunder methods
?
Candidate's answer

Correctly identified polymorphism and explained that a single method or operator interface executes type-specific behavior depending on the operand types.

Key takeaway

Python polymorphism relies on duck typing and dunder-method protocols rather than requiring shared inheritance hierarchies.

Open moment on YouTube ↗
#06
07 ▶ 23:04
What other core OOP principles exist besides polymorphism, and what do they mean?
Theory OOP, classes & dunder methods
?
Candidate's answer

Named inheritance (reusing parent attributes and methods in child classes) and encapsulation (protecting internal state and exposing controlled access via getters/setters).

Key takeaway

Python implements encapsulation via naming conventions (_protected and __private name mangling) and @property descriptors rather than strict private access modifiers.

Open moment on YouTube ↗
#07
08 ▶ 24:00
Why use class inheritance in practice, and what is the real danger of duplicating code?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Cited avoiding repetition, readability, and flexibility, but argued duplicated classes hurt RAM usage and execution speed rather than highlighting maintenance burden and inconsistent bug fixes.

Key takeaway

The primary cost of violating DRY is maintainability, not RAM: duplicated logic forces parallel edits across copies and breeds subtle bugs when one copy is missed.

Open moment on YouTube ↗
#08
09 ▶ 29:19
How does multiple inheritance work in Python if three parent classes all implement the same method?
Theory OOP, classes & dunder methods
?
Candidate's answer

First checked whether the child class overrides the method itself, then accurately explained that Python resolves it starting from the first listed base class and its hierarchy.

Key takeaway

Python computes Method Resolution Order (MRO) via C3 linearization, inspectable through ClassName.__mro__ or ClassName.mro().

Open moment on YouTube ↗
#09
10 ▶ 31:08
What are a namespace and a scope in Python?
Theory Functions, scopes & closures
?
Candidate's answer

Defined a namespace as where names are stored (local, global, built-in) and scope as the lookup rule searching local first before moving to outer levels.

Key takeaway

Name resolution in Python follows the LEGB rule: Local -> Enclosing -> Global -> Built-in.

Open moment on YouTube ↗
#10
11 ▶ 34:39
Are _ and __ valid variables, and what does a chained sign expression like _ + + + - - + __ print when _ = 1 and __ = +_?
Live coding Data types, numbers & memory
?
Candidate's answer

Initially doubted whether _ can be read as a variable, then guessed 2 for the wrong reason — claiming all signs before the final + are ignored.

Key takeaway

In a + + - - + b, the first sign is binary addition and all subsequent signs are nested unary + (__pos__) and - (__neg__) operators, where each minus flips the sign of b.

Open moment on YouTube ↗
#11
12 ▶ 39:18
Why does changing a single + to - in the operator chain change the output from 2 to 0?
Live coding Data types, numbers & memory
?
Candidate's answer

Predicted the result would stay unchanged or equal 3 by adding/subtracting 1 per sign, unable to explain why the output became 0.

Key takeaway

An even number of minus signs between 1 and 1 evaluates to 1 + 1 == 2, whereas an odd number of minus signs evaluates to 1 + (-1) == 0; unary pluses are no-ops on ints.

Open moment on YouTube ↗
#12
13 ▶ 43:10
Can any chain of + and - signs between _ and __ (both equal to 1) produce -1, or mutate the shared int object 1?
Live coding Data types, numbers & memory
?
Candidate's answer

Guessed -1 and hypothesized that because _ and __ reference the same object 1, the object gets mutated mid-expression.

Key takeaway

Integers (int) are immutable in Python: unary and binary operations return new int objects without mutating operands, so 1 ± 1 can only ever produce 2 or 0.

Open moment on YouTube ↗
#13
14 ▶ 46:00
Do the + and - operators in Python always require two operands?
Live coding Data types, numbers & memory
?
Candidate's answer

Insisted that + and - syntax always requires two operands (receiver and argument to __add__), overlooking unary +x and -x.

Key takeaway

Python overloads + and - as both binary operators (__add__, __sub__) and unary prefix operators (__pos__, __neg__) taking a single operand.

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

We discuss basic language elements and typical difficulties of beginning developers. We analyze Python operators, differences between unary, binary and ternary constructs, OOP principles, scope and features of interpreter code execution.

Special attention is paid to a small task on + and - operators: I'll show how lack of theoretical foundation leads to difficulties even in simple examples. At the end — detailed feedback on strengths, gaps and directions for development.

The material will be useful for those preparing for technical interviews for entry-level positions and wants to strengthen the fundamental knowledge of Python.

Timestamps:

00:00 Greeting and interview plan
00:31 Introduction of participants
03:23 Theoretical questions
34:00 Working with code
50:21 Feedback exchange

#python #junior #interview #programming #pythondeveloper