← Back to videos

Mock interview with Anton 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 his follow-up mock interview with clear progress since his first attempt: much stronger composure, solid Junior-level fundamentals, and thoughtful discussion of programming paradigms and architecture. To grow toward Middle, the interviewer advised looking under the hood of Python operators (such as += vs + on mutable lists) and avoiding tangential details.

Candidate: Anton
Target role: Junior Python Backend

Miass · ~3 years studying Python with ~1 year of hands-on web development (Django, DRF, WebRTC & AI integrations), returning for a second mock interview to measure his progress

Answers accuracy 12 total
67% score
Theory
5/8 correct · 75%
Live coding
2/4 correct · 50%
Practical task
Partially solved

Shopping cart prototype: in-place list mutation with += vs rebinding with +

The candidate immediately spotted that original_cart was mutated in place, proposed shallow copying via copy.copy(), and flagged camelCase naming and missing docstrings (__doc__). However, he wrongly predicted cart = cart + [item] would behave identically to += and could not explain why binary + leaves the caller's list intact.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Marked improvement in confidence, conciseness, and theoretical depth compared to his earlier interview
  • + Immediately spotted in-place list mutation in the shopping-cart snippet and proposed copy.copy()
  • + Mature engineering mindset: stopped guessing when unsure about an internal mechanism and noted it to investigate
  • + Solid grasp of programming paradigms, PEP 8 conventions, __doc__ docstrings for OpenAPI/Swagger, and higher-order functions

Areas to improve

  • → Study the under-the-hood difference between augmented assignment += (__iadd__) and binary + (__add__) on mutable types
  • → Avoid volunteering unprompted terms and tangents that invite tricky follow-up traps
  • → Trace variable rebinding vs in-place mutation carefully across repeated function calls
  • → Complete the definition of pure functions with determinism and absence of external I/O side effects

Questions in this interview

12 / 12
01 ▶ 03:30
What is a variable in Python and what happens during assignment with =?
Theory Data types, numbers & memory
?
Candidate's answer

Accurately defined a variable as a named reference bound via = to an object residing in memory.

Key takeaway

Python variables are untyped names in a namespace pointing to typed objects on the heap rather than memory boxes holding values.

Open moment on YouTube ↗
#01
02 ▶ 04:24
What is augmented assignment (+=) and does a += 1 differ from a = a + 1?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Briefly confused the term with tuple unpacking, then described count += 1 as pure shorthand for count = count + 1 with identical semantics.

Key takeaway

+= invokes __iadd__ first before falling back to __add__: immutable ints rebind to a new object, whereas mutable lists mutate in place.

Open moment on YouTube ↗
#02
03 ▶ 06:14
What is an object in Python, what can be assigned to a variable, and does = behave differently depending on object type?
Theory Data types, numbers & memory
?
Candidate's answer

Correctly explained that everything in Python is an object inheriting from object with its own id() (numbers, collections, functions, classes), and plain = always binds a reference.

Key takeaway

Plain assignment = never copies object data regardless of mutability — it strictly binds a name to an object reference.

Open moment on YouTube ↗
#03
04 ▶ 10:19
Why does a shopping-cart function using cart += [item] corrupt original_cart, and how can you fix it with the copy module?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Immediately spotted that list mutability causes both original_cart and new_cart to reflect all three items, proposing shallow copy.copy() since there are no nested structures.

Key takeaway

For flat lists of immutable items, a shallow copy (cart.copy() or list(cart)) suffices; reserve copy.deepcopy() for nested mutable containers.

Open moment on YouTube ↗
#04
05 ▶ 17:41
Does replacing cart += [item] with cart = cart + [item] keep original_cart unchanged, and why?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Predicted no change in behavior; after seeing original_cart stay intact, guessed function namespace scoping before honestly admitting he needed to look up how the two operators differ.

Key takeaway

