← Back to videos

Mock interview for a Junior Python Developer – Kostya

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Passed with caveats Level: Strong Junior (short of Middle due to theory gaps & low confidence)

The candidate matched a Strong Junior bar backed by real production experience, but fell short of Middle: theoretical imprecision (conflating DIP with DI, gaps around Singletons), difficulty explaining concepts simply to juniors, and wavering confidence on basic shallow-copy identity checks held him back.

Candidate: Konstantin
Target role: Junior / Middle Python Developer

~3 years of commercial Python experience · self-taught since 2017, working on a high-load distributed monolith (20–30 servers, DB replication)

Answers accuracy 13 total
50% score
Theory
2/10 correct · 50%
Live coding
1/3 correct · 50%
Practical task
Partially solved

Shallow vs deep copy of a dict of lists: copy.copy(), copy.deepcopy(), and id()

The candidate immediately predicted the right console output for dicts a, b, and c after b['x'].append(99) and suggested id() to check object identity, but then repeatedly contradicted himself over whether outer dicts a/b and inner lists a['x']/b['x'] are the same or distinct objects.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Three years of hands-on production Python experience and grounding discussions in real project scenarios
  • + Broad technical reading (familiarity with Clean Code, SOLID, DRY, KISS, CQS, Borg pattern, __new__)
  • + Accurate prediction of final console output for nested dicts with copy.copy() vs copy.deepcopy()

Areas to improve

  • → Build conviction in core fundamentals instead of flip-flopping on basic object-identity and shallow-copy questions
  • → Clearly separate architectural concepts: Dependency Inversion Principle (DIP) vs Dependency Injection (DI)
  • → Master Singletons in Python: built-in singletons (None, True, False) and idiomatic implementation approaches
  • → Practice explaining design principles concisely in plain language, a key expectation for Middle engineers mentoring juniors

Questions in this interview

13 / 13
01 ▶ 04:07
What is a class interface in Python in plain terms, and how is it expressed in the language?
Theory OOP, classes & dunder methods
?
Candidate's answer

Mentioned public methods (without leading underscore), ABCs, typing.Protocol, and eventually 'contract', but struggled to state it concisely, summarizing it as 'typing entry points'.

Key takeaway

An interface is the public contract for interacting with an object (method signatures and expected behavior, hiding internals), expressed in Python via duck typing, abc.ABC, or typing.Protocol.

Open moment on YouTube ↗
#01
02 ▶ 06:36
How many methods should a class have, and how would you explain to a junior why stuffing everything into one God class is bad?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Rightly noted Python imposes no technical cap and classes should share a coherent domain context, but struggled to articulate clear cohesion, coupling, and maintainability arguments for a junior.

Key takeaway

A God class hurts not because of a line-count rule, but because unrelated responsibilities share mutable state, making testing, changes, and team collaboration fragile.

Open moment on YouTube ↗
#02
03 ▶ 11:52
What is SOLID overall — design patterns or design principles?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Correctly identified SOLID as five object-oriented design principles rather than concrete patterns, referencing Robert C. Martin's books.

Key takeaway

SOLID comprises five high-level design principles (SRP, OCP, LSP, ISP, DIP) aimed at keeping software modular, extensible, and maintainable.

Open moment on YouTube ↗
#03
04 ▶ 13:46
What is the difference between the Dependency Inversion Principle (DIP) and Dependency Injection (DI)?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Initially translated Dependency Injection as 'dependency inversion', described constructor injection for testing well, but concluded he essentially equates DIP and DI.

Key takeaway

DIP is an architectural rule (high-level policy depends on abstractions, not low-level concrete details), whereas DI is a wiring technique of passing dependencies in from the outside.

Open moment on YouTube ↗
#04
05 ▶ 17:53
How would you explain the value of dependency inversion and extensible design to a junior using a practical example?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Gave a relatable Django CSV-export story where a hardcoded comma delimiter couldn't be switched to a semicolon, though he framed the lesson narrowly as parameterizing config flags.

Key takeaway

A clear DIP analogy is a wall socket: core business logic talks to an abstract interface (e.g., Repository/Gateway), letting you swap Postgres, an API, or an in-memory test double freely.

Open moment on YouTube ↗
#05
06 ▶ 21:53
What is the Single Responsibility Principle (SRP), and how does it relate to DRY and KISS?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Accurately cited Martin's actor-based definition of SRP and CQS (separating queries from mutations), but dismissed single-purpose function decomposition despite praising KISS.

Key takeaway

SRP states a module should have one reason to change, complementing KISS at the function level: separating calculation from I/O keeps functions simple, testable, and reusable.

Open moment on YouTube ↗
#06
07 ▶ 28:12
What is the Singleton pattern, where is it used, and why is it often considered an anti-pattern?
Theory OOP, classes & dunder methods
?
Candidate's answer

Correctly defined Singleton as ensuring a single class instance, mentioned the Borg shared-state pattern, loggers, and concurrent mutation hazards, but conflated stateless @classmethod utility classes with Singletons.

