← 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: Junior

The candidate passed: although he missed or stumbled on roughly 30% of questions (__init__ inheritance, @property, exact OOP/OS terminology), he demonstrated strong analytical reasoning across advanced topics including asyncio and the GIL, caught bugs in class methods, and thought through edge cases without panicking.

Candidate: Alexander
Target role: Junior Python Developer

21 y/o · 3rd-year CS undergraduate, 3 years with Python (focused on FastAPI & SQLAlchemy for the past 6 months), interviewing for his first internship

Answers accuracy 14 total
54% score
Theory
3/7 correct · 71%
Live coding
1/7 correct · 36%
Practical task
Partially solved

Analyzing and debugging Student & StudentPlus classes (attributes, @classmethod, @staticmethod, @property, inheritance)

The candidate accurately distinguished shared class-level data from per-instance fields, spotted both bugs in @classmethod (missing cls parameter and missing cls. attribute prefix), and explained @staticmethod mechanics. However, he conflated constructor and initializer, treated 'cls' as a mandatory keyword, didn't know @property, and mistakenly concluded __init__ is not inherited by subclasses.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Strong analytical reasoning and ability to work through unfamiliar follow-up questions step by step
  • + Sharp bug detection in @classmethod (immediately spotted missing cls parameter and cls.attr lookup)
  • + Solid grasp of single-threaded asyncio I/O concurrency vs multiprocessing for CPU-bound work under the GIL
  • + Honest communication about unfamiliar features like @property without bluffing

Areas to improve

  • → Standardize technical terminology (class vs instance attributes, constructor __new__ vs initializer __init__)
  • → Review how dunder methods like __init__ are inherited automatically along the MRO unless overridden
  • → Practice @property descriptors and idiomatic use cases for @classmethod (factory constructors) vs @staticmethod
  • → Clarify OS processes vs CPU cores and thread context-switching overhead vs coroutine switching

Questions in this interview

14 / 14
01 ▶ 05:23
Why do programming languages have functions, and how does a function differ conceptually from a procedure?
Theory Functions, scopes & closures
?
Candidate's answer

Explained that functions encapsulate named reusable code blocks and recalled procedures from assembly, but couldn't distinguish procedures from value-returning functions.

Key takeaway

Classically, a procedure executes statements without returning a value while a function computes and returns one; in Python both use 'def', returning None by default.

Open moment on YouTube ↗
#01
02 ▶ 06:43
What practical problems arise in a large codebase when copying code instead of extracting functions?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Cited poorer readability, slower development, and global variable collisions; with a prompt about 50 DB-write copies, recognized the danger of missing one copy when fixing a bug.

Key takeaway

Following DRY centralizes logic in one place so bug fixes and requirement changes apply everywhere consistently without human copy-paste errors.

Open moment on YouTube ↗
#02
03 ▶ 13:34
What are classes and objects, and why do we need them if any program can be written with functions?
Theory OOP, classes & dunder methods
?
Candidate's answer

Described a class as a blueprint bundling attributes and methods and an object as its concrete instance, framing classes vs functions as design tools chosen by the developer for maintainability and inheritance.

Key takeaway

Any logic can be written without classes, but OOP simplifies complex domain modeling by co-locating state, invariants, and polymorphic behavior.

Open moment on YouTube ↗
#03
04 ▶ 22:40
How does a variable defined directly in the body of class Student differ from self.name fields assigned inside __init__?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Accurately explained shared class-level values vs per-instance fields set at creation, though he had to be prompted for the standard terms 'class attribute' and 'instance attribute'.

Key takeaway

Class attributes live in Cls.__dict__ and are shared across instances, whereas instance attributes live in each instance's own __dict__ (or __slots__).

Open moment on YouTube ↗
#04
05 ▶ 26:42
Is __init__ the class constructor or the instance initializer in Python?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Insisted that __init__ serves as both the constructor and the initializer of an object.

Key takeaway

Python splits object creation into two steps: __new__(cls) allocates and returns the new instance (constructor), while __init__(self) populates attributes on the existing object (initializer).

Open moment on YouTube ↗
#05
06 ▶ 28:39
What distinguishes magic (dunder) methods from regular methods, and where do unwritten dunder methods come from?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Noted the double leading/trailing underscores, gave __add__ for '+' overloading, and explained every class inherits default dunder methods under the hood and overrides them selectively.

Key takeaway

Default dunder methods are inherited from the root 'object' class and invoked implicitly by Python's operators and built-in functions.