list += [item] calls list.__iadd__ (mutating the caller's list in place), whereas cart + [item] calls list.__add__, allocating a brand-new list and rebinding only local variable cart.

Open moment on YouTube ↗
#05
06 ▶ 23:09
Will repeated calls to add_to_cart(original_cart, 'cherry') accumulate items when the body uses cart = cart + [item]?
Live coding Functions, scopes & closures
?
Candidate's answer

Mistakenly argued that calling the function multiple times would still grow original_cart until live execution showed identical 3-item outputs each time.

Key takeaway

Because cart + [item] creates a fresh list without mutating original_cart, repeated calls with the same input list always return an identical result.

Open moment on YouTube ↗
#06
07 ▶ 28:37
What PEP 8 issues exist in addToCart, and why prefer a docstring over a regular # comment?
Live coding Algorithms, code reading & engineering practices
?
Candidate's answer

Flagged addToCart for snake_case (add_to_cart), noted team conventions take precedence over PEP 8, and explained that docstrings populate __doc__ for automated documentation tools like Swagger.

Key takeaway

# comments are stripped by the parser, whereas docstrings persist at runtime in obj.__doc__ for help(), IDEs, Sphinx, and OpenAPI schema generators.

Open moment on YouTube ↗
#07
08 ▶ 36:55
What is functional programming and what other programming paradigms exist?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Defined FP as a paradigm centered on stateless data-transforming functions (citing map and zip), alongside OOP, procedural, and event-driven paradigms.

Key takeaway

Core paradigms — procedural, OOP, functional, and declarative — provide distinct mental models for decomposing behavior and managing state.

Open moment on YouTube ↗
#08
09 ▶ 40:40
Can you write Python code completely outside any programming paradigm?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Initially said yes, then reasoned through scripts, functions, and classes to catch his own contradiction and conclude all code follows one paradigm or a mix of several.

Key takeaway

Even a flat top-to-bottom script follows the imperative/procedural paradigm, and idiomatic Python routinely blends procedural, OOP, and functional styles.

Open moment on YouTube ↗
#09
10 ▶ 43:30
How does understanding programming paradigms practically help a developer design real features like a shopping cart?
Theory OOP, classes & dunder methods
?
Candidate's answer

Illustrated architectural maintainability: modularizing stages so changing one data source doesn't break the app, and using OOP inheritance, encapsulation, and polymorphism for specialized cart variants.

Key takeaway

Paradigm literacy helps match tools to problems: stateless functions for data transformations and OOP classes when encapsulating state and polymorphic behavior.

Open moment on YouTube ↗
#10
11 ▶ 49:12
Can you write functional-style code in Python, and what is a higher-order function?
Theory Functions, scopes & closures
?
Candidate's answer

Confirmed Python supports functional patterns and defined a higher-order function as one that accepts a function argument (map, filter with lambda) or returns a function (decorators).

Key takeaway

A higher-order function takes callables as arguments and/or returns a callable (e.g., map, filter, sorted with key=, functools.reduce, and decorators).

Open moment on YouTube ↗
#11
12 ▶ 51:31
What is a pure function and what role does it play in functional programming?
Theory Functions, scopes & closures
?
Candidate's answer

Gave rectangle perimeter calculation as an example and noted pure functions do not mutate inputs, but missed the second core requirement beyond non-mutation.

Key takeaway

A pure function must satisfy two rules: 1) deterministic output depending solely on its arguments, and 2) zero side effects (no in-place mutation, global state writes, or I/O).

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

In this video, I conduct a repeat mock interview with Anton — a candidate who has already passed an interview with me on the channel. Today we'll check if there's been progress since the last meeting and identify points for further growth.

In the video, you'll also see a new Python code example where we analyze interesting language features — useful for both those preparing for technical interviews and those who simply want to understand Python better.

Useful. Honest. No fluff.

#interview #python #development #progress #codereview #technicalinterview

Timestamps:

00:00 Introduction
00:37 A few words about the interviewer and candidate
03:20 Theoretical questions
03:30 What is a variable?
04:24 Combined assignment operator
06:14 What are objects? What objects can be assigned to a variable?
08:44 Difference in how assignment operators work depending on the object
09:44 Code experiments and questions about them
17:38 Back to the question about the difference between assignment operators
22:50 Looking for code flaws
36:55 Question about functional programming
40:40 Can you write code outside of paradigms?
43:30 What's the practical benefit of paradigms?
49:12 Can you write code exclusively in one paradigm in Python?
50:03 Question about higher-order function
51:31 Question about pure function
52:44 Pure functions in functional programming
53:28 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.

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