← Back to videos

Mock interview with Aldar for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Needs more practice Level: Pre-Junior (needs a thorough refresh of core Python)

The candidate did not pass yet: nearly two years without reviewing core language fundamentals took a clear toll. While pleasant and articulate, he gave inaccurate or guessed answers on most core Python topics—indentation syntax vs PEP 8, mutable default arguments, decorators, generators, and NoneType—and easily lost his footing under follow-up questions.

Candidate: Aldar
Target role: Junior Python Developer

Former oil & gas engineer · graduated from Yandex Practicum's Python track in Dec 2022, maintaining a commercial Django/Docker project, taking his first technical interview nearly two years after graduation

Answers accuracy 13 total
27% score
Theory
0/11 correct · 27%
Live coding
0/2 correct · 25%
Practical task
Not solved

Mutable default argument behavior (my_list=[]) and Python indentation rules

The candidate mistakenly believed 2-space indentation is a Python syntax error and predicted separate outputs [1] and [2] when calling a function with 'my_list=[]' twice. After seeing [1, 2] printed, he recalled the 'None' default workaround from training, but could not explain why the default list persists across calls.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Polite, structured communication style and realistic self-assessment
  • + Familiarity with core Python vocabulary (global/nonlocal, object dunder inheritance, try/except and raise)
  • + Hands-on exposure to Django/Docker and a habit of keeping study notes

Areas to improve

  • → Refresh core Python mechanics (mutable default arguments, None/NoneType, iterators vs generators, function & class decorators)
  • → Avoid guessing or improvising when unsure—state knowledge boundaries cleanly instead of introducing new traps
  • → Verify language behavior empirically in the REPL, separating hard parser rules from PEP 8 conventions
  • → Practice live interviews regularly to defend solid knowledge confidently against probing questions

Questions in this interview

13 / 13
01 ▶ 04:22
How do interpreters and compilers differ, and will the Python interpreter run code stored in a .txt file?
Theory Python internals, bytecode & runtime
?
Candidate's answer

Separated interpreter execution from whole-file native compilation, but mistakenly guessed Python refuses to run valid code inside a .txt file.

Key takeaway

Running 'python file.txt' works fine as long as the contents are valid Python syntax; the .py extension is required by Python's module import machinery, not direct script execution.

Open moment on YouTube ↗
#01
02 ▶ 07:26
Do compiled implementations of Python exist, and what is CPython?
Theory Python internals, bytecode & runtime
?
Candidate's answer

Confused reference CPython with Cython/ahead-of-time compilation, describing CPython as an experimental compiled extension for speeding up Python.

Key takeaway

Don't confuse CPython with Cython: CPython is the standard reference interpreter written in C, whereas Cython/Nuitka compile to C/native code and PyPy uses a JIT compiler.

Open moment on YouTube ↗
#02
03 ▶ 10:08
Tabs vs spaces in Python: does the language itself allow 2-space indentation instead of 4?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Said tabs vs spaces is team preference, but claimed 2-space indentation fails because 4 spaces are hardcoded into the Python language.

Key takeaway

Python's parser accepts any consistent space count within a single block (1, 2, 4, etc., without mixing tabs); 4 spaces is a PEP 8 convention, not a syntax requirement.

Open moment on YouTube ↗
#03
04 ▶ 12:22
How does 'def add_value(val, my_list=[])' behave when given an explicit list, and will two functions with 2-space and 4-space indents in the same file run?
Live coding Control flow, loops & syntactic sugar
?
Candidate's answer

Initially misspoke that the function always appends to an empty list before clarifying explicit list arguments override the default, and reasoned after seeing 2 spaces work that separate 2-space and 4-space functions also run.

Key takeaway

Indentation width is validated per block rather than globally across the file, though inconsistent widths across functions violate PEP 8 and linter rules.

Open moment on YouTube ↗
#04
05 ▶ 18:29
What do consecutive calls add_value(1) and add_value(2) return when 'my_list=[]' is a default parameter, and why?
Live coding Functions, scopes & closures
?
Candidate's answer

