← Back to videos

Mock interview with Alexander for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Passed interview Level: Solid Junior

The candidate passed solidly: demonstrated strong knowledge of Python's LEGB scope resolution, iterator protocol, generators, runtime introspection, and object model while resisting trick prompts and skipping unknown topics cleanly. The main advice was to keep answers concise and scoped strictly to the question asked.

Candidate: Alexander
Target role: Junior Python Developer

Former physician with academic experience in biomedical data analysis & statistics · enrolled in an extended Python backend engineering program

Answers accuracy 13 total
81% score
Theory
7/11 correct · 77%
Live coding
2/2 correct · 100%
Practical task
Solved

Single-element tuple (1_000_000,) and runtime introspection with isinstance()

The candidate immediately spotted the trailing comma in value = (1_000_000,), predicted False for isinstance(value, int) and True without the comma, and explained runtime introspection (isinstance, dir, type) using an external API response validation scenario.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Strong command of LEGB scope resolution, namespaces, the iterator protocol, and memory-efficient generators
  • + Spot-on reading of the 1-tuple code snippet and practical API-validation example for runtime introspection
  • + Sound live reasoning, resilience to pushback, and discipline to skip unfamiliar topics instead of bluffing
  • + Clear mental model of Python names as labels referencing heap objects derived from object

Areas to improve

  • → Answer concisely and strictly within the scope of the question to avoid opening unnecessary tangents
  • → Study how circular imports happen in Python and standard ways to resolve them
  • → Sharpen explanations of when stateful OOP classes outperform plain procedural functions

Questions in this interview

13 / 13
01 ▶ 05:05
Why do we need functions in programming, and how does using them reduce bugs?
Theory Functions, scopes & closures
?
Candidate's answer

Named code reuse, hiding implementation details, and flexible parameter handling, though detoured through third-party libraries before linking fewer bugs directly to avoiding copy-pasted logic.

Key takeaway

Functions encapsulate tested logic behind a clear contract and enforce DRY, so fixes and updates happen in one place instead of error-prone duplicates.

Open moment on YouTube ↗
#01
02 ▶ 09:23
How do function parameters differ from arguments?
Theory Functions, scopes & closures
?
Candidate's answer

Clearly contrasted them: parameters are placeholder names declared in the function signature, whereas arguments are concrete values passed into those slots at call time.

Key takeaway

Parameters belong to the function definition signature, while arguments are the runtime objects bound to those parameter names on each call.

Open moment on YouTube ↗
#02
03 ▶ 15:32
What is a lambda function in Python, and how do its syntax and object lifecycle differ from def?
Theory Functions, scopes & closures
?
Candidate's answer

Accurately described an anonymous single-expression function garbage-collected when unreferenced, though misspoke initially about whether a lambda can be assigned to a variable.

Key takeaway

A lambda produces a regular function object restricted to a single expression; while it can be bound to a variable, PEP 8 recommends def whenever a name is needed.

Open moment on YouTube ↗
#03
04 ▶ 18:25
In what practical scenario is an inline lambda clearly preferable to defining a separate def?
Theory Functions, scopes & closures
?
Candidate's answer

Agreed that complex lambdas hurt readability, then gave the canonical example of passing a short one-off key function to sorted(..., key=lambda ...).

Key takeaway

Lambdas excel as short inline callbacks passed to higher-order functions like sorted(), min(), or max() when a separate named def would add noise.

Open moment on YouTube ↗
#04
05 ▶ 27:35
What is a circular import in Python?
Theory Modules, packages, imports & stdlib
?
Candidate's answer

Honestly asked to skip the question rather than guess inaccurately.

Key takeaway

A circular import happens when module A imports B while B imports partially initialized A, raising ImportError/AttributeError; fix it by extracting shared code or deferring imports.

Open moment on YouTube ↗
#05
06 ▶ 28:42
Why are local function variables inaccessible from outside, and how does Python resolve variable names?
Theory Functions, scopes & closures
?
Candidate's answer

Walked through the LEGB rule (Local, Enclosing, Global, Built-in) step by step using a concrete example of shadowing len across module, outer, and nested functions.

Key takeaway

Python resolves names strictly outward along Local -> Enclosing -> Global -> Built-in, while inner function locals remain isolated from outer scopes.

Open moment on YouTube ↗
#06
07 ▶ 31:25
What is the difference between a scope and a namespace in Python?
Theory Functions, scopes & closures
?
Candidate's answer

Cleanly distinguished them: a namespace is the concrete container holding name-to-object bindings, whereas scope defines where in the program those namespaces are visible.

Key takeaway

A namespace is the runtime dictionary mapping names to objects, while a scope is the lexical code region governing which namespaces are searched.

Open moment on YouTube ↗
#07
08 ▶ 33:02
What does print(isinstance(value, int)) output for value = (1_000_000,), and what changes if the comma is removed?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Immediately spotted the 1-element tuple created by the trailing comma, predicted False, and noted removing the comma leaves an int that yields True.

Key takeaway

In Python, the comma constructs non-empty tuples rather than parentheses: (1_000_000) evaluates to int, while (1_000_000,) creates a 1-tuple.

Open moment on YouTube ↗
#08
09 ▶ 34:05
What is runtime introspection in Python, which built-ins support it, and where is it useful in practice?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Defined introspection as inspecting object types, attributes, and methods at runtime (isinstance, type, dir) and gave a practical example of validating an external API payload.

Key takeaway

Runtime introspection (isinstance, dir, getattr, inspect) lets programs examine object types and capabilities dynamically for validation, serialization, and frameworks.

Open moment on YouTube ↗
#09
10 ▶ 37:49
What is an iterator in Python, what protocol does it implement, and how does a for-loop use it?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Named the __iter__ and __next__ protocol methods, distinguished an iterable from its iterator, and traced iter()/next() calls through StopIteration termination in a for-loop.

Key takeaway

An iterable produces an iterator via __iter__(), while an iterator maintains traversal state, yields items via __next__(), and ends with StopIteration.

Open moment on YouTube ↗
#10
11 ▶ 40:23
What is an object in Python, how does a variable name differ from an object, and where do objects come from?
Theory OOP, classes & dunder methods
?
Candidate's answer

Explained that variable/function names are labels referencing heap entities with attributes and methods, all types inherit from base class object, and classes serve as blueprints.

Key takeaway

Everything in Python (values, functions, modules, classes) is a heap object with an identity and type, while variables are merely names bound to object references.

Open moment on YouTube ↗
#11
12 ▶ 46:12
Why use classes and OOP if functions can solve any problem, and what does 'programming paradigm' mean?
Theory OOP, classes & dunder methods
?
Candidate's answer

Listed the four OOP principles and highlighted stateful modeling via Django models, but gave meandering comparisons on coding speed and couldn't define 'paradigm'.

Key takeaway

A programming paradigm is a foundational style of structuring programs (procedural, OOP, functional); OOP excels at bundling stateful domain entities with polymorphic behavior.

Open moment on YouTube ↗
#12
13 ▶ 58:46
What is a generator in Python, how is it created, and when do you choose it over a materialized collection?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Defined a generator as a lazy iterator (via yield functions or generator expressions) that computes items on demand to save RAM, citing line-by-line processing of huge files.

Key takeaway

Generators suspend and resume execution at yield, keeping O(1) memory overhead when streaming large files, DB cursors, or infinite sequences.

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

And here's another successfully passed interview.

Alexander began his professional career as a doctor, but now decided to focus precisely on web development and data analysis. And he's already achieved some success.