← 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: he reasoned genuinely without memorized definitions, stayed engaged through curveball questions, and figured out an unfamiliar for ... else bug live on the spot. Key areas to polish are exception-handling control flow (try / except) and confidence when explaining core terminology.

Candidate: Alexander
Target role: Junior Python Backend

21 y/o, Saint Petersburg · Information Security graduate (SPbSEU), finishing an advanced Python backend course, built pet projects including a Pinterest-like image similarity gallery

Answers accuracy 13 total
58% score
Theory
4/10 correct · 60%
Live coding
1/3 correct · 50%
Practical task
Solved

Searching a list and debugging a for ... else loop missing break

Seeing a for ... else clause for the first time, the candidate initially expected an IndentationError, but after running the snippet he analyzed the behavior, added break upon finding the target, tested a missing-element case, and accurately deduced how for ... else works.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Genuine independent reasoning without rote definitions and willingness to think on his feet
  • + Strong live debugging: deduced the unfamiliar for ... else construct and fixed the bug with break
  • + Solid grasp of generators, lazy evaluation, and real-world use cases like streaming responses
  • + Resilience under pressure: kept analyzing and engaging constructively despite visible nerves

Areas to improve

  • → Clarify exception control flow and try / except mechanics (why caught exceptions do not terminate a program)
  • → Review core data-model dunder methods, especially the difference between __str__ and __repr__
  • → Study less common Python control-flow idioms such as for / while ... else
  • → Build vocal confidence so sound technical reasoning is not undermined by self-doubt

Questions in this interview

13 / 13
01 ▶ 03:28
What is a function in Python and how do built-in functions differ from user-defined ones?
Theory Functions, scopes & closures
?
Candidate's answer

Described a function as a reusable transformation from inputs to outputs and noted that built-in functions are available out of the box without prior definition.

Key takeaway

Built-in functions reside in the builtins namespace (mostly implemented in C in CPython), whereas user functions are defined via def or lambda.

Open moment on YouTube ↗
#01
02 ▶ 05:20
What are methods, how do they differ from regular functions, and what kinds of methods exist in Python classes?
Theory OOP, classes & dunder methods
?
Candidate's answer

Defined methods as class-bound functions and distinguished regular methods, @classmethod, and @staticmethod, but was imprecise on instance state (self) and module namespaces for plain functions.

Key takeaway

Instance methods bind self, @classmethod binds cls, @staticmethod binds neither, and top-level functions belong to their module's namespace.

Open moment on YouTube ↗
#02
03 ▶ 08:05
What are magic (dunder) methods, where do default ones come from, and why override __str__ in practice?
Theory OOP, classes & dunder methods
?
Candidate's answer

Rightly noted classes inherit default dunder implementations and gave Django Admin model display as a practical __str__ example, though struggled to articulate broader everyday use cases.

Key takeaway

Every Python 3 class inherits default dunder methods from object; overriding __str__ provides human-readable output in print(), f-strings, admin UIs, and logs.

Open moment on YouTube ↗
#03
04 ▶ 15:54
What is the __repr__ dunder method for and how does it differ from __str__?
Theory OOP, classes & dunder methods
?
Candidate's answer

Recalled that __repr__ also relates to string representation, but honestly admitted not remembering how it differs from __str__.

Key takeaway

__repr__ provides an unambiguous developer-facing representation (used in the REPL, debuggers, container printing, and as fallback when __str__ is absent).

Open moment on YouTube ↗
#04
05 ▶ 16:38
What loop constructs exist in Python, how do for and while differ, and what is an iteration?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Named for and while, clearly contrasting condition-driven repetition (while) with iterating over an iterable/sequence (for), and defined an iteration as one loop step.

Key takeaway

Python has only two loops: for (driven by the iterator protocol iter()/next()) and while (condition-checked before each pass), with no built-in do-while.

Open moment on YouTube ↗
#05
06 ▶ 18:13
How do generators differ from eager loop iteration and what practical benefits do they offer?
Theory Decorators, iterators, generators & context managers
?
Candidate's answer