Open moment on YouTube ↗
#06
07 ▶ 31:34
What bugs exist in the zero-argument @classmethod, and is the parameter name 'cls' strictly required by Python?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Immediately spotted the missing cls parameter and cls.default_course lookup and explained calling class methods on the class directly, but mistakenly thought renaming 'cls' to 'cls2' would fail.

Key takeaway

@classmethod passes the class object as the first positional argument; 'cls' and 'self' are strong PEP 8 conventions rather than reserved language keywords.

Open moment on YouTube ↗
#07
08 ▶ 38:02
How does @staticmethod differ from @classmethod, and what are their practical real-world use cases?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Correctly explained that @staticmethod receives neither self nor cls and cannot access class/instance state, but couldn't provide practical scenarios distinguishing their usage.

Key takeaway

Use @classmethod for alternative factory constructors (which respect subclasses via cls) and @staticmethod for stateless utility helpers logically grouped inside the class namespace.

Open moment on YouTube ↗
#08
09 ▶ 42:26
What does the @property decorator do on a class method?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Honestly stated he had not encountered @property before and did not know its behavior.

Key takeaway

@property turns a method into a computed managed attribute accessed without parentheses, supporting optional validation via @attr.setter.

Open moment on YouTube ↗
#09
10 ▶ 43:07
Does subclass StudentPlus(Student) inherit the parent's __init__ and instance attributes if __init__ is omitted in StudentPlus?
Live coding OOP, classes & dunder methods
?
Candidate's answer

Correctly explained overriding the class attribute, but fell for the interviewer's follow-up and claimed __init__ is not inherited unless explicitly rewritten in StudentPlus.

Key takeaway

Dunder methods including __init__ follow normal MRO lookup: omitting __init__ in a subclass automatically invokes the parent class's __init__.

Open moment on YouTube ↗
#10
11 ▶ 49:27
What limitation of synchronous code does asynchronous programming solve?
Theory Asyncio, threads, processes & GIL
?
Candidate's answer

Explained that synchronous code sits idle waiting on external calls like DB queries, whereas async code switches to other ready tasks during I/O wait times.

Key takeaway

Async shines on I/O-bound workloads (network, DBs, sockets) by overlapping wait times, while offering no speedup for pure CPU-bound computation.

Open moment on YouTube ↗
#11
12 ▶ 52:13
What are threads and processes, and how does concurrency differ from true parallelism?
Theory Asyncio, threads, processes & GIL
?
Candidate's answer

Initially equated a process with a CPU core and called multithreading parallel, then reasoned out that threads share a process via context switching (concurrency) whereas separate processes run truly in parallel.

Key takeaway

A process has isolated memory while threads share a process's address space; in standard CPython the GIL restricts threads to concurrent Python bytecode execution, whereas multiple processes achieve multi-core parallelism.

Open moment on YouTube ↗
#12
13 ▶ 58:39
Is asynchronous programming in Python multithreaded or multiprocess?
Theory Asyncio, threads, processes & GIL
?
Candidate's answer

Clearly answered neither: async runs within a single thread of a single process, suspending awaiting coroutines on I/O and resuming them via the event loop once data arrives.

Key takeaway

asyncio uses a single-threaded event loop with cooperative multitasking at explicit 'await' points backed by OS-level non-blocking I/O multiplexing.

Open moment on YouTube ↗
#13
14 ▶ 59:34
When should you choose asyncio, threads, or processes in Python given the GIL, and why does asyncio outperform threads at thousands of concurrent requests?
Theory Asyncio, threads, processes & GIL
?
Candidate's answer

Rightly matched asyncio to high-RPS DB servers, cited the GIL, matched video rendering to multiprocessing, and noted single-threaded safety from data races/locks, while missing OS thread stack memory and kernel context-switch overhead.

Key takeaway

Coroutines cost kilobytes and switch cooperatively in user space without OS kernel context-switch overhead, whereas OS threads consume much more memory and remain mainly useful for legacy blocking I/O libraries.

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

Alexander is not a Practicum student, but he is one of my channel viewers. He sent his resume to bartenev@outlook.com and asked me to conduct an interview for him.

In this mock interview we discussed not only the key topics that almost all beginning developers face, but also touched on more complex questions, rarely encountered in such interviews (spoiler — we talked about asynchronous code). Despite some questions causing difficulty, Alexander showed the main thing — the ability to analyze, think about tasks and questions, and look for pitfalls even in the most obvious things. And for a junior, that's much more important than just knowing theory!

If you're interested in watching similar interviews — subscribe, more useful and unique content ahead!

Timestamps:

00:00 Introduction
00:29 A few words about the interviewer and candidate
05:24 Questions
21:13 Working with code
49:20 Continuation of theoretical questions
01:04:15 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://www.tbank.ru/cf/4PYyn4udS41