Predicted [1] and [2]; upon seeing [1, 2], recalled the 'my_list=None' pattern from his coursework, but could not explain why the default list isn't recreated per call.

Key takeaway

Default argument expressions are evaluated once when 'def' executes and stored in func.__defaults__; always use 'None' as the default and allocate a fresh list inside the function body.

Open moment on YouTube ↗
#05
06 ▶ 23:10
Why are function variables hidden from outer code, and how does scope differ from a namespace?
Theory Functions, scopes & closures
?
Candidate's answer

Explained local-before-global variable lookup and global/nonlocal keywords, but confused namespaces with closures and contradicted himself on what stores variable bindings.

Key takeaway

A namespace is the concrete dictionary storing name-to-object bindings, whereas a scope is the region of source code governing unqualified name lookup order (LEGB).

Open moment on YouTube ↗
#06
07 ▶ 29:43
What is a decorator, and why use one instead of measuring execution time directly before and after a function call?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Correctly described '@' syntactic sugar and gave function timing as an example, but couldn't articulate why a decorator beats inline timing across multiple functions and call sites.

Key takeaway

Inline timing must be duplicated at every call site, whereas a decorator centralizes cross-cutting logic once and applies cleanly to any number of functions.

Open moment on YouTube ↗
#07
08 ▶ 35:05
Can classes be decorated in Python, or do decorators only work on functions?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Answered 'no', claiming decorators apply exclusively to functions.

Key takeaway

Python decorators work on classes just like functions—standard examples include @dataclass and @functools.total_ordering.

Open moment on YouTube ↗
#08
09 ▶ 35:57
What is an iterator in Python and why is it useful when processing large datasets?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Recalled __iter__ and __next__ and yielding elements one at a time from a 100,000-item source rather than all at once, though his explanation was shaky.

Key takeaway

The iterator protocol (__iter__ and __next__ raising StopIteration) enables streaming arbitrarily large sequences one item at a time in constant memory.

Open moment on YouTube ↗
#09
10 ▶ 38:16
What are magic (dunder) methods, where does a class get them from, and what is __init__?
Theory OOP, classes & dunder methods
?
Candidate's answer

Identified double underscores and optional overriding of defaults inherited from 'object', but mixed dunder attributes (__doc__, __dict__) with methods and equated __init__ with a constructor.

Key takeaway

Distinguish special dunder attributes (__dict__, __doc__) from dunder protocol methods, and remember __new__ constructs the object while __init__ initializes it.

Open moment on YouTube ↗
#10
11 ▶ 41:47
What are generators in Python and how do they differ from regular iterators?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Remembered that a generator is an iterator using 'yield' instead of 'return', but got tangled over which one uses __next__ and couldn't explain the practical difference.

Key takeaway

Generators automatically implement both __iter__ and __next__, suspending local stack frames across 'yield' points without manually writing a stateful iterator class.

Open moment on YouTube ↗
#11
12 ▶ 45:58
What are None and NoneType in Python—does None have a data type?
Theory Data types, numbers & memory
?
Candidate's answer

Claimed None has no data type and described NoneType not as a type, but as something that only appears when raising errors.

Key takeaway

Every value in Python is a typed object: None is the sole singleton instance of built-in class NoneType (type(None) is types.NoneType).

Open moment on YouTube ↗
#12
13 ▶ 49:45
How do errors and exceptions relate in Python, and how do 'try / except' and 'raise' work?
Theory Exceptions & debugging
?
Candidate's answer

Named ZeroDivisionError, TypeError, SyntaxError, base class Exception, try/except, and raise, but equated coding mistakes directly with exceptions and implied catching missing-parenthesis SyntaxErrors inside the same file's try/except.

Key takeaway

Parser SyntaxErrors in a module occur before execution starts and cannot be caught by a try/except inside that same file, unlike runtime exceptions such as ZeroDivisionError.

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

In this video — a mock interview with Aldar for a Junior Python Developer position. A candidate who completed training almost two years ago decided to check his skills and see how ready he is for real interviews after all this time. Although he didn't pass the interview, at the end of the meeting the candidate received useful and detailed feedback that will help him prepare better for future tests.