Explained lazy evaluation with suspension and resumption of state, highlighting low memory footprint on large datasets and chunked HTTP streaming responses.

Key takeaway

Generators yield items lazily one at a time on next(), keeping memory usage O(1) instead of materializing an entire list in RAM.

Open moment on YouTube ↗
#06
07 ▶ 22:53
What happens when running a list-search snippet where else is aligned with the for-loop (without break)?
Live coding Control flow, loops & syntactic sugar
?
Candidate's answer

Assumed the else indentation was invalid and predicted an IndentationError, thinking else could only pair with the inner if.

Key takeaway

for ... else is valid Python syntax: if the loop finishes naturally without hitting break, the else suite runs right after the loop.

Open moment on YouTube ↗
#07
08 ▶ 31:55
How do you fix the for ... else search so 'Not found' isn't printed after a match, and what is the exact rule for loop else?
Live coding Control flow, loops & syntactic sugar
?
Candidate's answer

Analyzed the runtime behavior, placed break right after printing 'Found', tested both present and absent target values, and stated the exact loop-else rule.

Key takeaway

Think of loop else as 'no-break': it executes if and only if the loop terminates normally without encountering a break statement.

Open moment on YouTube ↗
#08
09 ▶ 34:49
What other code review improvements or validations would you add to this search snippet?
Live coding Algorithms, code reading & engineering practices
?
Candidate's answer

Rightly suggested parameterizing the target number and validating external input, but also proposed a redundant explicit empty-list check.

Key takeaway

An explicit empty-list guard before for ... else is redundant: an empty iterable skips the loop body and jumps straight to the else block.

Open moment on YouTube ↗
#09
10 ▶ 36:54
What are exceptions in Python, how do they differ from errors, and why raise exceptions manually?
Theory Exceptions & debugging
?
Candidate's answer

Gave valid examples (TypeError, IndexError) and manual raise for input validation, but mistakenly believed raising an exception always halts the entire script.

Key takeaway

raise signals a contract violation up the call stack to the nearest matching except handler, terminating the process only if left unhandled at top level.

Open moment on YouTube ↗
#10
11 ▶ 44:01
Does a program terminate after catching an exception in try / except, and why doesn't a FastAPI server crash on HTTPException?
Theory Exceptions & debugging
?
Candidate's answer

Claimed a plain Python script still stops after running an except block, attributing FastAPI's survival solely to running behind a web server.

Key takeaway

Once an except block handles an exception without re-raising it, normal execution resumes right after the try / except statement — the exact mechanism web frameworks use per request.

Open moment on YouTube ↗
#11
12 ▶ 47:36
What are a console, a terminal, and a command line — and how do they differ?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Correctly described text-based OS interaction and script execution, but treated console, terminal, and command line as identical synonyms.

Key takeaway

A terminal emulator is the I/O window app, the command-line interface (CLI) is the text interaction paradigm, and the shell (bash/zsh) interprets commands inside it.

Open moment on YouTube ↗
#12
13 ▶ 49:25
What role does an ASGI server play with FastAPI, and what does 'interface' mean in software engineering?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Accurately explained an ASGI server as translating network HTTP/WebSocket traffic to and from the Python app, and generalized an interface as a boundary/contract for interaction.

Key takeaway

ASGI standardizes the async calling contract between Python web servers (Uvicorn, Hypercorn) and frameworks (FastAPI, Starlette, Django).

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

Alexander is trying his luck: functions, methods, exceptions, loops and even code analysis with a twist. In some places he answers confidently, in others he gets confused — but that's exactly how real knowledge is tested. At the end — honest feedback and advice for growth. A great example for those preparing for their first interviews!

Support the video with a like and comment if the format was helpful.

Timestamps:

00:00 Introduction
00:28 A few words about the interviewer and candidate
03:24 Theoretical questions
22:35 Code experiments and questions about them
36:50 Continuation of theoretical questions
52:31 Feedback exchange

#python #junior #interview #interview #programming #development