Key takeaway

Singleton enforces a single instance with global access; it is often deemed an anti-pattern because hidden global state couples code, leaks state across tests, and invites concurrency bugs.

Open moment on YouTube ↗
#07
08 ▶ 30:40
Does Python have built-in singletons? Give concrete examples.
Theory Data types, numbers & memory
?
Candidate's answer

Claimed Python has lots of singletons across its internals and libraries, yet could not name a single built-in example.

Key takeaway

Python's canonical built-in singletons are None (the sole instance of NoneType, checked via 'is None'), True, False, Ellipsis (...), and NotImplemented.

Open moment on YouTube ↗
#08
09 ▶ 35:30
What are the different ways to implement a Singleton in Python?
Theory OOP, classes & dunder methods
?
Candidate's answer

Described overriding __new__(cls) to cache the single instance on a class attribute (and reusing it via inheritance), but couldn't name any alternative Pythonic approaches.

Key takeaway

Beyond __new__, Python Singletons can be built via a metaclass (__call__), a class decorator, @lru_cache(1) on a factory, or most Pythonically a module-level instance cached in sys.modules.

Open moment on YouTube ↗
#09
10 ▶ 40:46
How can you copy objects in Python, and what is the difference between assignment, shallow copy, and deepcopy?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Distinguished plain assignment (aliasing the same object), copy.copy() (shallow container copy), and copy.deepcopy() (recursively cloning nested mutables), citing safe mutation while iterating over a copy.

Key takeaway

Assignment aliases the reference; copy.copy() duplicates only the top-level container; copy.deepcopy() recursively clones nested mutable objects while tracking cycles via a memo dict.

Open moment on YouTube ↗
#10
11 ▶ 45:31
What does the snippet print for a, b, and c when b = copy.copy(a), c = copy.deepcopy(a), and b['x'].append(99) is called?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Correctly predicted the output: both a and b show 'x': [1, 2, 99], while the deep copy c retains the original {'x': [1, 2], 'y': [3, 4]}.

Key takeaway

A shallow dict copy creates a new outer dict mapping keys to the exact same inner list objects, so mutating b['x'] in-place also mutates a['x'].

Open moment on YouTube ↗
#11
12 ▶ 49:45
Are the outer dicts 'a' and 'b' the same object in memory after b = copy.copy(a), and how do you check?
Live coding Data types, numbers & memory
?
Candidate's answer

Correctly proposed checking id(a), id(b), id(c), though he initially claimed a and b were the same object before catching himself right before execution.

Key takeaway

Check object identity via 'a is b' (equivalent to id(a) == id(b)): after b = copy.copy(a), the outer dicts are distinct objects (a is b is False).

Open moment on YouTube ↗
#12
13 ▶ 52:18
After b = copy.copy(a), are the nested lists a['x'] and b['x'] the same object in memory or distinct objects?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Repeatedly flip-flopped between 'distinct' and 'same' objects, doubted whether one level counts as nesting, and ultimately could not commit to a firm answer.

Key takeaway

With shallow copy, a is not b (distinct outer dicts), while a['x'] is b['x'] is True (the exact same inner list object) — which is why b['x'].append(99) affected both.

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

In this interview, a candidate with around three years’ experience attempts to secure a role as a junior/middle Python developer. During the conversation, we discuss not only Python but also engineering thinking: how to explain complex concepts in simple terms, and the importance of confidence, theoretical knowledge and the ability to justify one’s decisions.

The video covers the following topics:
— what an interface is in Python
— classes, methods and the boundaries of ‘good’ design
— SOLID, DRY, KISS
— Dependency Injection and Dependency Inversion
— singleton in Python
— shallow copy and deep copy
— how to answer in an interview if you know the practical side but are a bit shaky on the theory
— detailed final feedback on the candidate’s level

This video will be useful for anyone preparing for a Python developer interview, wanting to understand typical mistakes in answers and improve their self-presentation skills in a technical interview.

Timecodes:

00:00 Start
00:11 Introduction and introduction of participants
02:37 Interview rules and format
04:07 Interfaces in Python in simple terms
06:36 How many methods are normal for a class
11:52 SOLID: what it is and why it’s needed
13:46 DI vs DIP: what’s the difference
17:53 How to explain the principles to a junior
21:53 Single Responsibility in practice
24:33 DRY and KISS versus ‘pure’ principles
28:12 Singleton: pattern or anti-pattern
35:30 Ways to implement Singleton in Python
40:46 Shallow and deep copying
55:41 The candidate’s impressions of the interview
58:22 Analysis of mistakes and strengths

Let us know in the comments how you would answer questions about SOLID, Singleton and object copying in Python.

#python #pythondeveloper #interview #juniorpython #middlepython #pythoninterview #programming #developer #backend #itinterview #interviewprep #solid #dependencyinjection #singleton #deepcopy #shallowcopy #pythonjob #careeradvice #technicalinterview