← Back to videos

Mock interview with Bogdan for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Passed with caveats Level: Junior- (unstructured fundamentals, good analytical reasoning)

Borderline conditional pass ('more yes than no', though in real hiring the interviewer would require a follow-up coding assignment or team interview). Early on the candidate tangled basic definitions (calling operators objects and functions) and overcomplicated explanations, but turned things around in live coding by deducing Python's short-circuit or semantics from runtime experiments.

Candidate: Bogdan
Target role: Junior Python Developer

25 y/o · ~1 year actively learning Python as a career switcher without a formal CS degree, first technical interview

Answers accuracy 13 total
65% score
Theory
4/7 correct · 71%
Live coding
1/6 correct · 58%
Practical task
Partially solved

Logical operator or: operand return values, short-circuit evaluation, and refactoring

Initially assuming or always returns a boolean, the candidate analyzed live runs with ints and strings to accurately formulate both operand return values and short-circuit skipping of the right-hand function call. During refactoring he renamed f to get_string and removed the side-effect print, but needed direct prompting to inline the single-use result variable.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Ability to learn and revise hypotheses live during code experiments (deduced Python's short-circuit or behavior)
  • + Calm recovery from mistakes and contradictions without panicking or shutting down
  • + Awareness of practical Python details: __new__ vs __init__, iterator dunders (__iter__ / __next__), and function __name__
  • + Constructive self-reflection and openness to detailed feedback

Areas to improve

  • → Systematize core terminology through structured books (operator vs expression vs statement vs function vs object)
  • → Practice concise explanations without tangential examples that introduce new traps
  • → Learn clear decision criteria for language tools (e.g., ternary expressions for 2-way value selection vs multi-branch if statements)
  • → Spot code-review simplifications like eliminating single-use variables and enforcing PEP 8 spacing without relying solely on IDE autoformatters

Questions in this interview

13 / 13
01 ▶ 04:17
What is an operator in Python, and is an operator itself an object or a function?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Gave valid examples (+, -, //, %, ==, is, ternary conditional), but got tangled in definitions, calling an operator first an object and then a function.

Key takeaway

An operator in Python is a syntactic token rather than a first-class object; use the standard operator module (e.g., operator.add) when you need a callable function equivalent.

Open moment on YouTube ↗
#01
02 ▶ 05:40
What is an object in Python, and how do 'object' and 'function' relate to each other?
Theory Data types, numbers & memory
?
Candidate's answer

Explained that objects are instances of classes and rightly clarified the subset relationship: every Python function is an object, not the other way around.

Key takeaway

Python functions are instances of types.FunctionType holding code objects, defaults, and closures, making them first-class objects.

Open moment on YouTube ↗
#02
03 ▶ 11:11
How does a method differ from a function, and why is a function's __name__ attribute useful if you already wrote its name?
Theory OOP, classes & dunder methods
?
Candidate's answer

Separated class-defined methods from standalone functions, and gave a clear example of inspecting original __name__ when a function object is passed into a variable or decorator.

Key takeaway

func.__name__ (a string attribute, not a method) preserves the original definition name for logging, routing registries, and decorators using functools.wraps.

Open moment on YouTube ↗
#03
04 ▶ 14:40
What are dunder (magic) methods and why are they said to be invoked automatically?
Theory OOP, classes & dunder methods
?
Candidate's answer

Expanded dunder as double underscore and explained implicit invocation by the Python runtime, citing __iter__/__next__ for iteration and __new__/__init__ on instantiation.

Key takeaway

Dunder methods implement Python's Data Model protocols so custom classes integrate seamlessly with built-in syntax and operators.

Open moment on YouTube ↗
#04
05 ▶ 16:15
What is the difference between __new__ and __init__ during object instantiation?
Theory OOP, classes & dunder methods
?
Candidate's answer

Correctly stated __new__ runs first to allocate/return the new instance and __init__ runs second to populate attributes, though insisted on calling __init__ the constructor.

Key takeaway

Strictly speaking, __new__(cls, ...) constructs and returns the new instance, whereas __init__(self, ...) initializes attributes on that already-allocated object.

Open moment on YouTube ↗
#05
06 ▶ 19:50
What is Python's ternary conditional expression and when should you choose it over a regular if / else block?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Correctly demonstrated x if cond else y inside print and return, but framed the difference purely as one-line brevity vs multi-line layout.

Key takeaway

x if cond else y is an expression producing one of two values inline, whereas if / elif / else is a statement suited for multi-branch control flow and side effects.

Open moment on YouTube ↗
#06
07 ▶ 23:16
Is PEP 8 a strict mandatory standard or a set of conventions?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Refined his wording from 'standard' to a documented set of community conventions for clean, readable code rather than an interpreter-enforced rule.

Key takeaway

PEP 8 explicitly notes when to break its own guidelines — e.g., when applying a rule would reduce readability or break surrounding code consistency.

Open moment on YouTube ↗
#07
08 ▶ 29:13
What does result = True or f(); print(result) output when f() prints a log and returns True, and what does or return?
Live coding Control flow, loops & syntactic sugar
?
Candidate's answer

Predicted True for result, but missed that f()'s print never ran and mistakenly claimed or always produces a boolean True/False.

Key takeaway

True or f() short-circuits immediately on the left operand: f() is never called, and the left operand itself is returned.

Open moment on YouTube ↗
#08
09 ▶ 33:53
What does False or f() evaluate to when f() returns 1 or the string 'text'?
Live coding Control flow, loops & syntactic sugar
?
Candidate's answer

Mispredicted True when f() returned 1, then immediately updated his mental model and accurately predicted 'text' on the next run.

Key takeaway

Python's or and and return one of their actual operands untouched: x or y evaluates to x if x is truthy, otherwise y.

Open moment on YouTube ↗
#09
10 ▶ 41:35
How do f() or True and True or f() differ, and why isn't f() called in the second expression?
Live coding Control flow, loops & syntactic sugar
?
Candidate's answer

Accurately predicted 'text' vs True and cleanly summarized short-circuit evaluation: or stops at the first truthy operand without evaluating subsequent expressions.

Key takeaway

Short-circuiting in or and and guards right-hand expressions from executing when unnecessary or unsafe (e.g., obj is None or obj.is_valid()).

Open moment on YouTube ↗
#10
11 ▶ 44:20
What PEP 8 issues can you spot in the def f(): ... snippet?
Live coding Algorithms, code reading & engineering practices
?
Candidate's answer

Immediately flagged non-descriptive function name f and suggested snake_case get_string, but missed PEP 8's two-blank-line rule around top-level functions.

Key takeaway

PEP 8 requires two blank lines around top-level functions/classes and descriptive snake_case verb names.

Open moment on YouTube ↗
#11
12 ▶ 52:00
What is a pure function, and is get_string() containing a print() statement pure?
Live coding Functions, scopes & closures
?
Candidate's answer

Loosely conflated pure functions with single-responsibility functions, but rightly identified that print() makes get_string() impure.

Key takeaway

A pure function is deterministic and side-effect-free; any console I/O like print() is an observable side effect that makes it impure.

Open moment on YouTube ↗
#12
13 ▶ 53:35
Is the intermediate result variable needed in result = True or get_string(); print(result), and how can you simplify it without altering behavior?
Live coding Algorithms, code reading & engineering practices
?
Candidate's answer

Initially defended keeping result and tried rewriting with a ternary if, before realizing with a hint that the single-use expression passes directly into print(True or get_string()).

Key takeaway

Single-use temporary variables that add no semantic clarity only add boilerplate; pass simple self-explanatory expressions directly.

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

At first it seemed like the candidate was completely unprepared: Bogdan was confused, didn't always find the right answers right away, and I thought he probably wouldn't pass the interview.

But despite this, Bogdan was able to demonstrate the ability to think, analyze and understand details — and that's much more important than dry memorized answers.

This video will be useful for those preparing for technical interviews and for those who want to understand what is valued in beginning developers.

Subscribe, like and write in the comments what you think about this approach to candidate evaluation.

⸻

Support Bogdan in the comments, and if you want to participate in a similar interview — write to me!

Timestamps:

00:00 Introduction
00:32 A few words about the interviewer and candidate
04:08 Theoretical questions
04:23 Operator in Python
05:40 Object in Python
06:57 What do operators do?
08:38 Is an object a function?
09:50 How is a function different from an object?
11:11 Question about method
12:01 How is a function different from a method?
14:40 Question about dunder methods
16:15 Question about new and init
19:00 Back to the question about operators in Python
19:50 Question about ternary operator
44:09 Looking for places to improve in the code
56:31 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.

#Python #JuniorDeveloper #Interview #Interview #Programming

https://yoomoney.ru/to/4100119163947822
https://www.tbank.ru/cf/4PYyn4udS41