← Back to videos

Public mock interview with Georgy for a Junior Python developer position

09.09.2025
Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Needs more practice Level: Trainee / Pre-Junior (surface-level fundamentals, strong potential)

Current depth of Python knowledge and confidence is not yet sufficient for a Junior Python Developer role: the candidate knows surface-level concepts but struggles when probing underlying language mechanics. However, the interviewer highlighted sound reasoning, code-reading ability, and strong growth potential once backed by deeper study and practice.

Candidate: Georgy
Target role: Junior Python Developer

2nd-year IT university student · started with Python for school CS exams (OGE/EGE), briefly studied C++ at university, first technical interview

Answers accuracy 15 total
43% score
Theory
3/9 correct · 56%
Live coding
0/6 correct · 25%
Practical task
Not solved

Functions as first-class objects and late-binding closures in a for-loop

The candidate mispredicted the output of both code snippets: first missing the difference between passing a function object printer(make_message) and calling printer(make_message()) (though correctly connecting the output to __repr__ afterward), and second failing to explain why functions defined in a loop all print i = 4 or how to fix late binding.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Sound, logical thinking aloud without wild random guesses
  • + Ability to read unfamiliar code step by step and revise conclusions after seeing runtime output
  • + Good composure during the first half of his very first technical interview
  • + Basic grasp of Big O complexity and function-local variable scope

Areas to improve

  • → Deepen core Python fundamentals: namespaces (LEGB), closures, and late binding in loops
  • → Study Python's data model: first-class functions and how __repr__ vs __str__ work under the hood
  • → Experiment hands-on in the interpreter to verify hypotheses and edge cases
  • → Practice articulating technical explanations aloud and maintaining composure under pressure

Questions in this interview

15 / 15
01 ▶ 02:59
What are Python's PEP 8 recommendations for naming variables and formatting code?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Cited PEP 8 guidelines: lowercase descriptive variable names and 4-space indentation for function, conditional, and loop blocks.

Key takeaway

PEP 8 prescribes snake_case for variable and function names and 4 spaces per indentation level.

Open moment on YouTube ↗
#01
02 ▶ 03:44
What restrictions apply to Python variable names, and what happens if you name a variable after a keyword like def or if?
Theory Python internals, bytecode & runtime
?
Candidate's answer

Correctly noted that identifiers cannot start with digits, contain special characters, or use reserved keywords like if/for/def, but could not name the exact exception type.

Key takeaway

Using a reserved keyword as an identifier (e.g., def = 5) fails during parsing with a SyntaxError before bytecode execution begins.

Open moment on YouTube ↗
#02
03 ▶ 05:37
Where are Python's reserved keywords stored and how can you retrieve the full list programmatically?
Theory Modules, packages, imports & stdlib
?
Candidate's answer

Mentioned VS Code syntax highlighting and documentation, guessing a command exists without knowing what it is.

Key takeaway

The standard library's keyword module exposes keyword.kwlist (plus keyword.softkwlist) and keyword.iskeyword(), or you can run help('keywords').

Open moment on YouTube ↗
#03
04 ▶ 06:33
What is a namespace in Python?
Theory Functions, scopes & closures
?
Candidate's answer

Admitted having seen the term in reading materials but could not define or explain it.

Key takeaway

A namespace maps symbolic names to objects in memory (typically backed by a dict), separating built-in, module-global, and function-local names.

Open moment on YouTube ↗
#04
05 ▶ 07:26
What is variable scope and why is it needed?
Theory Functions, scopes & closures
?
Candidate's answer

Explained that a variable created inside a function stays local to it and cannot be accessed outside, isolating responsibilities across code sections.

Key takeaway

Python resolves names via the LEGB rule (Local -> Enclosing -> Global -> Built-in), preventing accidental name collisions across functions.

Open moment on YouTube ↗
#05
06 ▶ 08:33
How and where in memory are a global variable a = 5 and a same-named local variable a = 'str' stored?
Theory Functions, scopes & closures
?
Candidate's answer

Correctly stated they are distinct variables pointing to separate objects in RAM, but could not explain stack frames or local namespace creation on function call.

Key takeaway

Objects live on Python's private heap while references live in separate namespaces: the module's globals dict vs the function call's local stack frame.

Open moment on YouTube ↗
#06
07 ▶ 10:25
What does the code output for printer(make_message) without parentheses vs printer(make_message()) with parentheses?
Live coding Functions, scopes & closures
?
Candidate's answer

Initially spotted passing vs calling the function, but ultimately predicted both lines would print the returned message string.

Key takeaway

Functions are first-class objects in Python: make_message passes the function object itself, whereas make_message() invokes it and passes its return value.

Open moment on YouTube ↗
#07
08 ▶ 14:26
What are magic (dunder) methods, and which method (__name__, __str__, or __repr__) produces <function make_message at 0x...>?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Described dunder methods as hooks defining object behavior, distinguished __name__, and rightly picked __repr__, though his explanation of __str__/__repr__ fallback was imprecise.

Key takeaway

print(obj) calls str(obj); when a type doesn't override __str__ (like function), object.__str__ falls back to calling __repr__.

Open moment on YouTube ↗
#08
09 ▶ 17:50
Where do a function's dunder methods come from, and can you customize the string representation of a callable?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Correctly reasoned that built-in types are implemented as classes with built-in dunder methods, but did not know how to customize a function/callable's string output.

Key takeaway

Built-in function dunder methods are read-only on the C type, so custom printable callables are implemented as classes defining __call__ and __str__/__repr__.

Open moment on YouTube ↗
#09
10 ▶ 19:24
What does a snippet print when def f(): print(f'i = {i}') is appended to funcs inside for i in range(5) and each function is called in a second loop?
Live coding Functions, scopes & closures
?
Candidate's answer

Predicted 1 through 5 would print during the first loop and then 1 through 5 again in the second loop.

Key takeaway

Defining a function does not execute its body, and range(5) runs 0..4; when invoked later, all five functions print 'i = 4'.

Open moment on YouTube ↗
#10
11 ▶ 23:43
Why do all functions in the list print i = 4, does loop variable i exist after the for-loop ends, and how do you fix the bug?
Live coding Functions, scopes & closures
?
Candidate's answer

Mistakenly thought loop variable i is scoped strictly inside the for-loop, could not explain late-binding closures, and suggested storing strings instead of fixing the function.

Key takeaway

Python for-loops do not create a new scope: i remains 4 in the enclosing scope and closures look it up lazily on call. Bind eagerly via default argument def f(i=i): or functools.partial.

Open moment on YouTube ↗
#11
12 ▶ 30:25
What code review remarks do you have for this snippet, and does moving def f() out of the 5-iteration loop matter for performance?
Live coding Algorithms, code reading & engineering practices
?
Candidate's answer

Spotted repeated function creation inside the loop, arguing it should be hoisted out to save memory and server CPU even for a fixed 5-iteration script.

Key takeaway

Premature micro-optimization without an actual bottleneck wastes engineering effort; prioritize correctness, clarity, and PEP 8 first.

Open moment on YouTube ↗
#12
13 ▶ 37:52
Should an engineer always pick the fastest and most memory-efficient solution among alternatives?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Initially insisted on always maximizing speed and minimizing memory, then reasoned his way to balancing time/space trade-offs, business constraints, and engineering cost.

Key takeaway

Engineering choices depend on actual constraints — data scale, latency budgets, time-vs-memory trade-offs, and maintainability cost.

Open moment on YouTube ↗
#13
14 ▶ 41:28
What is Big O notation and how is it used to compare algorithms?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Clearly explained Big O as how runtime and memory consumption scale with input size, illustrating O(n) with linear search in a list.

Key takeaway

Big O captures asymptotic scaling of operations or memory as input size grows, independent of hardware clock speed.

Open moment on YouTube ↗
#14
15 ▶ 43:07
How do you identify a performance bottleneck in code, and why is logging wall-clock seconds alone insufficient?
Theory Exceptions & debugging
?
Candidate's answer

Suggested timing functions via logs and tracking memory; agreed faster hardware masks wall-clock time without fixing poor scaling, and noted no prior experience with profilers.

Key takeaway

Use profilers (cProfile, py-spy, scalene) and timeit benchmarks across varying input sizes to pinpoint bottlenecks rather than ad-hoc log timestamps.

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

New mock interview for a Junior Python developer position!

We with Georgy will figure out the tricks of Python and test how deep his understanding of the language is.

Topics we'll cover:
• how to properly name variables according to PEP8,
• what happens if you name a variable if or def,
• scope and namespaces — in simple terms,
• functions as objects,
• magic methods (__str__, __repr__) and where their "magic" comes from,
• should you always optimize code and what does "faster — not always better" mean.

Georgy is a second-year student, this is his first interview.
He reasons out loud, sometimes makes mistakes, but learns in the process. And I ask questions, help where needed, and give honest feedback with tips on what to improve to confidently pass next interviews.

This video will be useful for:
• juniors and students preparing for their first interviews,
• those who want to refresh the basics of Python,
• everyone who enjoys observing real dialogue and real mistakes, not "ideal" textbook answers.

Subscribe to the channel — there's much more analysis, interviews and practical Python videos ahead!

Timestamps:

00:00 Introduction
00:33 A few words about the interviewer and candidate
02:55 Theoretical questions
10:21 Code experiments and questions about them
37:45 Continuation of theoretical questions
45:04 Feedback exchange

#python #junior #interview #interview #programming #development #yandex #practicum

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://yoomoney.ru/to/4100119163947822
https://www.tbank.ru/cf/4PYyn4udS41